Le tampon d'evenements, celui que lit un fabricant
Le BMS tient deux tampons distincts et je n'avais extrait que l'un des deux. history echantillonne toutes les trente minutes sur cinq semaines ; event n'enregistre que les declenchements, a la seconde, et remonte jusqu'a mai 2025. C'est le second qui porte la preuve : le 27/07 sur le module ...0319, quatre declenchements en trois minutes, cellule haute a 3650 mV. Et il couvre seize mois, donc il contient le moment ou ces cellules ont ete abimees. Premier ecart, sans aucune interpretation : les quatre modules du pack recent totalisent 38 evenements depuis mai 2025 - 19, 12, 6 et 1. Le module abime en compte 805 a lui seul. --tampon event ajoute au mode d'extraction distante. Le garde pose plus tot a d'ailleurs fonctionne : un module a refuse de partir sans code-barres plutot que de rendre un fichier anonyme. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KKzkkVTG6KXnGXFFC7X9XJ
This commit is contained in:
45
docs/mesures/batteries/202609051807-console.txt
Normal file
45
docs/mesures/batteries/202609051807-console.txt
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
===== 05/09/2026 18:07:51 =====
|
||||||
|
data 2 event 1
|
||||||
|
data 2 event 1
|
||||||
|
|
||||||
|
@
|
||||||
|
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
Item Index : 1
|
||||||
|
|
||||||
|
Time : 25-05-23 18:53:44
|
||||||
|
|
||||||
|
Voltage : 53993 mV
|
||||||
|
|
||||||
|
Current : 7089 mA
|
||||||
|
|
||||||
|
Temperature : 25700 mC
|
||||||
|
|
||||||
|
Percent : 100 %
|
||||||
|
|
||||||
|
Total Coulomb : 50000 mAH
|
||||||
|
|
||||||
|
Max Voltage : 54000 mV
|
||||||
|
|
||||||
|
Base State : Charge
|
||||||
|
|
||||||
|
Volt. State : High
|
||||||
|
|
||||||
|
Curr. State : Normal
|
||||||
|
|
||||||
|
Tempr. State : Normal
|
||||||
|
|
||||||
|
Coul. Status : Full
|
||||||
|
|
||||||
|
Power Events : 0x0
|
||||||
|
|
||||||
|
Bat Events : 0x2 BHV
|
||||||
|
|
||||||
|
Bat Protect ENA : BOV BHV BLV BUV BSLP CBOT CBHT CBLT CBUT DBOT DBHT DBLT DBUT
|
||||||
|
|
||||||
|
Pwr Protect ENA : POV PHV PLV PUV PSLP POT PHT COC2 COC COCA DOCA DOC DOC2 SC LCOUL
|
||||||
|
|
||||||
|
System Fault : 0x0
|
||||||
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
heure_reelle,module,etat,courant_mA,soc,c1_mV,c2_mV,c3_mV,c4_mV,c5_mV,c6_mV,c7_mV,c8_mV,c9_mV,c10_mV,c11_mV,c12_mV,c13_mV,c14_mV,c15_mV,ecart_mV
|
||||||
|
2025-05-23T16:53:42.990Z,Y230202C30371425,Charge,7089,100,3589,3604,3608,3606,3559,3607,3606,3607,3603,3570,3607,3607,3604,3609,3607,50
|
||||||
|
2025-05-23T16:53:44.990Z,Y230202C30371425,Charge,13619,100,3640,3655,3660,3658,3606,3660,3657,3658,3654,3618,3661,3658,3654,3661,3660,55
|
||||||
|
2025-05-23T17:05:08.990Z,Y230202C30371425,Charge,0,100,3499,3501,3502,3501,3490,3501,3501,3501,3501,3496,3501,3501,3501,3500,3501,12
|
||||||
|
2025-05-23T17:05:12.990Z,Y230202C30371425,Charge,0,100,3499,3501,3501,3501,3490,3501,3501,3501,3500,3496,3501,3501,3501,3500,3501,11
|
||||||
|
2025-05-23T17:05:14.990Z,Y230202C30371425,Charge,0,100,3499,3501,3501,3501,3490,3501,3500,3501,3500,3496,3501,3501,3501,3500,3501,11
|
||||||
|
2025-05-23T17:05:16.990Z,Y230202C30371425,Charge,0,100,3499,3501,3501,3501,3490,3500,3500,3501,3500,3496,3500,3501,3501,3500,3501,11
|
||||||
|
2025-05-23T17:05:18.990Z,Y230202C30371425,Charge,0,100,3499,3501,3501,3501,3490,3500,3500,3500,3500,3496,3500,3500,3501,3500,3501,11
|
||||||
|
2025-05-23T17:05:20.990Z,Y230202C30371425,Charge,0,100,3499,3501,3501,3500,3490,3500,3500,3500,3500,3495,3500,3501,3501,3500,3501,11
|
||||||
|
2025-05-23T17:05:22.990Z,Y230202C30371425,Charge,0,100,3498,3501,3501,3500,3490,3500,3500,3500,3500,3495,3500,3500,3501,3500,3500,11
|
||||||
|
2025-05-23T17:05:24.990Z,Y230202C30371425,Charge,0,100,3498,3500,3501,3500,3490,3500,3500,3500,3500,3495,3500,3500,3501,3500,3500,11
|
||||||
|
2025-05-23T17:05:26.990Z,Y230202C30371425,Charge,0,100,3498,3500,3501,3500,3489,3500,3500,3500,3500,3495,3500,3500,3500,3500,3500,12
|
||||||
|
2025-05-23T17:05:38.990Z,Y230202C30371425,Charge,0,100,3498,3500,3500,3500,3489,3500,3500,3500,3499,3495,3499,3500,3500,3499,3500,11
|
||||||
|
@@ -0,0 +1,20 @@
|
|||||||
|
heure_reelle,module,etat,courant_mA,soc,c1_mV,c2_mV,c3_mV,c4_mV,c5_mV,c6_mV,c7_mV,c8_mV,c9_mV,c10_mV,c11_mV,c12_mV,c13_mV,c14_mV,c15_mV,ecart_mV
|
||||||
|
2025-05-19T22:17:58.857Z,Y230202C30371426,Idle,0,89,3364,3365,3368,3368,3364,3364,3368,3365,3368,3368,3364,3368,3360,3368,3365,8
|
||||||
|
2025-05-19T22:55:29.857Z,Y230202C30371426,Idle,-729,89,3375,3375,3375,3376,3374,3375,3376,3375,3376,3375,3375,3376,3370,3376,3374,6
|
||||||
|
2025-05-23T16:53:40.857Z,Y230202C30371426,Charge,7205,100,3589,3590,3588,3590,3588,3592,3592,3590,3593,3591,3593,3590,3550,3589,3588,43
|
||||||
|
2025-05-23T16:53:42.857Z,Y230202C30371426,Charge,7092,100,3601,3602,3600,3602,3600,3605,3605,3603,3606,3603,3605,3603,3561,3601,3601,45
|
||||||
|
2025-05-23T16:53:44.857Z,Y230202C30371426,Charge,14243,100,3653,3653,3650,3653,3652,3657,3655,3653,3657,3655,3658,3654,3606,3652,3653,52
|
||||||
|
2025-05-23T17:04:56.857Z,Y230202C30371426,Charge,0,100,3501,3502,3501,3502,3500,3501,3502,3501,3502,3501,3501,3501,3491,3502,3501,11
|
||||||
|
2025-05-23T17:05:00.857Z,Y230202C30371426,Charge,0,100,3501,3501,3501,3502,3500,3500,3502,3501,3502,3501,3501,3501,3491,3501,3501,11
|
||||||
|
2025-05-23T17:05:02.857Z,Y230202C30371426,Charge,0,100,3501,3501,3501,3502,3500,3500,3502,3501,3501,3501,3501,3501,3491,3501,3500,11
|
||||||
|
2025-05-23T17:05:06.857Z,Y230202C30371426,Charge,0,100,3500,3501,3501,3501,3500,3500,3501,3501,3501,3501,3501,3501,3491,3501,3500,10
|
||||||
|
2025-05-23T17:05:08.857Z,Y230202C30371426,Charge,0,100,3500,3501,3501,3501,3500,3500,3501,3501,3501,3501,3500,3501,3491,3501,3500,10
|
||||||
|
2025-05-23T17:05:10.857Z,Y230202C30371426,Charge,0,100,3500,3501,3501,3501,3500,3500,3501,3500,3501,3500,3500,3501,3491,3501,3500,10
|
||||||
|
2025-05-23T17:05:18.857Z,Y230202C30371426,Charge,0,100,3500,3501,3500,3501,3500,3500,3501,3500,3501,3500,3500,3501,3491,3501,3500,10
|
||||||
|
2025-05-23T17:05:20.857Z,Y230202C30371426,Charge,0,100,3500,3501,3500,3501,3499,3500,3501,3500,3501,3500,3500,3500,3490,3501,3500,11
|
||||||
|
2025-05-23T17:05:22.857Z,Y230202C30371426,Charge,0,100,3500,3500,3500,3501,3499,3500,3501,3500,3501,3500,3500,3500,3490,3501,3500,11
|
||||||
|
2025-05-23T17:05:24.857Z,Y230202C30371426,Charge,0,100,3500,3500,3500,3501,3499,3500,3501,3500,3501,3500,3500,3500,3490,3500,3500,11
|
||||||
|
2025-05-23T17:05:28.857Z,Y230202C30371426,Charge,0,100,3500,3500,3500,3501,3499,3499,3501,3500,3500,3500,3500,3500,3490,3500,3499,11
|
||||||
|
2025-05-23T17:05:30.857Z,Y230202C30371426,Charge,0,100,3499,3500,3500,3500,3499,3499,3501,3500,3500,3500,3500,3500,3490,3500,3499,11
|
||||||
|
2025-05-23T17:05:32.857Z,Y230202C30371426,Charge,0,100,3499,3500,3500,3500,3499,3499,3500,3500,3500,3500,3500,3500,3490,3500,3499,10
|
||||||
|
2025-05-24T18:44:09.857Z,Y230202C30371426,Idle,17099,92,3378,3377,3376,3377,3376,3376,3376,3375,3375,3376,3378,3377,3377,3377,3377,3
|
||||||
|
@@ -0,0 +1,7 @@
|
|||||||
|
heure_reelle,module,etat,courant_mA,soc,c1_mV,c2_mV,c3_mV,c4_mV,c5_mV,c6_mV,c7_mV,c8_mV,c9_mV,c10_mV,c11_mV,c12_mV,c13_mV,c14_mV,c15_mV,ecart_mV
|
||||||
|
2025-05-23T16:53:42.271Z,Y230202C30371431,Charge,6812,100,3609,3608,3609,3602,3602,3582,3602,3559,3607,3603,3599,3604,3607,3598,3596,50
|
||||||
|
2025-05-23T16:53:44.271Z,Y230202C30371431,Charge,13009,100,3654,3652,3652,3644,3646,3623,3644,3597,3650,3646,3643,3647,3650,3640,3639,57
|
||||||
|
2025-05-23T17:05:01.271Z,Y230202C30371431,Charge,0,100,3500,3500,3501,3502,3500,3503,3501,3490,3501,3501,3501,3501,3501,3501,3499,13
|
||||||
|
2025-05-23T17:05:21.271Z,Y230202C30371431,Charge,0,100,3500,3500,3500,3501,3499,3502,3500,3489,3501,3500,3500,3501,3501,3501,3499,13
|
||||||
|
2025-05-23T17:05:25.271Z,Y230202C30371431,Charge,0,100,3499,3499,3500,3501,3499,3501,3500,3489,3500,3500,3500,3500,3501,3500,3498,12
|
||||||
|
2025-05-23T17:05:27.271Z,Y230202C30371431,Charge,0,100,3499,3499,3500,3501,3499,3501,3500,3489,3500,3500,3500,3500,3500,3500,3498,12
|
||||||
|
@@ -0,0 +1,2 @@
|
|||||||
|
heure_reelle,module,etat,courant_mA,soc,c1_mV,c2_mV,c3_mV,c4_mV,c5_mV,c6_mV,c7_mV,c8_mV,c9_mV,c10_mV,c11_mV,c12_mV,c13_mV,c14_mV,c15_mV,ecart_mV
|
||||||
|
2025-05-23T16:53:43.363Z,Y230202C30371427,Charge,6591,100,3606,3602,3601,3599,3600,3601,3602,3599,3573,3601,3605,3603,3601,3604,3603,33
|
||||||
|
@@ -147,7 +147,7 @@ function journal(nom, texte) {
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
const horodate = () => new Date().toLocaleString('fr-FR', { timeZone: 'Europe/Paris' });
|
const horodate = () => new Date().toLocaleString('fr-FR', { timeZone: 'Europe/Paris' });
|
||||||
const tampon = () => new Date().toLocaleString('sv-SE', { timeZone: 'Europe/Paris' }).replace(/[-: ]/g, '').slice(0, 12);
|
const horodateFichier = () => new Date().toLocaleString('sv-SE', { timeZone: 'Europe/Paris' }).replace(/[-: ]/g, '').slice(0, 12);
|
||||||
|
|
||||||
// -------------------------------------------------------------------- main
|
// -------------------------------------------------------------------- main
|
||||||
async function main() {
|
async function main() {
|
||||||
@@ -205,14 +205,14 @@ async function main() {
|
|||||||
const cmd = arg('commande');
|
const cmd = arg('commande');
|
||||||
const txt = await commande(l, String(cmd));
|
const txt = await commande(l, String(cmd));
|
||||||
console.log(txt);
|
console.log(txt);
|
||||||
console.log('--- journalise dans ' + journal(`${tampon()}-console.txt`,
|
console.log('--- journalise dans ' + journal(`${horodateFichier()}-console.txt`,
|
||||||
`\n===== ${horodate()} =====\n${cmd}\n${txt}\n`));
|
`\n===== ${horodate()} =====\n${cmd}\n${txt}\n`));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg('historique')) {
|
if (arg('historique')) {
|
||||||
const depuis = +(arg('depuis', '1')) || 1;
|
const depuis = +(arg('depuis', '1')) || 1;
|
||||||
const nom = `${tampon()}-historique.txt`;
|
const nom = `${horodateFichier()}-historique.txt`;
|
||||||
console.log(`Extraction de l'historique a partir de l'enregistrement ${depuis}.`);
|
console.log(`Extraction de l'historique a partir de l'enregistrement ${depuis}.`);
|
||||||
console.log('Le module en garde 1798, un toutes les 30 minutes : comptez plusieurs minutes.');
|
console.log('Le module en garde 1798, un toutes les 30 minutes : comptez plusieurs minutes.');
|
||||||
const f = journal(nom, `# releve du ${horodate()} sur ${dev}\n`);
|
const f = journal(nom, `# releve du ${horodate()} sur ${dev}\n`);
|
||||||
@@ -252,6 +252,12 @@ async function main() {
|
|||||||
// Un seul branchement par chaine suffit donc pour tout son historique.
|
// Un seul branchement par chaine suffit donc pour tout son historique.
|
||||||
if (arg('historique-distant')) {
|
if (arg('historique-distant')) {
|
||||||
const ad = parseInt(String(arg('historique-distant')), 10);
|
const ad = parseInt(String(arg('historique-distant')), 10);
|
||||||
|
// Deux tampons distincts vivent dans le BMS. `history` echantillonne
|
||||||
|
// toutes les 30 minutes sur cinq semaines ; `event` n'enregistre QUE les
|
||||||
|
// declenchements, a la seconde, et remonte bien plus loin — jusqu'a mai
|
||||||
|
// 2025 sur ces modules. C'est le second que lit un fabricant.
|
||||||
|
const tampon = arg('tampon', 'history') === 'event' ? 'event' : 'history';
|
||||||
|
const MAX = tampon === 'event' ? 900 : 1800;
|
||||||
if (!(ad >= 1 && ad <= 16)) { console.log('Adresse invalide.'); process.exit(1); }
|
if (!(ad >= 1 && ad <= 16)) { console.log('Adresse invalide.'); process.exit(1); }
|
||||||
|
|
||||||
// Le decalage se mesure AVANT, car les enregistrements stockes portent
|
// Le decalage se mesure AVANT, car les enregistrements stockes portent
|
||||||
@@ -278,15 +284,16 @@ async function main() {
|
|||||||
console.log('Relancer la commande — la ligne aura eu le temps de se vider.');
|
console.log('Relancer la commande — la ligne aura eu le temps de se vider.');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
const f = path.join(DOSSIER, `${tampon()}-histo-distant-${bc}.csv`);
|
const f = path.join(DOSSIER,
|
||||||
|
`${horodateFichier()}-${tampon === 'event' ? 'evenements' : 'histo'}-distant-${bc}.csv`);
|
||||||
fs.mkdirSync(DOSSIER, { recursive: true });
|
fs.mkdirSync(DOSSIER, { recursive: true });
|
||||||
fs.writeFileSync(f, 'heure_reelle,module,etat,courant_mA,soc,' +
|
fs.writeFileSync(f, 'heure_reelle,module,etat,courant_mA,soc,' +
|
||||||
Array.from({ length: 15 }, (_, i) => `c${i + 1}_mV`).join(',') + ',ecart_mV\n');
|
Array.from({ length: 15 }, (_, i) => `c${i + 1}_mV`).join(',') + ',ecart_mV\n');
|
||||||
console.log(`Module ${bc} (adresse ${ad}) -> ${f}`);
|
console.log(`Module ${bc} (adresse ${ad}), tampon ${tampon} -> ${f}`);
|
||||||
|
|
||||||
let ecrits = 0, vides = 0;
|
let ecrits = 0, vides = 0;
|
||||||
for (let n = 1; n <= 1800; n++) {
|
for (let n = 1; n <= MAX; n++) {
|
||||||
const t = await commande(l, `data ${ad} history ${n}`, 8000);
|
const t = await commande(l, `data ${ad} ${tampon} ${n}`, 8000);
|
||||||
const mt = t.match(/Time\s*:\s*(\d\d-\d\d-\d\d \d\d:\d\d:\d\d)/);
|
const mt = t.match(/Time\s*:\s*(\d\d-\d\d-\d\d \d\d:\d\d:\d\d)/);
|
||||||
const cel = cellules(t);
|
const cel = cellules(t);
|
||||||
if (!mt || !cel || cel.length < 15) {
|
if (!mt || !cel || cel.length < 15) {
|
||||||
@@ -310,7 +317,7 @@ async function main() {
|
|||||||
|
|
||||||
if (arg('suivi')) {
|
if (arg('suivi')) {
|
||||||
const pas = Math.max(10, +(arg('suivi', '30')) || 30);
|
const pas = Math.max(10, +(arg('suivi', '30')) || 30);
|
||||||
const nom = `${tampon()}-suivi.csv`;
|
const nom = `${horodateFichier()}-suivi.csv`;
|
||||||
const f = path.join(DOSSIER, nom);
|
const f = path.join(DOSSIER, nom);
|
||||||
fs.mkdirSync(DOSSIER, { recursive: true });
|
fs.mkdirSync(DOSSIER, { recursive: true });
|
||||||
if (!fs.existsSync(f)) {
|
if (!fs.existsSync(f)) {
|
||||||
@@ -369,7 +376,7 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Par defaut : un instantane complet.
|
// Par defaut : un instantane complet.
|
||||||
const nom = `${tampon()}-instantane.txt`;
|
const nom = `${horodateFichier()}-instantane.txt`;
|
||||||
let tout = `# releve du ${horodate()} sur ${dev} a ${VITESSE} bauds\n`;
|
let tout = `# releve du ${horodate()} sur ${dev} a ${VITESSE} bauds\n`;
|
||||||
for (const c of ['info', 'stat', 'data']) {
|
for (const c of ['info', 'stat', 'data']) {
|
||||||
const txt = await commande(l, c, 12000);
|
const txt = await commande(l, c, 12000);
|
||||||
|
|||||||
Reference in New Issue
Block a user