You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • When an interval gets forcibly cleared like that, how can one detect that and react appropriately?

    Good point. There's not an easy way right now until exceptions get implemented - however the best bet at the moment is something like:

    setInterval(function() {
     ...
     wifiSuccess = false;
     setTimeout(function() {
      // initialise WLAN
      wifiSuccess = true;
     }, 10);
     setTimeout(function() {
      if (!wifiSuccess) { ... }
     }, 1000);
    , 60000);
    

    If there's an error in wlan.connect, the error flag will be set and execution will stop - so wifiSuccess will never get set to true.

About

Avatar for Gordon @Gordon started