diff options
| author | Jon duSaint | 2026-02-23 21:47:21 -0800 |
|---|---|---|
| committer | Jon duSaint | 2026-02-23 21:47:21 -0800 |
| commit | 79a66b932bd85c024bcf12ac346e25817041362d (patch) | |
| tree | 81f82b5ab592a719a7707741b0f4fff167344609 | |
| parent | 4f23aecc3b2cea0b57ae16e8818eb99195321827 (diff) | |
mqtt-esp5100: Fix a couple of issues
An MQTT mismatch and a foreground bug.
| -rw-r--r-- | mqtt-esp5100.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mqtt-esp5100.c b/mqtt-esp5100.c index 1413014..abaadfa 100644 --- a/mqtt-esp5100.c +++ b/mqtt-esp5100.c @@ -70,7 +70,7 @@ struct battery_info { #define B battery_info[battery - 1] -bool foreground = true; +bool foreground = false; void message (int level, char *const m, ...) { @@ -434,8 +434,8 @@ publish (struct mosquitto *mosq, int battery) { snprintf (payload, sizeof (payload),"\ {\ \"canid\": %d, \"soh\": %4.2f, \"soc\": %4.2f, \"i\": %5.3f, \"v\": %5.3f, \"t1\": %d, \"t2\": %d, \"t3\": %d,\ - \"v1\": %5.3f, \"v2\": %5.3f, \"v3\": %5.3f, \"v4\": %5.3f, \"v5\": %5.3f, \"v6\": %5.3f, \"v7\": %5.3f, \"v8\": %5.3f,\ - \"v9\": %5.3f, \"v10\": %5.3f, \"v11\": %5.3f, \"v12\": %5.3f, \"v13\": %5.3f, \"v14\": %5.3f, \"v15\": %5.3f, \"v16\": %5.3f }", + \"v01\": %5.3f, \"v02\": %5.3f, \"v03\": %5.3f, \"v04\": %5.3f, \"v05\": %5.3f, \"v06\": %5.3f, \"v07\": %5.3f, \"v08\": %5.3f,\ + \"v09\": %5.3f, \"v10\": %5.3f, \"v11\": %5.3f, \"v12\": %5.3f, \"v13\": %5.3f, \"v14\": %5.3f, \"v15\": %5.3f, \"v16\": %5.3f }", battery, B.soh, B.soc, (float)B.current, (float)B.f1_voltage / 1000, B.t[0], B.t[1], B.t[2], (float)B.cell_voltages[0] / 1000, (float)B.cell_voltages[1] / 1000, (float)B.cell_voltages[2] / 1000, (float)B.cell_voltages[3] / 1000, (float)B.cell_voltages[4] / 1000, (float)B.cell_voltages[5] / 1000, (float)B.cell_voltages[6] / 1000, (float)B.cell_voltages[7] / 1000, |
