-
Notifications
You must be signed in to change notification settings - Fork 29
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
MQTT Adapter "Invalid messageId" (possible reason inside) #31
Comments
Adapter Version? MQTT Client und verwendete Lib? |
Hi, It seems that a weak WIFI connection results in some kind of loop or failing in reconnect? A restart of the mqtt adapter resolves the problem. I am using adapter npm version 2.0.4. v 6.4.1/Core/SDK Version | 2_4_2/2.2.1 In both configuration the error ocurrs sooner or later (speaking of hours). Right now I am using the sonoff.adapter but I would love to use the mqtt.adapter due to its capabilities. Do you have any idea what could cause this problem? Do you need any forther information? |
Please try install Master branch directly Git so you will get Version 2.0.6 (HowTo: https://www.smarthome-tricks.de/software-iobroker/adapter-von-github-installieren ) |
Hi, With the old version this would be different...I guess. Let's hope the solution is that simple :) |
Sadly the problem still exists after a few hours. I have no idea :(
|
Without further debugging, don´t know what happens. But for that, I must be able to reproduce it. Try MQTT_ARDUINOMQTT instead of PubSub in the Client. |
I compiled a new version using the dev-branch of tasmota (v 6.4.1.17) and changed the client to MQTT_ARDUINOMQTT. No problems after reconnect so far. To "reproduce" it in my case I simply have to turn off and on my wifi. When reconnecting, the device fails by 80%. |
Send Log of the initial connect with debug enabled. |
This is the most recent log after I restarted the client and broker. Using the Arduino-MQTT-client didn't solve the problem. After a few hours the client was not able to conenct to the broker anymore.
|
Can you fetch the first reconnect that is starting the endless loop? Please only one Client. For me, it looks like the server is timeouting at the client and then something wired happens. But cannot find the part in the code where this could happen... |
Hm after I deleted all files and reinstalled the broker again from the scetch (latest commit from masater-branch), I tried to reproduce the failure....But "sadly" it works perfeclty fine for the last 24 hours. So maybe this could be a solution. Another workaround for me was using a mosquitto-broker (docker based) and the iobroker-adapter as another client. This worked pretty well. |
Hey there, is there more informations about this problem?!? Having here the same issue since today... :-( mqtt.0 2019-10-17 21:01:10.379 info Client [DVES_939D97] connection closed: Error: Invalid messageId restart the adapter works for seconds, minutes or hours... reinstall at all brings um the issue randomly... ony suggentions?!? |
Hello, Translated it means, that a connection loss and reconnect on client side causes this. The user commented out the line : |
I have the same problem. It only occurred after I integrated devices with Tasmota. Is there a new version without a problem? |
It may be that my Tasmota devices (even from version 6.x) cause this too. I tried to record some debug information, but at some point I switched to the sonoff adapter. it runs super stable and has a sensor parser built in. If this really is related to Tasmoata, then it would not be the first time in my observations, that iobroker or the mqtt adapter does not harmonize with Tasmota. |
I have been using ioBroker for almost 1 year and the MQTT adapter for over half a year without any problems. So far I have only used two Easy ESP (Wemos D1 mini). After using Tasmota I had the problems for the first time, so it would be a big coincidence! |
Hey,
In the german iobroker forum, several people have complained about a bug in the mqtt adapter:
https://forum.iobroker.net/viewtopic.php?f=20&t=16349
The bug basicly renders the adapter useless and only a new start of the adapter fixes this problem.
I tried to find the root of the problem. Here is my debug enabled output:
Here is a more detailed log with more debug output:
I renamed the error from "invalid messageId" to "Bad Paket" for my debug purposes.
The error "Invalid messageId" comes from
function publish (packet, stream, opts)
in the filenode_modules/mqtt-connection/node_modules/mqtt-packet/writeToStream.js
.Maybe there are better way and maybe I didn't even understand the real problem here but it seems to me that the mqtt adapter cannot handle LWT messages with an object payload.
Even though this might not be MQTT adapters fault, it should just disregard bad formated messages and not "crash" on them IMHO.
The text was updated successfully, but these errors were encountered: