Page 1 of 1
How to clean MQTT? Database still remembers device
Posted: Sunday 12 September 2021 21:35
by Wolly76
Dear all,
I've removed a virtual device (for Tasmota) as I'm using "Autodiscovery of Tasmota" now. However, the virtual device appeared to have a reference to MQTT and now giving errors in the log:
Code: Select all
2021-09-12 20:26:07.229 Error: Tasmota: (Tasmota) tasmota::updateInfo1Devices: Set module and version failed: 'Module'
2021-09-12 20:26:10.003 Error: Mosquitto: MQTT: unknown idx received! (idx 115)
Is there a way to clean the DB to get rid of these error messages?
Many thanks in advance!
Regards,
/W
Re: How to clean MQTT? Database still remembers device
Posted: Sunday 12 September 2021 23:23
by FireWizard
Hello @Wolly76,
I assume you use Mosquitto as broker and probably the error message is caused, because of retained message(s).
Clearing ALL retained messages:
1. First we have to stop the mosquitto broker. sudo systemctl stop mosquitto.service. ...
2. Delete the mosquitto.db containing all the stored message data in the persistence. By default, located in /var/lib/mosquitto/mosquitto.db. ...
3. Restart the mosquitto service. sudo systemctl start mosquitto.service.
This should do the trick.
Regards
Re: How to clean MQTT? Database still remembers device
Posted: Wednesday 15 September 2021 22:02
by Wolly76
Thanks for your response. After cleaning the DB and a reboot the first error message has been vanished but the second one ("Error: Mosquitto: MQTT: unknown idx received! (idx 115)") refering to a deleted dummy device with the index 115 still remains.
Anybody another idea? Looking forward to it. Many thanks!
Re: How to clean MQTT? Database still remembers device
Posted: Wednesday 15 September 2021 23:08
by FireWizard
Hello @Wolly76,
You could install MQTT Explorer (
http://mqtt-explorer.com/) on your desktop/laptop.
Configure this one to look to your Mosquitto broker and see if you can find a message with idx 115. If so delete it.
Check if it comes back.
Regards
Re: How to clean MQTT? Database still remembers device
Posted: Thursday 23 September 2021 22:17
by Wolly76
Thanks for the MQTT-tool. I've used it to find any lines to the corrupted idx (115 in my case).
Subsequently, I performed an action in Domoticz in which the corrupted idx is send to MQTT.
MQTT reports the following:
Code: Select all
in = {"idx":115,"nvalue":1,"svalue":"","Battery":100,"RSSI":5}
So I considered to have a look in the Domoticz database. Exported the database and used "DB Browser (SQLite)" to view. Searching for the idx-value "115" didn't result in any hit. So, now I'm a bit confused. Where is this idx triggered/send?
Any suggestions for a clue?
Many thanks for considering.
Re: How to clean MQTT? Database still remembers device
Posted: Thursday 23 September 2021 23:14
by FireWizard
Hi, @Wolly76,
You wrote:
So I considered to have a look in the Domoticz database. Exported the database and used "DB Browser (SQLite)" to view. Searching for the idx-value "115" didn't result in any hit. So, now I'm a bit confused. Where is this idx triggered/send?
This is not surprising, as you already said:
("Error: Mosquitto: MQTT: unknown idx received! (idx 115)")
So the idx (115) is unknown and you will not find it in the database.
Try to disable the MQTT interface in Domoticz and use MQTT Explorer to check if the message is still send. Could it be a Tasmota device?
Regards
Re: How to clean MQTT? Database still remembers device
Posted: Monday 27 September 2021 21:49
by Wolly76
Thanks for the reply. Apparently I don't understand the MQTT idea. I thought it should be a kind of "man in the middle" but according to the comments it works a bit different.
However, the errors does not appear when the MQTT is disabled. But it does not tell me where to solve the issue. The considered index is from an old dummy switch, and not a Tasmota.
Re: How to clean MQTT? Database still remembers device
Posted: Monday 27 September 2021 22:26
by FireWizard
Hello @Wolly76,
You wrote:
However, the errors does not appear when the MQTT is disabled.
That is correct. If you disable MQTT in Domoticz, no MQTT messages will be received by Domoticz. So, Domoticz will also not receive a message with an unknown idx.
While MQTT is disabled, check with MQTT Explorer if something is received under the topic domoticz/in with something as "idx":115 in its message.
Something must publish that unwanted message, unless it is a retained message in the broker.
In that case clear the retained message.
See:
http://www.steves-internet-guide.com/mq ... s-example/
Regards