Avatar for cwilt

cwilt

Member since Aug 2015 • Last active Nov 2018
  • 9 conversations
  • 66 comments

Most recent activity

  • started
    • 12 comments
    • 4,694 views
  • started
    • 5 comments
    • 3,484 views
  • in ESP8266
    Avatar for cwilt

    No error, it just stops.

    require("http").get("http://forecast.wea­ther.gov/MapClick.php?lat=39.70&lon=-104­.80&FcstType=json", function(res) {
      var contents = "";
      res.on('data', function(data) { contents += data; });
      res.on('close', function() { console.log(contents); });
    });
    

    After it stops I run process.memory() and it returns...
    { "free": 1349, "usage": 51, "total": 1400, "history": 28 }

    Am I reading that correctly and its not used much memory?

  • in ESP8266
    Avatar for cwilt

    I am trying to download a json string from a weather service. Currently using the http client example and it always stops at the same spot. Seems that the json is larger than a single variable can hold. Looking for suggestions.

  • started
    • 8 comments
    • 7,705 views
  • in ESP8266
    Avatar for cwilt

    No local server in my home. Plan to create a http server that has current time with weather info etc. Will see if it runs out of memory before I get it done.

  • in ESP8266
    Avatar for cwilt

    I got it to work.

    var timeS;
    require("http").get("http://www.timeapi.­org/utc/7+hours+ago?\\s", function(res) {
      res.on('data', function(data) {
        console.log("HTTP> "+data);
        timeS=Number(data);
      });
      res.on('close', function(data) {
        console.log("Connection closed");
        setTime(timeS);
      });
    });
    
  • in ESP8266
    Avatar for cwilt

    I am trying to set the time on my Espruino loaded esp8266. I am using an http get request and getting a string like "2016-01-25T12:33:20+00:00" back from the server. When I try to set the time it never sets it correctly.

    Using...
    setTime(Date.parse("2016-01-25T12:33:20+­00:00"));

    If I do Date.parse("2016-01-25T12:33:20+00:00");­, the ms returned is wrong. If this is not a proper format date string then what is?

  • in JavaScript
    Avatar for cwilt

    Ok. No problem.

  • in JavaScript
    Avatar for cwilt

    Digging up an old post. Was this fixed?

Actions