Advanced: syslog - plan-d-io/P1-dongle GitHub Wiki
The P1-dongle keeps an internal syslog. This can be helpful for debugging purposes. The syslog can be accessed over HTTP or MQTT.
Endpoint <dongle ip>/syslog
, <dongle ip>/syslog0
Supported methods GET, POST
/syslog
displays the current running syslog, syslog0
contains an older, archived syslog.
Example syslog
INFO: Boot #260, 1, 0
INFO: Last reset reason (hardware): POWERON_RESET, 1, 1
INFO: Last reset reason (firmware): 2023/12/03 21:53:01 Rebooting requested from webmin, 1, 1
INFO: WiFi mode: station, 1, 1
INFO: Connected to the WiFi network Testnetwerk, 1, 1
INFO: Time set: 2023/12/03 21:54:48, 1, 1
2023/12/03 21:54:48 INFO: MQTT enabled! Will connect as P185978, 1, 1
2023/12/03 21:54:48 INFO: Resolving MQTT host testserver to IP address, 1, 1
2023/12/03 21:54:48 INFO: MQTT host has IP address 192.168.1.90, 1, 1
2023/12/03 21:54:49 INFO: Connected to MQTT broker, 1, 1
When MQTT is enabled, the dongle pushes every new entry of the syslog to the <mqtt-prefix>/sys/syslog
topic. By subscribing to this topic, you can view the current syslog of the dongle as new entries are generated.
During periods when the connection to the MQTT broker is down, the dongle keeps track of which syslog entries have not been pushed over MQTT yet. When the MQTT connection is restored, the dongle pushes the missing syslog entries. Each syslog line is timestamped, enabling a user to piece the total syslog back together.