-
Here is the test data (short version):
[{"name":"6","nickname":"6","type":"dw","pin":"NodeMCU.D0","state":"auto","id":"8f00ea92fd13290a00b439c50fcf44b55adf4b5e"},{"name":"66","nickname":"66","type":"dw","pin":"NodeMCU.D1","state":"auto","id":"954d9746e2c362d436626ca9baadaf0b23f1344d"},{"name":"666","nickname":"666","type":"dw","pin":"NodeMCU.D2","state":"auto","id":"69a58c85aef959e6cfe3bf1f60304b9fd3e6a82b"},{"name":"66666","nickname":"66666","type":"dw","pin":"NodeMCU.D3","state":"auto","id":"ba057ce5419bf32c7cd8187bf59038f23e422fab"},{"name":"666666","nickname":"666666","type":"dw","pin":"NodeMCU.D5","state":"auto","id":"a207a27e844ad42e6bed12a33859e28b4fc1224c"},{"name":"66666666","nickname":"66666666","type":"dw","pin":"NodeMCU.D6","state":"auto","id":"7e1fc12b607bbef30c7120ab93a89e55d13b29e7"},{"name":"6666666666","nickname":"6666666666","type":"dw","pin":"NodeMCU.D8","state":"auto","id":"880eb9d52c07f310654c835410ff0c9bd746edbc"},{"name":"666666666666","nickname":"666666666666","type":"dw","pin":"NodeMCU.D9","state":"auto","id":"bd988671faeefd7f6504cb6967ab674933d30405"}]
-
-
-
I had a problem with WebSocket when I try to send a long string(1688 Bytes in my case). I got error
"Execution Interrupted during event processing.
New interpreter error: LOW_MEMORY,MEMORY".Then I modified the ws module, made the send function can accept a json object, to prevent string copy. But in another for loop, it still make a copy of source, I made comment down below.
g.prototype.send = function(a, b) { let c, f, d, e; try { if ( ((c = a.value.length), 125 < a.value.length && (c = 126), this.socket.write( h(void 0 === b ? 129 : b, c + (this.masking ? 128 : 0)) ), 126 == c && (this.socket.write(h(a.value.length >> 8)), this.socket.write(h(a.value.length))), this.masking) ) { for (c = [], f = "", d = 0; 4 > d; d++) { (e = Math.floor(255 * Math.random())), (c[d] = e), (f += h(e)); } for (d = 0; d < a.value.length; d++) { //here will make a copy of source f += h(a.value.charCodeAt(d) ^ c[3 & d]); } print(process.memory()); this.socket.write(f); } else this.socket.write(a);//2 } catch (e) { (c = d = f = e = null), this.initializeConnection(); } }
I tried 5 methods(like using flash as buffer or turn source string in to array at first and exchange char in it in for loop) to fix it ,but none of them work.
I wish to use the second method to send data, but server will emit error "MASK must be set".
Anyone know how to deal with this? Thank you.
-
-
-
-
-
Yes. I searched on the forum and use these codes:
let rawCodes =[4400,4350,550,1600,600,500,550,1650,550,1600,550,550,550,550,550,1600,550,550,550,550,550,1600,550,550,550,550,550,1600,550,1600,600,500,550,1650,550,550,550,1600,550,1600,600,1600,550,1600,550,550,550,1600,600,1600,550,1600,600,500,550,550,550,550,550,500,600,1600,550,550,550,500,600,1600,550,1600,600,1600,550,550,550,500,600,500,550,550,550,550,550,500,600,500,550,550,550,1600,600,1600,550,1600,550,1650,550,1600,550].map(function(x) {return x/1000;}); analogWrite(NodeMCU.D5, 0.9, {freq:38000}); digitalPulse(NodeMCU.D5, 1, rawCodes); digitalPulse(NodeMCU.D5, 1, 0);
And it will reboot itself during process.
-
-
-
I tried to use IR LED on ESP8266 but it didn't support 38k frequency, so I have to use Arduino to drive an IR LED. It will receive data from ESP8266 through soft serial, but for some reason, I want to transmit hex data to Arduino to flash it. Is anybody know how to do this?
I know the AT firmware can set transmit transparency mode to do this, but I want to know how to flash it using Espruino, thank you.
-
-
To reproduce it, you need to:
(1).Get a string, length about 1000(I download string from WebSocket).
(2).fs = require("Storage"); fs.erase("aName"); fs.write("aName", thatString);
(3). Code in .boot0:
if(fs.getFree()<4096) fs.compact();
if the free space did less than 4096 and compact() has run and reboot itself after compact, then run
fs.compact();
again, if those actions right, you will lost all data in flash. -
-
I made a version using your arguments and flashed the 01s, but the issue still happened when I do the same actions. But I do get 196608 space like 4MB board.
And, could I ask why theNO_FOTA=1
don't work for 4MB board, like NodeMCU, I can't still use FOTA on it. My purpose is to get more space beyond 196608 on 4MB board, thank you. -
I have NodeMCU(32MB version), but the size(physical) is too big. And my project only needs 2 IOs.
Besides, this happened when I tried to
require("Storage").compact();
, the free space on the flash at least has 60%, and my purpose is to compact it myself instead of automatically(when the free space run out), cause that will lead to data loss.And I don't know how to compile it myself, I cloned the source and tried to compile, but I have no idea where I could find the hex file, I am noob. :D.
But anyway, thank you for the reply.
-
-
@MaBe @Raik I tried to update to 2.05 and run some tests. The result is this issue does not vanish.
I have code in .boot0 which isif(fs.getFree()<4096) fs.compact();
and I can see espruino will compact and restart when the free space down below 4096, then I run fs.compact() again in console after it restarted, and after reboot, all data were lost. fs.getFree() shows me 16384 on esp8266-01s, and fs.list() has an empty array as result.
-
-
-
Yeah.