ESP32 + W5500 + MQTT instability

ManiekQ
Posts: 1
Joined: Sat Aug 24, 2019 9:58 am

ESP32 + W5500 + MQTT instability

Postby ManiekQ » Sat Aug 24, 2019 10:20 am

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

Who is online

Users browsing this forum: No registered users and 78 guests