I posted this elsewhere, however it may actually be an extension to my initial problem here. After setting retain to true, and then no longer wanting it and setting back to false, it seems that it still retains the settings and reinstates them. This is causing issues with sonoff devices rebooting continuously (after being sent a reboot command once, it seems to “stick” and repeat over and over)
If I sub to the topic:
pi@raspberrypi:~ $ mosquitto_sub -v -t openhab/sonoff/#
openhab/sonoff/pool/LWT Offline
openhab/sonoff/pool/cmnd/restart 1
openhab/sonoff/maintowelrail/LWT Offline
openhab/sonoff/maintowelrail/cmnd/POWER OFF
openhab/sonoff/maintowelrail/cmnd/restart 1
And then in another cmd window, publish restart as “0”, which of course adds the following to the bottom of the list:
openhab/sonoff/maintowelrail/cmnd/restart 0
And then I cancel and re-run the subscription, I get:
pi@raspberrypi:~ $ mosquitto_sub -v -t openhab/sonoff/#
openhab/sonoff/pool/LWT Offline
openhab/sonoff/pool/cmnd/restart 1
openhab/sonoff/maintowelrail/LWT Offline
openhab/sonoff/maintowelrail/cmnd/POWER OFF
openhab/sonoff/maintowelrail/cmnd/restart 1
Restart is back to 1 again. It doesn’t “save” the restart 0 at all. This constantly runs over and over, so every 3-4 seconds the sonoff device reboots. My default persistence is mysql.
(in fact, if I subscribe to openhab/#, I get about a dozen items displayed - from somewhere, I have no idea where. Not from mysql, as I dropped the database and recreated. I’ve renamed all other persistence files to .OLD and rebooted, and these dozen or so items still appear. HELP?!)
And one thing I don’t understand, is if I’m using mysql.persist as default, does that mean mqtt.persist is no longer used? Or does mqtt.persist save/restore MQTT related items, and mysql does everything else?
Also, here is the web console output from the sonoff, as you can see its been quite a number of reboots before I’ve noticed this!!! This page clears and it reboots over and over about 3-4 seconds in between each.
00:00:00 Cnfg: Load from flash at F6 and count 14238
00:00:00 APP: Bootcount 13516
00:00:00 APP: Project sonoff SonoffMainTowelRail (Topic maintowelrail, Fallback DVES_B4AE80, GroupTopic sonoffs) Version 5.5.1
00:00:00 Cnfg: Save (1648 bytes) to flash at F5 and count 14239
00:00:00 Wifi: Attempting connection...
00:00:00 Wifi: Patch issue 2186
00:00:00 Wifi: Connecting to AP1 iotbam in mode 11N as maintowelrail...
00:00:01 Wifi: Attempting connection...
00:00:02 Wifi: Attempting connection...
00:00:03 Wifi: Attempting connection...
00:00:04 Wifi: Attempting connection...
00:00:05 Wifi: Attempting connection...
00:00:06 Wifi: Connected
00:00:06 mDNS: Initialized
00:00:06 HTTP: Webserver active on maintowelrail.local with IP address 172.16.223.100
00:00:07 RTC: (UTC) Tue Feb 27 01:59:15 2018
00:00:07 RTC: (DST) Sun Mar 25 02:00:00 2018
00:00:07 RTC: (STD) Sun Oct 28 03:00:00 2018
02:59:16 MQTT: Attempting connection...
02:59:17 mDNS: Query done with 0 mqtt services found
02:59:17 MQTT: Connected
02:59:17 MQTT: openhab/sonoff/maintowelrail/LWT = Online (retained)
02:59:17 MQTT: openhab/sonoff/maintowelrail/cmnd/POWER =
02:59:17 RSLT: DataCb Group 0, Index 1, Type POWER, Data OFF (OFF)
02:59:17 MQTT: openhab/sonoff/maintowelrail/RESULT = {"POWER":"OFF"}
02:59:17 MQTT: openhab/sonoff/maintowelrail/POWER = OFF
02:59:17 MQTT: openhab/sonoff/maintowelrail/INFO1 = {"Module":"Sonoff Basic", "Version":"5.5.1", "FallbackTopic":"DVES_B4AE80", "GroupTopic":"sonoffs"}
02:59:17 MQTT: openhab/sonoff/maintowelrail/INFO2 = {"WebserverMode":"Admin", "Hostname":"maintowelrail", "IPaddress":"172.16.223.100"}
02:59:17 MQTT: openhab/sonoff/maintowelrail/INFO3 = {"Started":"Software/System restart"}
02:59:17 RSLT: DataCb Group 0, Index 1, Type RESTART, Data 1 (1)
02:59:17 MQTT: openhab/sonoff/maintowelrail/RESULT = {"Restart":"Restarting"}