Closed GeThi255 closed 11 months ago
It's hard to say based on the information you shared, but it appears that Shelly buffers unsent MQTT messages in a queue. It wasn't able to send the messages, so the queue filled up. It attempts to add new messages to the queue, but fails -- that's the queue overflow.
Try the following:
I did some tests but i can't figure out very much.
The WiFi connection ist good and device is connected. The PicoMQTT received some messages form the Shelly device with "overflow" in the Shelly log console. At the same time the connection to my Ahoy-DTU works fine.
I don't know which MQTT standard the Shelly device uses.
May be you are right with your lasst point but I can't change the QoS in the settings. I tried the "alexCajas EmbeddedMqttBroker" for ESP with the same result. Ahoy-DTU works fine and Shelly had the same issue.
Everything works fine on my Raspi with mosquito.
Than you for your help.
If Ahoy-DTU connects correctly, but Shelly can't, then there must be something unusual that Shelly is trying to do or it is not configured correctly. Unfortunately, I don't have a Shelly device to do testing myself.
You can try doing the following:
PICOMQTT_DEBUG_TRACE_FUNCTIONS
preprocessor macro defined. This will make PicoMQTT print all function calls and returns. Based on that you can try to analyze what's happening in the broker. This will slow down the sketch significantly, but is useful for debugging.@GeThi255 any luck?
Hello,
sorry for my late answer. I was in vacation and afterwards I had a lot to do on my job.
I've tried a few things but not really much. So I had no progress.
I checked the first point on your list, without any changes. I did the second point without receiving any messages. Same setup with my raspi works. No success on the esp3.
That's all i did by now. I'll try some additional test in the next days.
Thank you very much
BR Gerd
Hello,
I did some changes yesterday and may be I found a reason.
First I did a firmware update on my Shelly device (Version1.0.3). But this did not help
Afterwards I changed the Shelly standard client ID (shellypro3em-c8f09e87ef1c) to something shorter like x12345.
Now it seems to work. Could it be a issue with the length of the client ID?
BR Gerd
You've hit the nail on the head!
PicoMQTT follows the MQTT 3.1.1 standard, which specifies that client IDs should be between 1 and 23 characters long and can only contain letters and digits. Your client ID "shellypro3em-c8f09e87ef1c" is just a tad too long at 25 characters and includes a dash. (see http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349242).
At the same time the standard states that MQTT broker implementations have the flexibility to relax these restrictions. They may accept longer client IDs or different characters, which they often do.
In my PicoMQTT library, I tried to play by the standard's rules. If the client ID goes over 23 characters, it's rejected and the connection is closed.
Technically, this isn't a bug because it's in line with MQTT's standard. However, as your experience shows, strict adherence to the standard is impractical. I have now increased the maximum allowed client ID length to 64 chars.
Version 0.3.8 will have this change included and should be available for installation soon.
Thanks for your feedback and for diving deep into this!
Hello,
Currently I use a Raspi with Mosquito as a broker to distribute the data from the Ahoy DTU and a Shelly Pro3EM. This also works very well.
Now I want to replace the Raspi with the broker with an ESP32 with PicoMqtt. The Ahoy DTU also connects to the ESP32, but the Shelly Pro3EM doesn't connect very well.
The Shelly Pro3EM publishes a data set about every 3 seconds. With the Raspi there is no problem. With the ESP32, most of them are lost.
In the diagnostics window of the Shelly there is a message with "MQTT0 queue overflow!".
Any ideas?
BR Gerd