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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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.