Avatar for Geza

Geza

Member since Jul 2020 • Last active Sep 2021
  • 2 conversations
  • 18 comments

Most recent activity

  • in Porting to new Devices
    Avatar for Geza

    Great, thanks!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Geza

    can it be inadequate power-some power glitch/brownout? if you use esp8266 with it an connect it to same power source the total system power draw may change a lot e.g due to wifi traffic and may cause random power issues if it draws too much.

    I thought about it too but i use very good voltage regulators.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Geza

    @Gordon thank you for your suggestions and efforts! I tested a lot too. And I have come to the conclusion that sometimes reading and writing to storage is very slow. This is not a problem anyway, but if there is a delayed reboot after that, the memory will be cleared. But it also happens very rarely and I think it has to do with running out of memory.

    This strange code sometimes produced this error:

    function log(f){  
         if (require("Storage").read(f) == "undefined") {
          require("Storage").write(f,'1');
        }else{
          var n=parseInt(require("Storage").read(f))+1­;
          n=n.toString();
          require("Storage").write(f,n);
        }
    }
    
    for (var g=0; g<10; g++) {
    	clearInterval();
    	clearWatch();
    	console.log(require("Storage").getFree()­+'-'+parseInt(require("Storage").read('g­s4.pc'))+1);
    	log('gs4.pc');
    	setTimeout(E.reboot,2000);
    }
    

    Thank you very much!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Geza

    I use the MDBT42Q with the 2v09 firmware.
    I connected the ESP8266 to it.
    After 2 months of operation, the flash became empty!

    >require("Storage").list()
    =[  ]
    >require("Storage").getFree();
    =40960
    

    The code and the logs are disappeared.
    The device has been self-initialized, working, and can be connected.
    I tried another MDBT42Q yesterday and the same thing happened!
    Is it possible that the storage write could cause a problem?
    I do a simple log, I write very little data (basically i am writing a counter):

    function log(f){
         if (require("Storage").read(f) == "undefined") {
          require("Storage").write(f,'1');
        }else{
          var n=parseInt(require("Storage").read(f))+1­;
          n=n.toString();
          require("Storage").write(f,n);
        }
    }
    

    This log runs very rarely.

    I couldn't manually reproduce this thing maybe someone has a similar experience?
    This is very scary for me.

  • in Other Boards
    Avatar for Geza

    Same here..MDBT42Q, 2v09

    >require("Storage").list()
    =[  ]
    >require("Storage").getFree();
    =40960
    >process.memory();
    ={ free: 2458, usage: 42, total: 2500, history: 17,
      gc: 0, gctime: 3.47900390625, blocksize: 16, stackEndAddress: 536928976, flash_start: 0,
      flash_binary_end: 432868, flash_code_start: 442368, flash_length: 524288 }
    > 
    

    I can connect to the device, but I don’t want to do anything else with it until there’s a suggestion.
    The power supply was continuous and i use a good quality adapter, voltage regulator and battery. I was able to connect to the device, I didn’t have to reboot, but the flash was completely empty. I used the flash to log in, but that couldn't be much data.

  • in JavaScript
    Avatar for Geza

    I guess maybe there was some logging to Storage inside your setScan handler?

    I store the result of setScan in an array, but inside the http handler write the log. I log not only the errors but also the exceptions. I'm trying the fix, which is interesting! I attach the memory usage graph.

  • in JavaScript
    Avatar for Geza

    This one may actually be unrelated - as @MaBe says the code itself should work fine. Are you writing to Storage from inside your application?

    Yes, i use it for logging

    It'd be good to try and track down why this is happening

    @Gordon You think well (as always)..the problem was basically caused by

    NRF.setScan(function(dev) {..}); 
    

    because it was still running when the require("http").get(...) started. It also produced several strange things after a few days... for example memory leak, http socket close error, even the temperature reading became inaccurate.

    Thanks for all the support!

Actions