Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pb Maj Domoticz 2022.2/2023.1 #36

Open
kaaw69 opened this issue Mar 9, 2023 · 14 comments
Open

Pb Maj Domoticz 2022.2/2023.1 #36

kaaw69 opened this issue Mar 9, 2023 · 14 comments

Comments

@kaaw69
Copy link

kaaw69 commented Mar 9, 2023

Hello, I have been using TASMOTICZ latest version under windows for quite a long time but since the last update of domoticz 2022.2 or 2023.1 I have errors with the plugin.
In doubt I switched to mosquitto 2.0.15 but nothing has changed.
I went from python 3.7.4 to 3.10.7 but still the same problem.
If anyone has any idea, thanks in advance.
Attached is a log:
2023-03-09 18:29:37.210 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:29:37.210 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:29:37.210 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:29:37.211 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:29:37.211 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:29:37.211 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:29:37.211 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:29:37.211 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:29:37.211 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:29:37.211 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:29:37.211 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:29:37.212 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-03-09 18:29:47.298 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:29:47.299 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:29:47.299 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:47.300 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:47.300 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:47.300 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:29:47.301 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:29:47.301 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:29:47.301 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:29:47.301 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:29:47.301 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:29:47.301 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:29:47.302 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:29:47.302 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:29:47.302 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-03-09 18:29:57.256 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:29:57.256 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:29:57.257 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:57.257 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:57.257 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:57.257 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:57.257 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:57.257 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:57.257 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:57.257 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:29:57.257 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:29:57.258 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:29:57.258 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:29:57.258 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:29:57.258 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:29:57.258 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:29:57.258 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:29:57.258 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:29:57.258 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:29:57.258 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-03-09 18:30:00.914 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:30:00.914 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:30:00.914 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:00.914 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:00.915 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:00.915 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:00.915 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:00.916 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:00.916 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:00.916 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:00.917 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:30:00.918 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:30:00.918 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:30:00.919 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:30:00.919 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:30:00.919 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:30:00.919 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:30:00.920 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:30:00.920 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:30:00.920 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-03-09 18:30:07.208 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:30:07.209 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:30:07.209 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:30:07.210 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:30:07.210 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:30:07.211 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:30:07.211 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:30:07.211 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:30:07.211 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:30:07.211 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:30:07.211 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:30:07.211 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-03-09 18:30:10.921 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:30:10.923 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:30:10.925 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:30:10.928 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:30:10.928 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:30:10.928 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:30:10.929 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:30:10.929 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:30:10.929 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:30:10.930 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:30:10.930 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:30:10.930 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-03-09 18:30:17.278 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:30:17.279 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:30:17.280 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:30:17.281 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:30:17.281 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:30:17.281 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:30:17.281 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:30:17.281 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:30:17.281 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:30:17.282 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:30:17.282 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:30:17.282 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-03-09 18:30:27.240 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:30:27.241 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:30:27.241 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:30:27.242 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:30:27.242 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:30:27.242 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:30:27.242 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:30:27.242 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:30:27.242 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:30:27.242 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:30:27.242 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:30:27.243 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-03-09 18:30:37.250 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-03-09 18:30:37.251 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-03-09 18:30:37.252 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:37.253 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:37.253 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:37.253 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-03-09 18:30:37.254 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-03-09 18:30:37.255 Error: Tasmoticz: Traceback (most recent call last):
2023-03-09 18:30:37.255 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-03-09 18:30:37.255 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-03-09 18:30:37.255 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-03-09 18:30:37.255 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-03-09 18:30:37.255 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-03-09 18:30:37.255 Error: Tasmoticz: topic = Data['Topic'] if 'Topic' in Data else ''
2023-03-09 18:30:37.255 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-03-09 18:30:37.256 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883

@joba-1
Copy link
Owner

joba-1 commented Mar 9, 2023

looks like a python library function has changed its api from taking a string to requiring bytes. I‘ll have a look…

@kaaw69
Copy link
Author

kaaw69 commented Apr 4, 2023

Hello, have you had time to take a look at this problem?
There seems to be a similar problem with zigbee2mqtt:

https://www.domoticz.com/forum/viewtopic.php?t=39354

Thanks

@joba-1
Copy link
Owner

joba-1 commented Apr 5, 2023

I can‘t reproduce it, but I think I can fix it. Can you test a change once I create a pull request?

@kaaw69
Copy link
Author

kaaw69 commented Apr 6, 2023

Hello and thank you for your answer.
I am not a developer, I will not be able to modify the code.
I don't think it comes from the Tasmoticz Plugin but rather news from Domoticz in Windows version, there seems to be a lot of plugins that no longer work with versions 2022.2 and 2023.1
Thanks anyway.

@joba-1
Copy link
Owner

joba-1 commented Apr 6, 2023

I think you misunderstood me. I meant, I can do a change, but I cannot test it. So I would need someone who takes the changed file, tests it and reports back.

@joba-1
Copy link
Owner

joba-1 commented Apr 6, 2023

Here is a link to the file mqtt.py of PR #37 that needs to be replaced, in case you're interested:

https://raw.githubusercontent.com/joba-1/Tasmoticz/a219314cebff25bcf7aba97eb8170294687cd5c1/mqtt.py

@kaaw69
Copy link
Author

kaaw69 commented Apr 7, 2023

Indeed I had not understood, I will test and I will let you know.
Thanks

@kaaw69
Copy link
Author

kaaw69 commented Apr 7, 2023

attached the log after the test with the us mqtt.py

2023-04-07 10:08:46.441 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-04-07 10:08:46.442 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-04-07 10:08:46.442 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:46.442 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:46.442 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:46.442 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:46.442 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:46.443 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:46.443 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:46.444 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-04-07 10:08:46.452 Error: Tasmoticz: Traceback (most recent call last):
2023-04-07 10:08:46.452 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-04-07 10:08:46.452 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-04-07 10:08:46.452 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-04-07 10:08:46.452 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-04-07 10:08:46.452 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-04-07 10:08:46.452 Error: Tasmoticz: if 'Topic' in Data:
2023-04-07 10:08:46.452 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-04-07 10:08:46.453 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883

2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.251 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:08:55.252 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883

2023-04-07 10:09:05.715 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-04-07 10:09:05.716 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-04-07 10:09:05.716 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:05.717 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:05.717 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:05.717 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:05.717 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:05.717 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:05.717 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:05.718 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-04-07 10:09:05.737 Error: Tasmoticz: Traceback (most recent call last):
2023-04-07 10:09:05.741 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-04-07 10:09:05.741 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-04-07 10:09:05.741 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-04-07 10:09:05.742 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-04-07 10:09:05.742 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-04-07 10:09:05.746 Error: Tasmoticz: if 'Topic' in Data:
2023-04-07 10:09:05.746 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-04-07 10:09:05.746 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883

2023-04-07 10:09:15.293 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-04-07 10:09:15.294 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-04-07 10:09:15.294 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:15.294 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:15.294 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:15.294 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:15.294 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:15.295 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-04-07 10:09:25.256 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-04-07 10:09:25.260 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-04-07 10:09:25.265 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-04-07 10:09:25.267 Error: Tasmoticz: Traceback (most recent call last):
2023-04-07 10:09:25.268 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-04-07 10:09:25.270 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-04-07 10:09:25.271 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-04-07 10:09:25.271 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-04-07 10:09:25.272 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-04-07 10:09:25.272 Error: Tasmoticz: if 'Topic' in Data:
2023-04-07 10:09:25.273 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-04-07 10:09:25.273 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883

2023-04-07 10:09:35.267 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-04-07 10:09:35.269 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-04-07 10:09:35.269 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.270 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.270 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.271 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.272 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.272 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.272 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.272 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.272 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.272 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.272 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2023-04-07 10:09:35.273 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883
2023-04-07 10:09:45.190 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 24 for packet type '3' (iQoS:0, topicLen:4096)
2023-04-07 10:09:45.191 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2023-04-07 10:09:45.191 Error: Tasmoticz: Call to function 'onMessage' failed, exception details:
2023-04-07 10:09:45.192 Error: Tasmoticz: Traceback (most recent call last):
2023-04-07 10:09:45.192 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 183, in onMessage
2023-04-07 10:09:45.192 Error: Tasmoticz: _plugin.onMessage(Connection, Data)
2023-04-07 10:09:45.192 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\plugin.py", line 127, in onMessage
2023-04-07 10:09:45.192 Error: Tasmoticz: self.mqttClient.onMessage(Connection, Data)
2023-04-07 10:09:45.193 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in onMessage
2023-04-07 10:09:45.194 Error: Tasmoticz: if 'Topic' in Data:
2023-04-07 10:09:45.194 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'
2023-04-07 10:09:45.194 Error: Tasmoticz: MqttClient::onDisconnect: localhost:1883

@joba-1
Copy link
Owner

joba-1 commented Apr 7, 2023

looks like nothing changed???
Are you sure the file is exchanged and domoticz restarted?

@kaaw69
Copy link
Author

kaaw69 commented Apr 7, 2023

Yes I am sure I have modified the Mqtt.py file
the differences are:

***** mqtt.old.py

    topic = Data['Topic'] if 'Topic' in Data else ''
    payload = Data['Payload'].decode('utf8') if 'Payload' in Data else ''

***** MQTT.PY

    if 'Topic' in Data:
        if isinstance(Data['Topic'], bytes):
            topic = Data['Topic'].decode('utf8')
        else:
            topic = Data['Topic']
    else:
        topic = ''

    if 'Payload' in Data:
        if isinstance(Data['Payload'], bytes):
            payload = Data['Payload'].decode('utf8')
        else:
            payload = Data['Payload']
    else:
        payload = ''

and I reboot my PC

@joba-1
Copy link
Owner

joba-1 commented Apr 7, 2023

Strange, I don’t understand how this

Error: Tasmoticz: if 'Topic' in Data:

can cause this:

2023-04-07 10:09:45.194 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'

Need to investigate further, probably next week

@joba-1
Copy link
Owner

joba-1 commented Apr 15, 2023

This is the relevant error:

2023-04-07 10:09:45.193 Error: Tasmoticz: File "C:\Program Files (x86)\Domoticz\plugins\Tasmoticz-master\mqtt.py", line 165, in  onMessage
2023-04-07 10:09:45.194 Error: Tasmoticz: if 'Topic' in Data:
2023-04-07 10:09:45.194 Error: Tasmoticz: TypeError: a bytes-like object is required, not 'str'

And this clearly should not happen, since the mqtt spec says a topic MUST be an utf string (and not a byte like object)

see https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901107

The Topic Name MUST be present as the first field in the PUBLISH packet Variable Header. It MUST be a UTF-8 Encoded String

So I consider this an error in the mqtt lib that you use (mine does not do this).
Could you please address this to the author of the mqtt lib?

@kaaw69
Copy link
Author

kaaw69 commented Apr 20, 2023

Hello and thank you for your research
I do not understand your questions about the library ?
To make domoticz work in MQTT with my TASMOTA and TASMOTICZ devices, I installed the mosquitto 2.0.15 broker, which works perfectly with all versions of domoticz before version 2022.2

Should I change broker knowing that I am on Windows 10 ?

@joba-1
Copy link
Owner

joba-1 commented Apr 20, 2023

no, it is not about the broker (i guess).

Domoticz gives plugins a python environment. This python environment must include a mqtt client library.
I don't know what decides which lib is used or how this can be influenced, but chances are it just uses what you installed on your system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants