You are reading a single comment by @oesterle and its replies. Click here to read the full conversation.
  • I'd try breaking sendForm() and out of the callback. Not sure if that will help, but it might relieve some memory shortage. Untested code:

    // global vars up near the top
    var lastTemp = "";
    var lastHumidity = "";
    var lastLight = "";
    function sendSensorData(){
       sendForm(lastTemp, lastHumidity, lastLight);
    // ........
    // further down, in place of your setInterval() section
    setInterval(function() {
      lastLight = Math.round(; (a) {
        lastTemp = a.temp.toString();
        lastHumidity = a.rh.toString();
        // let's give Espruino an opportunity to do housekeeping
        // before sending our form
        setTimeout(sendSensorData, 5000);
    }, 60000); // once a minute

Avatar for oesterle @oesterle started