Avatar for user92517

user92517

Member since Jul 2018 • Last active Aug 2018
  • 1 conversations
  • 3 comments

Most recent activity

  • Avatar for user92517

    Yes, Grodon, I recheck it and run only this code(see below) and have same result.
    I posted this in the ESP8266 forum: http://forum.espruino.com/conversations/­323848/
    Thank you.

    var wifi = require("Wifi"); wifi.stopAP(); function onInit() {   wifi.connect("ssid", {password: "password"});   setInterval(function(){
        console.log(wifi.ping("192.168.2.1", function(b){
          //console.log(b);
        }));
        console.log(process.memory().free);   }, 5000); }
    
  • in ESP8266
    Avatar for user92517

    Hello.
    I use wifi.ping wifi.ping with setInterval under v1.96 and NodeMCU, it have memory leak in case if I use callback function and function wifi.ping always return undefined. See code and result below.
    How it's may be solve? I need to have result of ping: successful or fail, without check of callback argument, in this case memory leak will not present.

    var wifi = require("Wifi");
    wifi.stopAP();
    function onInit() {
      wifi.connect("ssid", {password: "password"});
      setInterval(function(){
        console.log(wifi.ping("192.168.2.1", function(b){
          //console.log(b);
        }));
        console.log(process.memory().free);
      }, 5000);
    }
    

    result:

    undefined
    1371
    undefined
    1303
    undefined
    1218
    undefined
    1134
    undefined
    1061
    undefined
    976
    undefined
    891
    undefined
    806
    undefined
    721
    undefined
    636
    undefined
    551
    undefined
    466
    undefined
    381
    undefined
    296
    undefined
    211
    undefined
    126
    undefined
    41
    Execution Interrupted
    New interpreter error:
    Execution Interrupted
    
  • in Pico / Wifi / Original Espruino
    Avatar for user92517

    Dear Grodon, I use wifi.ping with setInterval under v1.96 and NodeMCU, it have memory leak in case if I use callback function and function wifi.ping always return undefined. It's NodeMCU issues?

    setInterval(function(){
        console.log(wifi.ping("192.168.2.1", function(b){
          //console.log(b);
        }));
        console.log(process.memory().free);
      }, 5000);
    

    result:

    undefined
    1371
    undefined
    1303
    undefined
    1218
    undefined
    1134
    undefined
    1061
    undefined
    976
    undefined
    891
    undefined
    806
    undefined
    721
    undefined
    636
    undefined
    551
    undefined
    466
    undefined
    381
    undefined
    296
    undefined
    211
    undefined
    126
    undefined
    41
    Execution Interrupted
    New interpreter error:
    Execution Interrupted
    
Actions