Add LiPo battery monitoring with ESP-NOW cache and dashboard API.
Slaves report pack voltages every 30s; the master caches them for fast BATTERY_STATUS reads. goTool exposes REST/WebSocket and shows values in the dashboard, with a nanopb fix so optional lipo submessages encode. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-2
@@ -11,6 +11,7 @@
|
||||
#include "cmd_ota.h"
|
||||
#include "cmd_ota_slave_progress.h"
|
||||
#include "cmd_led_ring.h"
|
||||
#include "cmd_battery.h"
|
||||
#include "esp_now_comm.h"
|
||||
#include "powerpod.h"
|
||||
#include "driver/gpio.h"
|
||||
@@ -163,6 +164,8 @@ void app_main(void) {
|
||||
ESP_LOGI(TAG, "Running Partition: %s (OTA slot %d)",
|
||||
app_config.running_partition, ota_slot);
|
||||
|
||||
board_input_init();
|
||||
|
||||
err = esp_now_comm_init(&app_config);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "ESP-NOW init failed: %s", esp_err_to_name(err));
|
||||
@@ -170,8 +173,6 @@ void app_main(void) {
|
||||
|
||||
led_ring_init();
|
||||
|
||||
board_input_init();
|
||||
|
||||
if (app_config.master) {
|
||||
cmd_queue = xQueueCreate(64, sizeof(generic_msg_t));
|
||||
init_cmdHandler(cmd_queue);
|
||||
@@ -185,6 +186,7 @@ void app_main(void) {
|
||||
cmd_espnow_find_me_register();
|
||||
cmd_restart_register();
|
||||
cmd_led_ring_register();
|
||||
cmd_battery_register();
|
||||
cmd_ota_register();
|
||||
cmd_ota_slave_progress_register();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user