Browse Source

Report SSID with heartbeat messages

alexa
Xose Pérez 6 years ago
parent
commit
88a7076ad3
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

@ -187,6 +187,7 @@
// Topics that will be reported in heartbeat
#define HEARTBEAT_REPORT_STATUS 1
#define HEARTBEAT_REPORT_SSID 1
#define HEARTBEAT_REPORT_IP 1
#define HEARTBEAT_REPORT_MAC 1
#define HEARTBEAT_REPORT_RSSI 1
@ -731,6 +732,7 @@
#define MQTT_TOPIC_LED "led"
#define MQTT_TOPIC_BUTTON "button"
#define MQTT_TOPIC_IP "ip"
#define MQTT_TOPIC_SSID "ssid"
#define MQTT_TOPIC_VERSION "version"
#define MQTT_TOPIC_UPTIME "uptime"
#define MQTT_TOPIC_DATETIME "datetime"


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

@ -184,6 +184,9 @@ void heartbeat() {
#if (HEARTBEAT_REPORT_HOSTNAME)
mqttSend(MQTT_TOPIC_HOSTNAME, getSetting("hostname").c_str());
#endif
#if (HEARTBEAT_REPORT_SSID)
mqttSend(MQTT_TOPIC_SSID, WiFi.SSID().c_str());
#endif
#if (HEARTBEAT_REPORT_IP)
mqttSend(MQTT_TOPIC_IP, getIP().c_str());
#endif


Loading…
Cancel
Save