Added fps to MQTT metrics.

This commit is contained in:
Fabian Schlenz 2019-06-12 20:49:37 +02:00
parent ca980b0c9f
commit 308196d185
3 changed files with 3 additions and 1 deletions

View File

@ -47,5 +47,6 @@ seconds:
* `MQTT_TOPIC/free_heap` contains the free heap memory in Bytes.
* `MQTT_TOPIC/uptime` contains the uptime of pitrix in seconds.
* `MQTT_TOPIC/fps` contains the currently reached frames per second.
If you enabled `DEBUG`, log messages will be sent to `MQTT_TOPIC/log`.

View File

@ -58,7 +58,7 @@ void mqtt_callback(char* original_topic, byte* pl, unsigned int length) {
topic.remove(0, strlen(MQTT_TOPIC)); // Strip MQTT_TOPIC from the beginning
LOG("MQTT * Remaining topic is: "); LOGln(topic.c_str());
if (topic.compareTo("free_heap")==0 || topic.compareTo("uptime")==0 || topic.compareTo("status")==0) {
if (topic.compareTo("free_heap")==0 || topic.compareTo("uptime")==0 || topic.compareTo("status")==0 || topic.compareTo("fps")==0) {
// Ignore our own messages.
return;
}

View File

@ -77,6 +77,7 @@ void loop() {
EVERY_N_SECONDS(15) {
mqtt_publish("free_heap", ESP.getFreeHeap());
mqtt_publish("uptime", millis()/1000);
mqtt_publish("fps", FastLED.getFPS());
}
#endif // MQTT_REPORT_METRICS