You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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_en­ableWatchdog

    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.

About

Avatar for Gordon @Gordon started