• I've got an Espruino Wifi updated to 2v04.

    I am having trouble when trying to start an AP, AND connect to mqtt AND creating an http server.

    The error:

    Loading 17577 bytes from flash...
    Running onInit()...
    Uncaught CWMODE failed: Timeout
    

    Here's my onInit():

    function onInit() {
    
      wifi.startAP('AgilatechESP', { password: 'xxxxxxxx', authMode: 'wpa2' }, (err) => {
        if (err) throw err;
        else wifi.connect("HeartJS", {password : "xxxxxxxxxx"}, (err) => {
          if (err) throw err;
        });
      });
    }
    

    And this is apparently the offending chunk of code:

    wifi.on('connected',function() {
      mqtt = require("MQTT").connect({host: "xxx.xxx.xxx.xxx"});
      require("http").createServer(pageReq).listen(8080);
    });
    

    But, to make things even more interesting, this DOES NOT happen immediately following a 'save()' command. Sometimes if power if removed long enough, it will start without errors on the next boot, but even this has no rhyme or reason. Why should the device act differently immediately after a 'save()' and why does this behavior seem so non-deterministic? Thoughts?

About

Avatar for Robin @Robin started