-
-
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'); });
.env looks like this:
={ VERSION: "2v04", GIT_COMMIT: "3956264e", BOARD: "ESP8266_4MB", FLASH: 0, RAM: 81920, SERIAL: "68c63a9f-c13f", CONSOLE: "Serial1", MODULES: "Flash,Storage,hea" ... "r,crypto,neopixel", EXPTR: 1073643636 }
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.
-
Hi.
I'm making a watch so I needed an accurate time source. I've found the SNTP module which seems to do just that. However, it always times out and I'm not sure how to proceed to figure out why it doesn't work.
The SNTP module is based on @hapi/sntp so I tried running that module on my laptop against the same NTP service and it works fine. Both the laptop and the MCU are on the same network.
Any tips on how to proceed to debug this?
TIA,
Per.
That is a nice tip, @MaBe. Thanks!