Avatar for user106712

user106712

Member since Dec 2019 • Last active Jan 2020
  • 1 conversations
  • 6 comments

Most recent activity

  • in ESP8266
    Avatar for user106712

    Thanks.

  • in ESP8266
    Avatar for user106712

    This is JSON as parsed by node.js on a desktop:

    { week_number: 50,
      utc_offset: '-05:00',
      utc_datetime: '2019-12-15T18:10:33.811491+00:00',
      unixtime: 1576433433,
      timezone: 'America/Toronto',
      raw_offset: -18000,
      dst_until: null,
      dst_offset: 0,
      dst_from: null,
      dst: false,
      day_of_year: 349,
      day_of_week: 0,
      datetime: '2019-12-15T13:10:33.811491-05:00',
      client_ip: '174.114.161.151',
      abbreviation: 'EST' }
    

    The actual text string comes from https://worldtimeapi.org/api/timezone/Am­erica/New_York

  • in ESP8266
    Avatar for user106712

    I use the following code on a desktop computer as well as on an ESP8266 (2v04).

    function getTime() {
    
            require("http").get("http://worldtimeapi­.org/api/timezone/America/Toronto", function (res) {
                    res.on('data', function (data) {
                            console.log(data);
                            console.log(JSON.parse(data).datetime);
    
                    });
                    res.on('close', function (data) {
                            console.log("Connection closed");
                    });
            });
    }
    
    getTime();
    

    node.js on the desktop could parse the output just fine :

    <Buffer 7b 22 77 65 65 6b 5f 6e 75 6d 62 65 72 22 3a 35 30 2c 22 75 74 63 5f 6f 66 66 73 65 74 22 3a 22 2d 30 35 3a 30 30 22 2c 22 75 74 63 5f 64 61 74 65 74 ... >
    2019-12-15T12:50:08.336992-05:00
    

    ESP8266 shows the following:

  • in ESP8266
    Avatar for user106712

    I am now able to connect by Wifi! That gets me going without resorting to serial. Thanks.

  • in ESP8266
    Avatar for user106712

    No ... I'm on the network if that's what you mean.

  • in ESP8266
    Avatar for user106712

    Thanks - I am now running the Chrome app. When I try to connect, both "TCP/IP" and serial ports show up.

    When I tried to connect to /dev/wcusbserial, I could see the Espruino respond but the "Select a port ..." panel does not go away.

    (In the Console, it still shows No navigator.serial even though the IDE could see the serial ports now.)

    I also tried unsuccessfully to connect over Wifi. The 'port' is available but the IDE cannot connect to it.

Actions