8000 MQTT connection fails occasionally when using Ethernet connection · Issue #9 · aetas/RoomHub · GitHub
[go: up one dir, main page]

Skip to content
MQTT connection fails occasionally when using Ethernet connection #9
@jozala

Description

@jozala

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 couldn't find the problem in RoomHub code. It looks like the problem in W5500 hardware or Arduino Ethernet library.

This is important to fix this as it makes using RoomHub with Ethernet connection unstable.
It doesn't influence version with WiFi connection which seems to be stable.

There are tickets created for this issue in PubSubClient and Ethernet library projects:
arduino-libraries/Ethernet#106
knolleary/pubsubclient#639

Ideas to check:

  • try to use other versions of Ethernet library (Adafruit/Wiznet)
  • replace W5500 with other hardware (are pins available?)
  • adding some capacitor in connection
  • use asynchronous MQTT library instead of PubSubClient (https://github.com/marvinroger/async-mqtt-client)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0