What you're doing looks fine - you just need to call NRF.setServicesonce and then call NRF.updateServices when you need to change data.
Calling NRF.setServices more than once requires a softdevice reboot. It's not normally an issue but if you're calling it often maybe the continuous reboots just stop it from connecting.
All you need to do is pull the battery and re-insert it with the button held down for ~10 seconds and the ruuvitag will boot without loading your code and will be back to normal for connections
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.
What you're doing looks fine - you just need to call
NRF.setServices
once and then callNRF.updateServices
when you need to change data.Calling
NRF.setServices
more than once requires a softdevice reboot. It's not normally an issue but if you're calling it often maybe the continuous reboots just stop it from connecting.All you need to do is pull the battery and re-insert it with the button held down for ~10 seconds and the ruuvitag will boot without loading your code and will be back to normal for connections