You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an existing - working - MQTT application using Paho-MQTT and Websockets.
I am working on a new device, which lacks the memory to use Paho-MQTT, but I cannot get umqtt.simple to work with Websockets.
The only example I could find showed setting up the websocket, then setting e.g. cleitn=MQTTClient(<clientid>, <server>, sock=websocket, port=<port>), which fails irrespective of how "sock" is set.
Is there a way to use the websocket protocol with umqtt.simple?
Many thanks,
The text was updated successfully, but these errors were encountered:
The official umqtt.simple from micropython-lib does not support setting the 'sock'.
Only client_id,server, port, user, password, keepalive, ssl is possible.
Also umqtt.simple uses a normal socket. When using Websockets, all MQTT packets are wrapped in a Websocket packet so it is not possible, without significant modifications, to use it in umqtt.simple.
I have made a async MQTT-client using Websockets. I use a patched version of aiohttp. The modifications to aiohttp were necessary because aiohttp does not accept headers (which are needed for almost every broker). Even then, aiohttp can still be blocking because the used getaddrinfo is still a blocking function, therefore I use my own developed, fully async, version of getaddrinfo.
I have an existing - working - MQTT application using Paho-MQTT and Websockets.
I am working on a new device, which lacks the memory to use Paho-MQTT, but I cannot get umqtt.simple to work with Websockets.
The only example I could find showed setting up the websocket, then setting e.g. cleitn=
MQTTClient(<clientid>, <server>, sock=websocket, port=<port>)
, which fails irrespective of how "sock" is set.Is there a way to use the websocket protocol with umqtt.simple?
Many thanks,
The text was updated successfully, but these errors were encountered: