Page 1 of 1

mqtt error 16 during publish

Posted: Tue Oct 13, 2020 8:35 am
by ttadam
Hello there,

Well, I stuck therefore I ask some help from the community. I have an esp32, what sends to an mqtt server, and after a few (like 5 or 6) publish I receive an error 16, and after that that is the only thing what happening every time when the board wants to publish.
Did some digging, I found here that 16 means "Malformed received MQTT packet . I don't really know what does that mean, or how to prevent it.

Thanks in advance! :)

Re: mqtt error 16 during publish

Posted: Tue Oct 13, 2020 12:13 pm
by pythoncoder
I suggest you tell us which MicroPython MQTT library you're using. Also what broker software you're running, and on what platform.

Re: mqtt error 16 during publish

Posted: Tue Oct 13, 2020 1:13 pm
by ttadam
I am using mqtt simple.
The server/Broker is emqx v4.

Re: mqtt error 16 during publish

Posted: Wed Oct 14, 2020 8:06 am
by pythoncoder
Any chance of trying mosquitto for your broker to see if this has any effect? It's available in most Linux distros.

As far as I know all testing has been done using this. I've never seen this error.

Re: mqtt error 16 during publish

Posted: Thu Oct 22, 2020 9:57 am
by ttadam
I think I got closer to the issue. It is not mqtt error 16, it is an OSError 16... and coming from the mqtt library from this line:
self.sock = ussl.wrap_socket(self.sock, **self.ssl_params)