-
-
-
Any implementation works poorly, each approach has different problems
this example by https://www.espruino.com/DS18B20owMultiSensors = new OneWire(D4); DSlib = require("DS18B20") ; var sensors = owMultiSensors.search().map(function (device) { return DSlib.connect(owMultiSensors, device); }); setInterval(function() { sensors.forEach(function (sensor, index) { sensor.getTemp(function (temp) { console.log(index + ": " + temp + "°C"); }); }); }, 1000);
After several seconds the error:
ASSERT(jsvGetLocks(var) < 15) FAILED AT src/jsvar.c:721 #1[r3,l2] Object { #2[r1,l2] ASSERT(jsvGetLocks(var) < 15) FAILED AT src/jsvar.c:701 HALTING.
If sensors search put to set Interval this problem disappears , but other appears
owMultiSensors = new OneWire(D4); DSlib = require("DS18B20") ; setInterval(function() { var sensors = owMultiSensors.search().map(function (device) { return DSlib.connect(owMultiSensors, device); }); sensors.forEach(function (sensor, index) { sensor.getTemp(function (temp) { console.log(index + ": " + temp + "°C"); }); }); }, 1000);
This code fills all RAM in time and device stops working
Interval time increase does not have any influence, it only delays the time of crash -
I have error after press the button
pinMode(D35, 'input_pulldown'); setWatch(function(e) { console.log('bttn pressed'); }, D35, { repeat: true, edge: 'rising' });
with D34 also this same error, D15 work
This work fine, but I don want to use setInterval
setInterval(function() { console.log( digitalRead(D34)); }, 100);
Error
Guru Meditation Error: Core 0 panic'ed (LoadStoreAlignment). Exception was unhandled.
Core 0 register dump:
PC : 0x40096a27 PS : 0x00060f30 A0 : 0x800967df A1 : 0x3ffdcf20
A2 : 0x4009b1ff A3 : 0x00000000 A4 : 0x00060423 A5 : 0x00000001
A6 : 0x0006bd0e A7 : 0x00000000 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x00000024 A13 : 0x6bd00000
A14 : 0xf4240000 A15 : 0x00000008 SAR : 0x0000001c EXCCAUSE: 0x00000009
EXCVADDR: 0x4009b1ff LBEG : 0x4009b258 LEND : 0x4009b286 LCOUNT : 0xffffffff
Backtrace: 0x40096a27:0x3ffdcf20
I'em frontend developer, and I know JS pretty well.
everything works, the sensors are detected. The problem is that in one example ASSERT is an error, in the second one runs out of memory.
you don't even need to look at my code, the same problem will be copying the example from the espuino website
this error also occurs if you call the ws.send("....") 15 times (by https://www.espruino.com/ws#websocket-server)
This dirty example helps, but not nice