• No problem! If you need it, the connections are at http://www.espruino.com/Puck.js#serial-c­onsole

    For the watchdog timer you just need http://www.espruino.com/Reference#l_E_en­ableWatchdog

    So if you do E.enableWatchdog(2); then if Espruino crashes such that it's not executing anything in setInterval, it'll automatically reboot.

    You can go one step further and manually poke it in your code, so you know that if your code doesn't execute that line in X seconds the device reboots:

    E.enableWatchdog(1, false);                                                         
    setInterval(function() {
      if (everything_ok)
        E.kickWatchdog();
    }, 500);
    

    You just need to watch out that if you go to update the firmware the watchdog will still be running and may cause a reboot if it isn't enabled in the new bit of code you update.

    As I said above though, one reason you may not see it advertising is if some other device has automatically connected to it.

    You could always add setWatch(()=>NRF.disconnect(),BTN,{repea­t:true}) so when the button is pressed it disconnects from whatever it is connected to, and that might help?

  • thank you again @Gordon!
    I will try both. I think its the watchdog that may kick in.
    Again, I dont think another device would be able to connect to it. Currently I have the button set to change the status LED between on/off. When it gets stuck it does not work either.

About

Avatar for Gordon @Gordon started