-
-
Hello everyone,
I am using the current release of Espruino together with the Espruino Board v1.4b and I experienced a weird problem with setTimeout() and deep sleep by using the following peace of code:
function perform() { blink(5000, function() { setTimeout(function() { perform(); }, 3600 * 1000); setDeepSleep(1); }); }; var blink = function(t, callback) { var on = false; var i = setInterval(function() { on = !on; digitalWrite(LED2, on); }, 500); setTimeout(function() { digitalWrite(LED2, false); clearInterval(i); callback(); }, t); }; perform();
This code shall let the device blink for 5sec every hour and go into deep sleep mode after blinking. This works for a while and then it suddenly stops blinking without any error being raised or the light is blinking faster with very low power.
The batteries are fully charged. This behaviour can not be reproduced when the device is connected via USB.
Do you have an idea?
Best,
Tobias
-
-
-
-
Hello,
are there any news regarding the support of a GPRS module? Which module would you suggest?
We are highly interested in using Espruino in combination with a GPRS module for one of our projects. The idea is to build an Espruino based Sensor device which can be used in an outdoor area. The device shall deliver Sensor data to our Servers in the Cloud via GPRS.
Best,
Tobias
I replaced the blink function by logging the current system time to the SD-Card frequently. First I tried to use a 20sec interval, this worked fine (but I just tested a few minutes). When I tried to use it with an hourly interval I just had two entries after 1 day testing. The clock seems to work in a proper way.
After that I did a polyfill for the Espruino related functions and tested my code in Node.js. There I don't have any timing problems, so it must have something to do with deep sleep. Today I am testing the code by using setInterval().