Thanks. I tried it in the following way but with the same result (even without deep sleep):
var WIFI_NAME = ""; var WIFI_OPTIONS = { password : "" }; function onInit() { wifi = require("Wifi"); // Call to an function that kicks off my code setInterval(function() { connectToWifi(); //setDeepSleep(1); }, 10000); } function connectToWifi(){ console.log("connectToWifi"); var wifi = require("Wifi"); wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) { if (err) { console.log("Connection error: "+err); return; } else { console.log("Connected!"); getPage(); } console.log("End"); }); } function getPage() { require("http").get("http://www.pur3.co.uk/hello.txt", function(res) { console.log("Response: ",res); res.on('data', function(d) { console.log("--->"+d); }); }); }
Calculating Size... Writing.. Compressed 36800 bytes to 2742 Running onInit()... connectToWifi connectToWifi connectToWifi connectToWifi connectToWifi connectToWifi connectToWifi connectToWifi connectToWifi connectToWifi save();
@user106328 started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thanks. I tried it in the following way but with the same result (even without deep sleep):
Calculating Size...
Writing..
Compressed 36800 bytes to 2742
Running onInit()...
connectToWifi
connectToWifi
connectToWifi
connectToWifi
connectToWifi
connectToWifi
connectToWifi
connectToWifi
connectToWifi
connectToWifi
save();