You are reading a single comment by @perbu and its replies. Click here to read the full conversation.
  • @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:

    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.

About

Avatar for perbu @perbu started