diff --git a/README.md b/README.md index 0f3985b..7452a47 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 498d98e..ce76f7e 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -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; } diff --git a/src/pitrix.cpp b/src/pitrix.cpp index e0ced31..511d306 100644 --- a/src/pitrix.cpp +++ b/src/pitrix.cpp @@ -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