-
-
-
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.
-
@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('gs4.pc'))+1); log('gs4.pc'); setTimeout(E.reboot,2000); }
Thank you very much!
-
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. -
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. -
-
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!
-
@allObjects thanks for the suggestion
-
@Robin yes, I use the process.memory() and in some cases it doesn't help. In those cases, I can only empty the HttpCC array manually.
-
@allObjects thank you for your thoughts.
with exception of a few things, all you do in the left side of the IDE / Console, you can do on your application code, because all is js
and it is executed (see REPL) by the Espruino JS interpreter on your
MDBT42Q.I thought the same, but:
function sethttp() { global["\xFF"].HttpCC=[]; }
The result:
>sethttp() Uncaught SyntaxError: Got [ERASED] expected ID at line 1 col 8 global.[ERASED] ^ in function "sethttp" called from line 1 col 9 sethttp() ^
WEB Ide's left side:
>global["\xFF"].HttpCC=[]; =[ ]
I do not expect a memory leak and therefore the HttpCC object (Array?)
doe snot keep growing. Looks to me that individual elements come and
go and grow and shrink over time.Normally this is indeed the case, but sometimes it is not. I have attached a picture of memory usage. In case the memory decreased, the size of the HttpCC array increased.
-
I use the MDBT42Q (2v09) with the the ESP8266. Sometimes the memory starts to run low.
In this case, the size of HttpCC increased:>E.getSizeOf(global,2); =[ { name: "\xFF", size: 1176, more: [ { name: "HttpCC", size: 359 } print(global["\xFF"].HttpCC); [ httpCRq: { "type": 1, "#onconnect": function (b) {var a='';b.on('data',function(b){a.length<8&&(a+=b)}),b.on('close',function(b){e(a.substring(0,5))})}, "res": httpCRs: { "hdrs": false }, "opt": { "protocol": "http:", "method": "POST", "host": "111.1.111.11", "path": "/ords/server/rest/espruino/", "pathname": "/ords/server/rest/espruino/", "search": null, "port": 8081, "query": null, "headers": { "Content-Type": "application/json", "Content-Length": 250 } }, "#onerror": function (a) {d='',e(),digitalPulse(LED1,1,600),log('err1.pc'),ir('Err:1')}, "dSnd": "", "sckt": 2, "cls": true, "dRcv": "HTTP/1.1 200 OK\r\nConnection: close\r\nDate: Thu, 03 Jun 2021 19:53:31 GMT\r\n\r1" }...
if i use the following command in WEB IDE (left side), it will clean the memory:
global["\xFF"].HttpCC=[];
But i can't use it in js.
How can I achieve the same in my javascript code? -
-
@Gordon is it possible to order Wifi when the consumer demand increases? For example, when a larger order is received.
-
Use an Espruino instead of an oscilloscope! I run the Web IDE on my computer and the application what @AkosLukacs made on my tablet. It helped me a lot!
The Espruino INA226 project: https://www.hackster.io/akos-lukacs/blenergygraphs-7e7b9c
-
-
-
Hello @Gordon, this Puck.js Lite is a good idea! It was tiring to solder the beacon :) When can I order these?