BL0937 - fallback for for forced publishing of measured values.

MQTT - added some statistical functionality, monitorig MQTT communication.
HTTP server - added print of MQTT stats.
This commit is contained in:
root
2022-10-02 20:06:26 +02:00
parent 6169295f18
commit e123826e81
4 changed files with 89 additions and 18 deletions

View File

@ -527,7 +527,11 @@ int http_fn_index(http_request_t *request) {
hprintf128(request,"<h5>Ping watchdog - %i lost, %i ok!</h5>",
PingWatchDog_GetTotalLost(),PingWatchDog_GetTotalReceived());
hprintf128(request,"<h5>MQTT State: %s</h5>", (Main_HasMQTTConnected()==1)?"connected":"disconnected");
hprintf128(request,"<h5>MQTT State: %s RES: %d(%s)<br>", (Main_HasMQTTConnected()==1)?"connected":"disconnected",
MQTT_GetConnectResult(), get_error_name(MQTT_GetConnectResult()) );
hprintf128(request,"MQTT ErrMsg: %s <br>", (MQTT_GetStatusMessage()!=NULL)?MQTT_GetStatusMessage():"");
hprintf128(request,"MQTT Stats:CONN: %d PUB: %d RECV: %d ERR: %d </h5>", MQTT_GetConnectEvents(),
MQTT_GetPublishEventCounter(), MQTT_GetReceivedEventCounter(), MQTT_GetPublishErrorCounter());
// for normal page loads, show the rest of the HTML
if(!http_getArg(request->url,"state",tmpA,sizeof(tmpA))) {