Avatar for .Neil

.Neil

Member since Nov 2016 • Last active Oct 2020
  • 5 conversations
  • 13 comments

.

Most recent activity

    • 5 comments
    • 2,557 views
  • in Pico / Wifi / Original Espruino
    Avatar for .Neil

    Hello all-
    Saw a video where I think it said the maximum supply voltage for the pico is +5v. But scanning the forums I saw folks talking about the pico being able to handle +16v. Then looking at the data sheet (STM32401xD, right...?) it says "... VDD operating voltage range 1.8 V to 3.6 V." Can someone provide a range on what voltage supply the pico can tolerate (and at which pins)?

    Background: I have an industrial control panel housing +12 VDC DIN-rail power supplies and would prefer not to install another just for the Espruino.

    Thank you!
    -Neil

    • 4 comments
    • 3,587 views
    • 9 comments
    • 2,878 views
  • in General
    Avatar for .Neil

    Thanks Gordon. Seeing a partial fix with 1v90; but now there's a clear memory leak.

    I updated with 1v90.
    I also soldered a 10uF ceramic capacitor between Vcc and GND on the ESP8266 Wifi Module.

    Adding process.memory() to the code the leak is clearly visible. It makes about 15 require("http").get() calls before it's out of memory. I then see ERROR: Out of memory! followed by ERROR: Error processing Serial data handler - removing it.

    Here's the code I used:

    
    var tries=0;
    function onInit() {
      digitalWrite(B9,1); // enable on Pico Shim V2
      Serial2.setup(115200, { rx: A3, tx : A2 });
      var wifi = require("ESP8266WiFi_0v25").connect(Seri­al2, function(err) {
        if (err) throw err;
        wifi.reset(function(err) {
          if (err) throw err;
          console.log("Connecting to WiFi");
          wifi.connect("SSID","password", function(err) {
            if (err) throw err;
            console.log("Connected");
            setInterval(function () {
              require("http").get("http://www.espruino­.com", function(res) {
              });
              console.log("Attempt #" + ++tries);
              console.log(process.memory());
            }, 15000);
          });
        });
      });
      
    }
    onInit();
    

    It's leaking 100-200 with each call. Oddly, it's not constant.

    Any idea where the leak is?

  • in General
    Avatar for .Neil

    Ok, ran some tests over the last few days:

    1) I'm using firmware 1v89.
    2) With the 15-second interval the interpreter is unresponsive when connected via USB and there are no error messages.
    3) I retried with a one-hour interval and the results are the same.
    4) Even the number of attempts are the same before it locks up: google.com still makes 8 attempts and locks up, espruino.com makes only 4. Same JS code as above, only changed the interval.
    5) I added another interval to blink an LED every couple seconds to see if the results change when connecting to a simple power-only USB vs. a PC's USB: eventually the LED stops blinking, indicating the lock ups are still occurring.

    I can certainly solder a cap between Vcc and GND, but I'm seeing a clear correspondence between the website and the number of require("http").get() calls before failure. This leads me to believe it's a problem in the software reading data rather than hardware. But what's different about the website data eludes me (nasa.gov's homepage has much more data than google.com but espruino makes more successful .get() calls before locking up...)

    Does websockets use different underlying routines? I remember you saying to try websockets when I made 4 calls a second; can you tell me why?

    Thanks,

    Neil

  • in General
    Avatar for .Neil

    Hi Gordon, thanks for getting back to me so quickly.

    I only reduced the interval to 250ms to quickly illustrate the problem BUT I think what I've done is created a new one (and obscured the still-present issue.)

    Increase the interval to 15000 (15 seconds) and you'll see the real issue: the Espruino locks up after a few attempts and no longer makes the require("http") call.

    My project only demands a one-hour interval but that's a long time to wait to see it lock up. The same lock-ups appear with a 15-second interval, occuring on two Espruino/ESP8266 boards I soldered up. (They still respond to pings for some reason...)

    And different websites fail after a different number of attempts, but are consistent for each site (google.com always fails with 8 tries, espruino.com always with 4):
    google.com: 8 attempts
    espruino.com 4 attempts
    travelocity.com 20 attempts
    youtube.com 22 attempts
    nasa.gov 23 attempts

    I hope this helps.

    Thanks,
    -Neil

  • in General
    Avatar for .Neil

    My code needs to load a web page multiple times. But after a few successful http calls it fails with "Uncaught Error: No free sockets".

    I've removed my project-specific code to provide the simplest example of this error:

    var tries=0;
    
    function onInit() {
      digitalWrite(B9,1); // enable on Pico Shim V2
      Serial2.setup(115200, { rx: A3, tx : A2 });
      var wifi = require("ESP8266WiFi_0v25").connect(Seri­al2, function(err) {
        if (err) throw err;
        wifi.reset(function(err) {
          if (err) throw err;
          console.log("Connecting to WiFi");
          wifi.connect("SSID","password", function(err) {
            if (err) throw err;
            console.log("Connected");
    
            setInterval(function () {
              require("http").get("http://www.google.c­om", function(res) {
              });
              console.log("Attempt #" + ++tries);
            }, 250);
    
    
          });
        });
      });
      
    }
    
    onInit();
    

    Google.com is simply an example; it fails with any website.

    When running the code you'll see the number of attempts increment until it fails around #7 or #8. Apparently the require("http") call generates it. Oddly, changing the interval from 250 to something larger generates different errors but the end result is the same: the Espruino freezes.

    I really need this to work as there is no workaround. Can anyone provide some guidance?

    Thanks,

    -Neil

  • in General
    Avatar for .Neil

    Thanks all.

Actions