Page 1 of 1

ESP32 + W5500 + MQTT instability

Posted: Sat Aug 24, 2019 10:20 am
by ManiekQ
Does anyone have any experience running ESP32 with W5500 (ethernet) for long running TCP connection (MQTT is an example)?
I am interested if it is working stable or you are experiencing instability issues.

I've got a problem with stability of TCP connection and I try to understand if this is my setup or something broken in firmware (or hardware).

---
Detailed description of the issue if someone is interested:
While using ESP32 with W5500 (ethernet), PubSubClient gets disconnected from MQTT broker from time to time (time periods differs significantly - from few minutes to couple of hours).

Looks like PubSubClient is sending malformed TCP/MQTT packet which looks like Disconnect Req, but with very high Msg Len. It causes messages afterwards to be treated as continuation of this message. That includes Ping Request message. After "keep alive" timeout (in my case 15sec x2) PubSubClient decides to disconnect as it has not received Ping Response message.

I am using DOIT Esp32 DevKit v1 and some regular size W5500 module.

Wiring between ESP32 and W5500:
GPIO23 <--> MOSI
GPIO19 <--> MISO
GPIO18 <--> SCLK
GPIO5 <--> SCS
GPIO13 <--> RESET

Code I am using for MQTT testing:
https://github.com/maniekq/ESP32_W5500_MQTT

It doesn't look like it is MQTT related as I was able to reproduce similar issue with simple long-running TCP connection.
Code here: https://github.com/maniekq/ESP32_W5500_TCP