-
• #2
I think your problem is that you are still connected to WiFi - while the microcontroller itself can draw very little power, WiFi still takes a lot.
Also,
setDeepSleep(1);
can't be used when there's a WiFi connection as it stops the UART from working correctly.How about:
function finished() { wifi.disconnect(); setDeepSleep(1); } function newCycle() { setDeepSleep(0); wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) { if (err) { finished(); return; } HTTP.get("http://192.168.1.121:1880/esprĀuino?Temp=24", function(res) { res.on('data', function(data) { console.log(data); }); res.on('close', function(data) { console.log("HTTP got close."); finished(); }); res.on('error', function(data) { // timeout not trapped console.log("HTTP error."); finished(); }); }); }); } setInterval(newCycle, 20000);
Hi friends.
I'm trying to get confidence with Espruino-wifi.
Here is a very simple program that just HPPT.get to a we server, on every 20 secs.
I've measured the current adsorbed and it is never below 20mA.
Of course it peaks to about 90mA when transmitting, but this is not the problem.
When measuring the board is not connected to USB.
Power (5V) is supplied on pins GND and VBA.
I was expecting less that 1 mA when deepSleeping, but, as far as I understand, I'm not able to convince the board to sleep deep enought :-).
So thanks for your help.
Marco
Here is my code.