peterhinch / micropython-mqtt

A 'resilient' asynchronous MQTT driver. Recovers from WiFi and broker outages.
MIT License
549 stars 116 forks source link

Ethernet Support #130

Closed lawrencedudley closed 5 months ago

lawrencedudley commented 5 months ago

Hey,

Firstly, a big thank you, your MQTT library is really solid and we massively appreciate your work on it. It's great and something you should be proud of which brings significant benefits to the Micropython community as a whole.

We'd love the library to have native support for Ethernet. I've tried ripping various WiFi-related bits out and I don't love how far the codebase has ended up diverging and with it being async code it's also (understandably) quite complex.

Would you be open to us sponsoring you to add Ethernet support to the library? More than happy to send some hardware over to you as well, we're in the UK which I think you are too!

peterhinch commented 5 months ago

Hi Lawrence, this has come up before, which brings up the general subject of future development. The library was originally conceived as a way to bring reliable MQTT to what was at the time the only significant networked MP platform: the ESP8266. As other WiFi platforms emerged, porting it was straightforward. Handling the vagaries of WiFi (in the absence of an OS) was the essence of the design.

I am wary of anything that significantly adds to the code as ESP8266 remains one of the targets. Further, an Ethernet version could be greatly simplified. One option would be a fork with such a version but I think the real solution is a complete re-write on the basis of ideas set out in this short doc - such a rewrite would support Ethernet with ease.

Unfortunately for reasons of age and infirmity I'm not in a position to undertake this fairly substantial task, but I'd happily support anyone who took it on.

As an aside there is work in progress to support MQTT V5. The developers aim to do this via a superclass, with minimal changes to the base class, so that MQTT V3.1.1 on ESP8266 remains available via the base class.

lawrencedudley commented 5 months ago

Hey Peter,

I completely understand! Thanks so much for taking the time to respond.