Thanks for the suggestion. So, for what it is worth, here are some more details about my setup:
The code is pretty simple, it is the example from the module documentation:
var wifi = require("Wifi");
var Sntp = require('sntp');
// All options are optional
var options = {
host: 'no.pool.ntp.org',
port: 123, // Defaults to 123 (NTP)
timeout: 3000 // Defaults to zero (no timeout)
};
// Request server time
Sntp.time(options, function (err, time) {
if (err) {
console.log('Failed: ' + err.message);
return;
}
console.log('Local clock is off by: ' + time.t + ' milliseconds');
});
Ideally what I'd would like to have is some sort of debugger, but I've not seen those working on the esp8266 - but there might be a way to enable the debugger which I've yet to find. I'm currently considering importing the SNTP module into the IDE and printf-debug it. We'll see how that goes.
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.
@Robin
Thanks for the suggestion. So, for what it is worth, here are some more details about my setup:
The code is pretty simple, it is the example from the module documentation:
.env looks like this:
Ideally what I'd would like to have is some sort of debugger, but I've not seen those working on the esp8266 - but there might be a way to enable the debugger which I've yet to find. I'm currently considering importing the SNTP module into the IDE and printf-debug it. We'll see how that goes.
Cheers,
Per.