• Thanks for sending over the code. The pulldown mode seems reasonable (as long as you don't have a normally-closed switch that's constantly pulling against it!). Also you'd see LED1 (your sleep indicator LED) blinking if you had something waking the WiFi up.

    Please could you ensure that you've uploaded your code to Flash? That might be your issue.

    Either that or add:

    function onInit() {
      A13.read();
    }
    

    There's some info on http://www.espruino.com/Saving

    But basically: When you save to RAM the code executes right away, and when you then run save() Espruino effectively 'hibernates', writing the current state of the interpreter to flash and reloading it at boot.

    The issue here is that because it knows that A13 is a pin that's used internally by WiFi, Espruino WiFi may not save the state of that pin for you, so after the initial upload the A13.read() command may not have an effect.

About

Avatar for Gordon @Gordon started