Firmware flow
How state-of-charge data falls back to cellular
Complete state-of-charge publication selector.
Use Wi-Fi when it is enabled and connected. If that publication succeeds, stop; otherwise call the cellular publication routine.
The excerpt attempts cellular publication after unavailable or unsuccessful Wi-Fi. It does not show cellular success checking, retries or guaranteed delivery.
Read the implementation
publication fallback excerpt · selected source lines 297–307. Source inspection is not a hardware test.
void sendSOC(int soc) {
bool sent=false;
if (wifiEnabled && wifiConnected) {
sent = publishSOC_WLAN(soc);
if (sent) return;
Serial.println("⚠️ WLAN failed → LTE fallback");
}
mqttPublishSOC_LTE(soc);
}Open the exact source-level diagramTechnical notes
State-of-charge input
readSOC() identifies state of charge as a data input for the gateway’s reporting task.
Wi-Fi and MQTT connections
wifiConnectOnce() and wifiMqttEnsureConnected() separate the Wi-Fi connection from the MQTT connection. These are distinct stages between having local data and making it available to a remote subscriber.
MQTT publication
wifiPublishSOC() names the publication step explicitly. The overall gateway scope considers cellular and Wi-Fi connectivity, while the Wi-Fi routines show the progression from network access to application-level reporting.