Browse Source

Add 'board' to the MQTT heartbeat

rfm69
Maxim Prokhorov 6 years ago
parent
commit
d99a58676a
2 changed files with 5 additions and 0 deletions
  1. +2
    -0
      code/espurna/config/general.h
  2. +3
    -0
      code/espurna/utils.ino

+ 2
- 0
code/espurna/config/general.h View File

@ -181,6 +181,7 @@
#define HEARTBEAT_REPORT_HOSTNAME 1
#define HEARTBEAT_REPORT_APP 1
#define HEARTBEAT_REPORT_VERSION 1
#define HEARTBEAT_REPORT_BOARD 1
#define HEARTBEAT_REPORT_INTERVAL 0
//------------------------------------------------------------------------------
@ -617,6 +618,7 @@ PROGMEM const char* const custom_reset_string[] = {
#define MQTT_TOPIC_UARTIN "uartin"
#define MQTT_TOPIC_UARTOUT "uartout"
#define MQTT_TOPIC_LOADAVG "loadavg"
#define MQTT_TOPIC_BOARD "board"
// Light module
#define MQTT_TOPIC_CHANNEL "channel"


+ 3
- 0
code/espurna/utils.ino View File

@ -137,6 +137,9 @@ void heartbeat() {
#if (HEARTBEAT_REPORT_VERSION)
mqttSend(MQTT_TOPIC_VERSION, APP_VERSION);
#endif
#if (HEARTBEAT_REPORT_BOARD)
mqttSend(MQTT_TOPIC_BOARD, getBoardName().c_str());
#endif
#if (HEARTBEAT_REPORT_HOSTNAME)
mqttSend(MQTT_TOPIC_HOSTNAME, getSetting("hostname").c_str());
#endif


Loading…
Cancel
Save