Espruino WiFi as the MQTT Broker #5850
Replies: 1 comment
-
Posted at 2018-01-09 by @gfwilliams Yes, it could act as an MQTT broker, but you'd basically be implementing everything yourself as I don't believe anyone has done it on Espruino before. The existing client library is a good start: https://github.com/espruino/EspruinoDocs/blob/master/modules/MQTT.js - you just have to handle pub/sub and maintain lists of subscribed topics for each connected client. It's not that bad (to implement enough of it work fine - you could spend ages trying to implement the whole spec) and could be quite a fun project. If you do try and do it, it'd be great if you could share what you have - it might be quite useful for other Espruino users. One thing to note is that Espruino WiFi has a maximum of 5 sockets open at a time - so that's only 5 clients. It might restrict you a bit. Posted at 2018-01-09 by ct5845 Ah ok, might be a sockets for the immediate future and a look into the MQTT a little later. Thanks very usefull to know : ) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-01-08 by ct5845
Can the espruino (WiFi) in this case, act as the MQTT broker?
I've got Device A hooked up to a GPS sensor and i'd like to send regular updates to listening devices B...D.
I can and have been using Websockets, with Device A running a server, but wanted to try use MQTT instead as it sounds like it's better suited for this sort of simple comms, with Device A being the broker?
All the examples i can find seem to have the Espruino connecting to a broker elsewhere, and then pub/subbing, unless i'm misreading it?
Beta Was this translation helpful? Give feedback.
All reactions