Add native SolarXiao MPPT and battery telemetry and controls

This commit is contained in:
mikecarper committed 2026-10-21 15:25:53 -07:00
1 parent e5c8d28d5e
commit 2dcc1caccb
15 files changed
+1357 -2

No files matched your search

+4
View File
@@ -1,4 +1,5 @@
#include <helpers/RegulatorSettings.h>
#include <helpers/sensors/SolarXiaoPower.h>
#include <helpers/LedSettings.h>
#include <helpers/ui/DisplayPowerSettings.h>
#if defined(OLED_AUTO_DETECT) && OLED_AUTO_DETECT && defined(DISPLAY_CLASS)
@@ -10771,6 +10772,9 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp,
}
if (mesh::power::handleRegulatorCommand(command, reply, reply_capacity)) return true;
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
if (mesh::solar::handleCommand(command, reply, reply_capacity, sender_timestamp == 0)) return true;
#endif
#if defined(WIO_E5_MINI_HEADLESS_COMPANION_UI)
if (handleCompactLedCommand(command, reply, reply_capacity)) return true;
#else
+7
View File
@@ -1,4 +1,5 @@
#include <helpers/RegulatorSettings.h>
#include <helpers/sensors/SolarXiaoPower.h>
#include <helpers/LedSettings.h>
#include <Arduino.h> // needed for PlatformIO
#include <helpers/ui/StartupScreen.h>
@@ -3640,6 +3641,9 @@ void setup() {
#endif
#if !defined(WIO_E5_MINI_HEADLESS_COMPANION_UI)
mesh::leds::beginSettings(board, regulator_prefs_fs);
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
mesh::solar::beginSettings(regulator_prefs_fs);
#endif
#endif
if (!mesh::power::beginRegulatorSettings(board, radio_driver, regulator_prefs_fs)) {
MESH_DEBUG_PRINTLN("Regulator selection could not be applied");
@@ -4269,6 +4273,9 @@ void loop() {
#endif
rtc_clock.tick();
mesh::power::serviceRegulatorSettings();
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
mesh::solar::service();
#endif
board.loop();
if (mesh::serviceUsbLoggingWatchdog(usbLoggingRecoverySafe)) board.reboot();
#ifdef TBEAM_1W
+7
View File
@@ -1,4 +1,5 @@
#include <helpers/RegulatorSettings.h>
#include <helpers/sensors/SolarXiaoPower.h>
#include <helpers/LedSettings.h>
#include <Arduino.h> // needed for PlatformIO
#include <Mesh.h>
@@ -213,6 +214,9 @@ void setup() {
if (volatile_primary_fs) regulator_prefs_fs = nullptr;
#endif
mesh::leds::beginSettings(board, regulator_prefs_fs);
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
mesh::solar::beginSettings(regulator_prefs_fs);
#endif
if (!mesh::power::beginRegulatorSettings(board, radio_driver, regulator_prefs_fs)) {
MESH_DEBUG_PRINTLN("Regulator selection could not be applied");
}
@@ -555,6 +559,9 @@ static void __attribute__((noinline)) serviceCommandInterfaces() {
}
mesh::power::serviceRegulatorSettings();
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
mesh::solar::service();
#endif
board.loop(); // let the board feed its watchdog, run periodic housekeeping
#ifdef ETHERNET_ENABLED
+7
View File
@@ -1,4 +1,5 @@
#include <helpers/RegulatorSettings.h>
#include <helpers/sensors/SolarXiaoPower.h>
#include <helpers/LedSettings.h>
#include <Arduino.h> // needed for PlatformIO
#include <Mesh.h>
@@ -147,6 +148,9 @@ void setup() {
if (volatile_primary_fs) regulator_prefs_fs = nullptr;
#endif
mesh::leds::beginSettings(board, regulator_prefs_fs);
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
mesh::solar::beginSettings(regulator_prefs_fs);
#endif
if (!mesh::power::beginRegulatorSettings(board, radio_driver, regulator_prefs_fs)) {
MESH_DEBUG_PRINTLN("Regulator selection could not be applied");
}
@@ -407,6 +411,9 @@ void loop() {
#endif
rtc_clock.tick();
mesh::power::serviceRegulatorSettings();
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
mesh::solar::service();
#endif
board.loop();
if (mesh::serviceUsbLoggingWatchdog(usbLoggingRecoverySafe)) board.reboot();
#if MESH_USB_CONSOLE_COOPERATIVE