knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.81k stars 1.47k forks source link

Autodiscover MQTT version #370

Open stritti opened 6 years ago

stritti commented 6 years ago

Would be great, if the client could auto discover the MQTT version:

probably try by default initial call using MQTT 3.1.1 and if state timeout, then switch to MQTT 3.1 for current session.

See also #159

knolleary commented 6 years ago

It was an intentional choice to keep the client as small as possible by making the choice of protocol a compile time thing - not a runtime thing.

stritti commented 6 years ago

Hm, okay. But on the other hand if you search the web, there are a lot problems to use correct protocol version. It would be really cool to have auto negotiation to be more flexible using ESP with different servers.