I have a fork of the EspruinoHub that fixes the problems I have been experiencing. I think this is still related to this thread since mqtt is integral to node-red and being able to initiate and respond to events.
I had trouble connecting to the puck reliably, initially, and I was able to figure out over time that this was related to something in noble. But short of it is that I changed the logic in EspruinoHub and it's a lot more reliable now. At least for me.
I also added logic so the mqtt message text sent to the puck was no longer limited to just 20 bytes.
I also fixed a problem where the device discovery would stop after an mqtt event resulting in a watchdog timeout and restart but only by the shell script. Now the discovery restart happens more inline.
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.
I have a fork of the EspruinoHub that fixes the problems I have been experiencing. I think this is still related to this thread since mqtt is integral to node-red and being able to initiate and respond to events.
https://github.com/dklinkman/EspruinoHub
I had trouble connecting to the puck reliably, initially, and I was able to figure out over time that this was related to something in noble. But short of it is that I changed the logic in EspruinoHub and it's a lot more reliable now. At least for me.
I also added logic so the mqtt message text sent to the puck was no longer limited to just 20 bytes.
So something like this works now on the RPi:
even while the text is > 20 chars. Note also the RPi /bin/bash $'...' syntax. Required.
Reading a service now works. There was a bug causing a crash. For example the following now reads the puck name:
and outputs the result when appropriately subscribed to mosquitto_sub -v -t /ble/data/#
I also fixed a problem where the device discovery would stop after an mqtt event resulting in a watchdog timeout and restart but only by the shell script. Now the discovery restart happens more inline.