Are you using firmware 2v07 on the Pucks? Have you tried it with a fresh battery?
And you're saying the Puck stops printing things, and doesn't even respond on the REPL? What happens if you disconnect and reconnect? And how long does it take on average?
Realistically to help I need to see some code - and then if I can reproduce here I can have a go at fixing it. But unfortunately I don't have much to go on right now.
Once enabled, if E.kickWatchdog(); isn't called within a period you define the Puck will totally reboot. On your interface you'd just need to detect the lack of data and reconnect. It should be a last resort, but a watchdog does make your code pretty much bulletproof.
It's also worth noting that sometimes Web Bluetooth may not actually tell you a device has disconnected unless you try and send something from Web Bluetooth and it fails.
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.
Are you using firmware 2v07 on the Pucks? Have you tried it with a fresh battery?
And you're saying the Puck stops printing things, and doesn't even respond on the REPL? What happens if you disconnect and reconnect? And how long does it take on average?
Realistically to help I need to see some code - and then if I can reproduce here I can have a go at fixing it. But unfortunately I don't have much to go on right now.
A possible fallback is to use a hardware watchdog - use it in manual mode to be 100% sure and 'kick' it after printing data to Bluetooth: http://www.espruino.com/Reference#l_E_enableWatchdog
Once enabled, if
E.kickWatchdog();
isn't called within a period you define the Puck will totally reboot. On your interface you'd just need to detect the lack of data and reconnect. It should be a last resort, but a watchdog does make your code pretty much bulletproof.It's also worth noting that sometimes Web Bluetooth may not actually tell you a device has disconnected unless you try and send something from Web Bluetooth and it fails.