-
@Wilberforce, I started this conversation after seeing that on arduino my boards were doing ~100kb/sec, while on espruino it was only 1kb/sec, for server a file. In fact, I am using espruino since the v1.91, and all that time I thought it was a hardware limitation of esp8266. But it seems to me that the problem comes from the dSnd buffer sent slowly, every 200m, in small pieces of 256bytes.
As it works faster on arduino, the board is not defective. It works the same way on the 2 nodemcu-e12 v2 & v3 that I have. I restarted the router, and tried AP alone (at 20cm from my laptop), station alone and AP+ST, still the same damn result !
@MaBe, I found it at ps-poll even though it was in AP+ST mode. No change when I set it to "none" using with Wifi.setConfig({powersave:"none"}).
@ClearMemory041063, I tried without improvement also flashing the last expressif firmware with the expressif flashing tool like you did, just in case. I used "esp_init_data_default_v05.bin", because there was no "esp_init_data_default.bin". I could not get it working without also changing addresses of this file and of "blank.bin" to 0x3fc000 and 0x37e000. I got a nice :
AT+GMR AT version:1.4.0.0(May 5 2017 16:10:59) SDK version:2.1.0(116b762) compile time:May 5 2017 16:37:48 OK
Then I reflashed espruino, this time with expressif flashing tool. I used the files from this url. I used the addresses from your link and I tried with "blank .bin" at 0x3FE000 like I used to do, both works same way. Still as slow as before.
I tried other browsers too, older espruino versions (v1.91, v1.94). The strangest that no one else ever have or noticed this problem before.
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.155 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0xef chip 0x4016 >Start connection process Try Connecting to WiFi Gardening, cheaper than therapy =undefined Test for error Test for error Test for error null connected? err= null info= { "ip": "192.168.2.6", "netmask": "255.255.255.0", "gw": "192.168.2.1", "mac": "2c:3a:e8:0e:9f:1c" } Wi-Fi Connected n= 4 t: 0.018 sec n= 3 t: 1.711 sec [WS] "Hello to Espruino!" n= 2 t: 3.186 sec [WS] "Hello to Espruino!" n= 1 t: 4.691 sec [WS] "Hello to Espruino!" n= 0 t: 6.165 sec [WS] "Hello to Espruino!"
-
So you're a lucky guy, it's working fast for you for 2 different esp8266 based boards..
I really don't understand what's wrong with my nodemcu-e12. I don't have any other esp8266 to try. I installed mine with the same files, but using esptool. If I install last espressif firmware before, it wont make a difference, it will be erased by esptool, right ?
I still get a slow download. Honestly, I don't know where to go from here.python esptool.py --port COM20 --baud 115200 write_flash --flash_freq 80m --flash_mode qio --flash_size 32m 0x0000 boot_v1.6.bin 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 >Start connection process Try Connecting to WiFi Gardening =undefined Test for error Test for error Test for error Test for error Test for error null connected? err= null info= { "ip": "192.168.2.5", "netmask": "255.255.255.0", "gw": "192.168.2.1", "mac": "2c:3a:e8:0e:9f:1c" } Wi-Fi Connected n= 4 t: 0.006 sec n= 3 t: 0.869 sec [WS] "Hello to Espruino!" n= 2 t: 1.525 sec [WS] "Hello to Espruino!" n= 1 t: 2.197 sec [WS] "Hello to Espruino!" n= 0 t: 2.859 sec [WS] "Hello to Espruino!"
-
Hmm, that's interesting, it seems hardware related. Your Sparkfun Thing dev-board rocks with espruino !
I don't get your result, with both my poor nodemcus-e12 v3 with 1.95.0 not 4mb , and my v4 lolin with 1.95.20 4mb.
Where can I find this flash map 256/256 you used ? I'm still getting data as slow as before:_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 >Start connection process Try Connecting to WiFi Gardening, cheaper than therapy =undefined Test for error Test for error Test for error Test for error Test for error null connected? err= null info= { "ip": "192.168.2.8", "netmask": "255.255.255.0", "gw": "192.168.2.1", "mac": "a0:20:a6:14:52:af" } Wi-Fi Connected n= 4 t: 0.015 sec n= 3 t: 1.701 sec [WS] "Hello to Espruino!" n= 2 t: 3.207 sec [WS] "Hello to Espruino!" n= 1 t: 4.681 sec [WS] "Hello to Espruino!" n= 0 t: 6.207 sec [WS] "Hello to Espruino!"
-
-
Thanks @ClearMemory041063 for giving attention to my problem, and for the codes to try. You are not testing them on an esp8266, are you ? The last code makes 11,5kb minified, it does not fit, it interrupt the transfer from the IDE. So I had to remove the connecting code and reduce the data to send to 3kb. I cannot send more at once without getting memory errors.
Unfortunately, at the end, the result with ws is as slow as with http: 2.5sec for 3kb (see the code below). Maybe because ws server is built on top of an http server.
var n = 5, chk=3*1024; var tdata=new Uint8Array(chk); var i; for(i=0;i<1024;i++){ tdata[i]=0x30; tdata[i+1024]=0x31; // tdata[i+1024*2]=0x32; // tdata[i+1024*3]=0x33; // tdata[i+1024*4]=0x34; }//next i var page = '<html><body><script>var ws;setTimeout(function(){'; page += 'ws = new WebSocket("ws://" + location.host + "/my_websocket", "protocolOne");'; page += 'var t=(new Date()).getTime();ws.onmessage = function (event) { console.log("t:",(new Date()).getTime()-t,"MSG:",event.data); };'; page += 'setTimeout(function() { ws.send("Hello to Espruino!"); }, 1000);'; page += '},1000);</script></body></html>'; function onPageRequest(req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.end(page); } var server = require('ws').createServer(onPageRequest); server.listen(80); server.on("websocket", function(ws) { ws.on('message',function(msg) { print("[WS] "+JSON.stringify(msg)); }); var t=getTime(); ws.send(E.toString(tdata)); print("n=",n,"t:",(getTime()-t).toFixed(3),"sec"); var inter=setInterval(function(){ var l=ws.socket.dSnd.length; print("t",getTime()-t,"l",l); if(l===0) clearInterval(inter); },100); // ws.send("Hello from Espruino!"); });
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.155 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 > =undefined n= 5 t: 0.018 sec t 0.12109500000 l 2984 t 0.22103200000 l 2984 t 0.32097500000 l 2716 t 0.420522 l 2716 t 0.52113300000 l 2448 t 0.62102500000 l 2448 t 0.72063500000 l 2180 t 0.82108700000 l 2180 t 0.921061 l 1912 [WS] "Hello to Espruino!" t 1.020693 l 1644 t 1.12096200000 l 1644 t 1.22103700000 l 1376 t 1.32081700000 l 1376 t 1.42095800000 l 1108 t 1.52093400000 l 1108 t 1.62055600000 l 840 t 1.72074900000 l 840 t 1.82093100000 l 840 t 1.92100099999 l 572 t 2.020918 l 572 t 2.12098700000 l 304 t 2.220733 l 304 t 2.320561 l 36 t 2.42057400000 l 36 t 2.52083200000 l 0
-
I hope we can raise this upload speed limit I am reaching.
@Gordon, it looks like the chunk size you mention 256 bytes every 200ms, that's where my ~1kb per second comes from.
@ClearMemory041063, I tried your code, but it runs after 2 steps in a "Execution Interrupted New interpreter error: LOW_MEMORY,MEMORY".
There is another strange thing, drain get called one more times after res.end() has been called.
Here's the code that looks into the dSnd, 12.5sec for 15ko :var n = 5, chk=3*1024; var tdata=new Uint8Array(chk); var i; for(i=0;i<1024;i++){ tdata[i]=0x30; tdata[i+1024]=0x31; tdata[i+1024*2]=0x32; // tdata[i+1024*3]=0x33; // tdata[i+1024*4]=0x34; }//next i function onPageRequest(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); var t=getTime(); res.on('drain',function() { print("n=", n,"t:",(getTime()-t).toFixed(3),"sec"); if (n===0){ res.end(); clearInterval(inter); print("end n=",n,"t:",(getTime()-t).toFixed(3),"sec"); } else { res.write(E.toString(tdata)); n--; } //end else });//end opr inter=setInterval(function () { console.log("--t:",(getTime()-t).toFixed(3),"res",res.dSnd.length); }, 100); }//end function require('http').createServer(onPageRequest).listen(80);
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.23 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 > =undefined n= 5 t: 0.004 sec --t: 0.103 res 3072 --t: 0.203 res 3072 --t: 0.303 res 2804 --t: 0.403 res 2804 --t: 0.503 res 2536 --t: 0.603 res 2536 --t: 0.703 res 2268 --t: 0.803 res 2268 --t: 0.903 res 2000 --t: 1.003 res 2000 --t: 1.103 res 1732 --t: 1.203 res 1732 --t: 1.303 res 1732 --t: 1.403 res 1464 --t: 1.503 res 1464 --t: 1.603 res 1196 --t: 1.703 res 1196 --t: 1.803 res 928 --t: 1.903 res 928 --t: 2.003 res 660 --t: 2.103 res 660 --t: 2.203 res 392 --t: 2.303 res 392 --t: 2.403 res 124 --t: 2.503 res 124 n= 4 t: 2.589 sec --t: 2.603 res 3072 --t: 2.703 res 3072 --t: 2.803 res 3072 --t: 2.903 res 2804 --t: 3.003 res 2804 --t: 3.103 res 2536 --t: 3.203 res 2536 --t: 3.303 res 2268 --t: 3.403 res 2268 --t: 3.503 res 2000 --t: 3.603 res 2000 --t: 3.703 res 1732 --t: 3.803 res 1732 --t: 3.903 res 1464 --t: 4.003 res 1464 --t: 4.103 res 1196 --t: 4.203 res 1196 --t: 4.303 res 928 --t: 4.403 res 928 --t: 4.503 res 660 --t: 4.603 res 660 --t: 4.703 res 660 --t: 4.803 res 392 --t: 4.903 res 392 --t: 5.003 res 124 --t: 5.103 res 124 n= 3 t: 5.118 sec --t: 5.203 res 3072 --t: 5.303 res 3072 --t: 5.403 res 2804 --t: 5.503 res 2804 --t: 5.603 res 2536 --t: 5.703 res 2536 --t: 5.803 res 2268 --t: 5.903 res 2268 --t: 6.003 res 2000 --t: 6.103 res 2000 --t: 6.203 res 1732 --t: 6.303 res 1732 --t: 6.403 res 1464 --t: 6.503 res 1464 --t: 6.603 res 1196 --t: 6.703 res 1196 --t: 6.803 res 928 --t: 6.903 res 928 --t: 7.003 res 660 --t: 7.103 res 660 --t: 7.203 res 660 --t: 7.303 res 392 --t: 7.403 res 392 --t: 7.503 res 124 --t: 7.602 res 124 n= 2 t: 7.619 sec --t: 7.703 res 3072 --t: 7.803 res 3072 --t: 7.903 res 2804 --t: 8.003 res 2804 --t: 8.103 res 2536 --t: 8.203 res 2536 --t: 8.303 res 2268 --t: 8.403 res 2268 --t: 8.503 res 2000 --t: 8.603 res 2000 --t: 8.703 res 2000 --t: 8.803 res 1732 --t: 8.903 res 1732 --t: 9.003 res 1464 --t: 9.103 res 1464 --t: 9.203 res 1196 --t: 9.303 res 1196 --t: 9.403 res 928 --t: 9.503 res 928 --t: 9.603 res 660 --t: 9.703 res 660 --t: 9.803 res 392 --t: 9.903 res 392 --t: 10.003 res 124 --t: 10.103 res 124 n= 1 t: 10.176 sec --t: 10.203 res 3072 --t: 10.303 res 3072 --t: 10.403 res 2804 --t: 10.503 res 2804 --t: 10.603 res 2804 --t: 10.703 res 2536 --t: 10.803 res 2536 --t: 10.903 res 2268 --t: 11.003 res 2268 --t: 11.103 res 2000 --t: 11.203 res 2000 --t: 11.303 res 1732 --t: 11.403 res 1732 --t: 11.503 res 1464 --t: 11.603 res 1464 --t: 11.703 res 1464 --t: 11.803 res 1196 --t: 11.903 res 1196 --t: 12.003 res 928 --t: 12.103 res 928 --t: 12.203 res 660 --t: 12.303 res 660 --t: 12.403 res 392 --t: 12.503 res 392 --t: 12.603 res 124 --t: 12.703 res 124 n= 0 t: 12.767 sec end n= 0 t: 12.769 sec n= 0 t: 0.004 sec end n= 0 t: 0.006 sec
-
The arduino code I used is from this tutorial : https://www.hackster.io/rayburne/nodemcu-esp8266-remote-temperature-using-websockets-5956c4
The code make a webserver serving files on the flash with spiffs, I just added a 1mb file, and I get it in less than 13 seconds, I just tried again. -
@ClearMemory041063, I am surprised it goes a bit faster on your setup. I still got 17 sec for the 20kb, when I tried the two programs you posted. I tried with/out AP/station, no change. What version of espruino are you running ?
The only change I did was 5*4kb chunk, instead of 4*5kb chunks, as the latter stopped after n=3 (I guess a memory shortage).var n = 5, chk=4*1024; var tdata=new Uint8Array(chk); var i; for(i=0;i<1024;i++){ tdata[i]=0x30; tdata[i+1024]=0x31; tdata[i+1024*2]=0x32; tdata[i+1024*3]=0x33; // tdata[i+1024*4]=0x34; }//next i function onPageRequest(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); var t=getTime(); n=5; res.on('drain',function() { print("n=",n,"t:",(getTime()-t).toFixed(3),"sec"); if (n===0){ res.end(); print("n=",n,"t:",(getTime()-t).toFixed(3),"sec"); }else { res.write(E.toString(tdata)); n--; }//end else });//end opr }//end function require('http').createServer(onPageRequest).listen(80);
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.23 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 > =undefined n= 5 t: 0.004 sec n= 4 t: 4.339 sec n= 3 t: 7.640 sec n= 2 t: 10.941 sec n= 1 t: 14.263 sec n= 0 t: 17.558 sec n= 0 t: 17.559 sec
var n = 5, chk=4*1024; var tdata=new Uint8Array(chk); function onPageRequest(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); var t=getTime(); res.on('drain',function() { print("n=",n,"t:",(getTime()-t).toFixed(3),"sec"); if (n===0){ res.end(); print("n=",n,"t:",(getTime()-t).toFixed(3),"sec"); }else { res.write(E.toString(tdata)); n--; }//end else });//end opr }//end function require('http').createServer(onPageRequest).listen(80);
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.23 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 > =undefined n= 5 t: 0.003 sec n= 4 t: 3.330 sec n= 3 t: 6.626 sec n= 2 t: 9.945 sec n= 1 t: 13.246 sec n= 0 t: 16.599 sec n= 0 t: 16.601 sec
-
@ClearMemory041063, not sure I understand correctly, yes I tested with an arduino program flashed on the esp8266. With arduino, I believe there is no other way than to flash my program in there.
-
I am in the first case: Esp8266 with Espruino flashed into the Esp8266. By marshalling data, I assume you refer to the E.toString. It's not much different without marshalling. The loop finish in only 13ms with a straight string (instead of 26ms for uint8array), but the 5kb of data still make 5 seconds to finish loading in the browser, in at least ten pieces :
var data=""; var chk=1024; for(var i=0;i<chk;i++) data+="0"; function onPageRequest(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); var n= 5, t=getTime(); for(var i=0;i<n;i++) { res.write(data,'binary'); print("t:",(getTime()-t).toFixed(3),"sec"); } res.end(); } require('http').createServer(onPageRequest).listen(8080);
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.23 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 > =undefined t: 0.002 sec t: 0.005 sec t: 0.008 sec t: 0.010 sec t: 0.013 sec t: 0.002 sec t: 0.005 sec t: 0.008 sec t: 0.010 sec t: 0.013 sec
-
Is it possible to flush this buffer to be sent immediately somehow ? or get called until the buffer is really full ?
As if it is making an unnecessary break before each send. If I reduce the chunk size from 5kb to 256bytes, the average speed is dramatically decreased.I can't send 20kb in one go, I get "New interpreter error: LOW_MEMORY,MEMORY". If I send only 1 chunk of 5bk, it still takes 5 seconds even straight away without ondrain:
function onPageRequest(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); var n = 1, chk=5*1024, t=getTime(); res.write(E.toString(new Uint8Array(chk))); res.end(); } require('http').createServer(onPageRequest).listen(8080);
It actually seems hanging few seconds before sending anything.
-
-
Hi all,
I am working on a webserver using espruino and the esp8266, to store sensor data in the flash, and serve it to a web browser. But the network seems very slow, e.g. about 1kb per second, depending on the size of each write, much slower than when using Arduino. In this example, it takes 15second to serve 20kb :function onPageRequest(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); var n = 4, chk=5*1024, t=getTime(); res.on('drain',function() { if (n==0) res.end(); else { res.write(E.toString(new Uint8Array(chk))); n--; } print("t:",(getTime()-t).toFixed(3),"sec"); }); } require('http').createServer(onPageRequest).listen(8080);
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.23 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 > =undefined t: 0.021 sec t: 5.057 sec t: 9.288 sec t: 13.494 sec t: 17.717 sec >
I tried with Arduino, it was 100x faster, and served 1.5Mb in the same 15 seconds. So it cannot be a hardware limitation. Is there a workaround or another way to send data faster with espruino ?
-
Thanks a lot Mabe for all your replies. I learned a few things, but honestly, I still feel a bit lost between builds, flash maps, etc.
My context, my current project actually run on my esp12-4mb with the basic 512/512 build. I use 8 modules, executed from flash, with FlashString (http://forum.espruino.com/conversations/290975/) and it's homemade IDE plugin (http://forum.espruino.com/conversations/313069/). I was trying to figure out if I can run it also on other configurations/builds of esp8266, and how to save and execute code from flash in these.It seems there is 1700 blocks no graphics in the 4mb combined build from http://www.espruino.com/binaries/espruino_1v95_esp8266_4mb_combined_4096.bin.
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.20 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016 >process.memory() ={ "free": 1672, "usage": 28, "total": 1700, "history": 0, "gc": 0, "gctime": 1.357 } >var g = Graphics.createArrayBuffer(8,8,8); Uncaught ReferenceError: "Graphics" is not defined at line 1 col 17 var g = Graphics.createArrayBuffer(8,8,8); ^ >
-
It was 16kb of minified code I uploaded and tried to save.
This is the output I get from the "4mb combined", 1700 blocks and no graphics:
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.20 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016 >process.memory() ={ "free": 1677, "usage": 23, "total": 1700, "history": 0, "gc": 0, "gctime": 1.352 } >require("ESP8266").getState(); ={ "sdkVersion": "2.0.0(5a875ba)", "cpuFrequency": 160, "freeHeap": 9728, "maxCon": 10, "flashMap": "4MB:1024/1024", "flashKB": 4096, "flashChip": "0xc8 0x4016" } >Graphics Uncaught ReferenceError: "Graphics" is not defined >require("Flash").getFree() =[ { "addr": 2097152, "length": 1048576 }, { "addr": 3145728, "length": 262144 }, { "addr": 3407872, "length": 262144 }, { "addr": 3670016, "length": 262144 }, { "addr": 3932160, "length": 262144 } ]
-
Thanks again Mabe, for your reply. I made a copy/paste mistake earlier, now it's updated.
The esp8266 4mb not combined version (found here) get me :
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.20 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 >
It says 512/512. Is it the first or the second build ?
Using the 4mb combined, from the WebIDE, I managed to upload 16kb of code, 4kb by 4kb, and the total took 1300 blocks, and it can't be saved with save(), too big :
> _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.20 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016 > process.memory() ={ "free": 360, "usage": 1340, "total": 1700, "history": 358, "gc": 0, "gctime": 1.351 } >save() =undefined Erasing Flash..... Writing.................. ERROR: Too big to save to flash (15900 vs 12284 bytes) Deleting command history and trying again... Erasing Flash..... Writing..................
I fail to grasp the rationale behind these 16 pages for saved code and how are we supposed to fill them. Ok, I can fill 12kb of the 64kb reserved for saving code. Is there a way to use the resting 52kb ? is there a way to execute them from flash (like with save-on-send/E.memoryArea) ?
-
Thanks @MaBe for your reply, Things are ... more confusing now :P
Do I understand correctly, there is 3 different builds for esp8266 ?1 / build 8266
found here : http://www.espruino.com/binaries/espruino_1v95_esp8266/. I guess it's the one decribed by this file : https://github.com/espruino/Espruino/blob/master/boards/ESP8266_BOARD.py. Has a 1700 vars and no Graphics. Available free flash total is 3mb+40kb, the 40kb are under 1mb usable to run modules from flash with E.memoryArea(). This is the build I usually use, with no problem. I install it with :python esptool.py --port COM20 --baud 115200 erase_flash python esptool.py --port COM20 --baud 115200 write_flash --flash_freq 40m --flash_mode dio --flash_size 32m 0x0000 boot_v1.6.bin 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
and get
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.20 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 >process.memory() ={ "free": 1677, "usage": 23, "total": 1700, "history": 0, "gc": 0, "gctime": 1.352 } >require("Flash").getFree() =[ { "addr": 487424, "length": 4096 }, { "addr": 524288, "length": 4096 }, { "addr": 1011712, "length": 36864 }, { "addr": 1048576, "length": 3129344 } ]
2 / build 8266 4mb
found here : http://www.espruino.com/binaries/espruino_1v95_esp8266_4mb/. I guess it's the one decribed by this file : https://github.com/espruino/Espruino/blob/master/boards/ESP8266_4MB.py. Has a 1600 vars and Graphics.
I install it with the exact same command line, maybe it is not correct ? I get a very similar result, except that when I store something in the 6 first flash pages, it get erased on save(). Any idea why ?_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.20 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xef chip 0x4016 >process.memory() ={ "free": 1572, "usage": 28, "total": 1600, "history": 0, "gc": 0, "gctime": 1.726 } >require("Flash").getFree() =[ { "addr": 487424, "length": 4096 }, { "addr": 524288, "length": 4096 }, { "addr": 1011712, "length": 36864 }, { "addr": 1048576, "length": 3129344 } ] >Graphics =function () { [native code] }
3 / build 8266 4mb combined found here : http://www.espruino.com/binaries/espruino_1v95_esp8266_4mb_combined_4096.bin. I think it's the one you are referring to. is it described somewhere ? It has 1700 vars, no Graphics. I used the "4mb-c1" you posted in the other thread, and it worked perfectly. I understand the flash available is only the last 2MB, so not possible to have modules running from flash.
python esptool.py --port COM20 --baud 115200 write_flash --flash_freq 80m --flash_mode dio --flash_size 4MB-c1 0x0000 boot_v1.6.bin 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
(updated following)
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.20 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016 >process.memory() ={ "free": 1672, "usage": 28, "total": 1700, "history": 0, "gc": 0, "gctime": 1.358 } >require("Flash").getFree() =[ { "addr": 2097152, "length": 1048576 }, { "addr": 3145728, "length": 262144 }, { "addr": 3407872, "length": 262144 }, { "addr": 3670016, "length": 262144 }, { "addr": 3932160, "length": 262144 } ]
For this version, you mention 16 pages of saved code available, that's 64kb. How is it possible to store as much code in them ? If I use the WebIDE, the board throw a UNFINISHED STRING when the transfer reach 10kb. I guess there is no memory for larger transfer. Is there another way ?
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.20 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016 >Uncaught SyntaxError: Got UNFINISHED STRING expected EOF at line 1 col 15 E.setBootCode("Modules.removeAllCached(),Modules.addCached('... ^ New interpreter error: LOW_MEMORY,MEMORY >
-
I see no reason why it doesn't work. Maybe the adapter. I use a nodemcu version with a different adapter (http://img.dxcdn.com/productimages/sku_406735_1.jpg)
-
@tempos, that's strange for the normal version, mine is also an e12. Which command line did you use for flashing the separate files ? It happens only with the v1.95 or also v1.94 or c1.93?
-
Hi, I tried with the same file and command line. I got the same problem: after I save wifi and replug, the led is continuously lit and the board only say garbage. The combined version 512 don't work at all, at least on my esp8266 4mb.
I didn't even know about this combined release, before this post. The normal not "combined" version, i.e with separate files, works much better, and I am still using it. Not a solution, but a workaround. -
Hi,
Where did you find command line addresses for the 4mb_combined ? I wanted to try it too, but didn't find the instructions.On my esp--12E, esp8266 4mb, I uses this image http://www.espruino.com/binaries/travis/master/espruino_1v95.13_esp8266.tgz, installed with
python esptool.py --port COM18 --baud 115200 write_flash --flash_freq 80m --flash_mode dio --flash_size 32m 0x0000 boot_v1.6.bin 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
No problem saving code or saving wifi. Works perfectly, or almost, sometimes It freeze when I reset.
-
Hi,
I have a esp8266 board with 4mb. I can safely run both of these versions right ?
I know there is a difference between these two configurations of firmware. The 4MB version has additional graphics library, but only 1600 jsvars (and not 1700). This is defined by these files :
https://github.com/espruino/Espruino/blob/master/boards/ESP8266_BOARD.py
https://github.com/espruino/Espruino/blob/master/boards/ESP8266_4MB.pyBut why does the code save at a different place ? The 4MB version saved code use 16 pages of flash (64kb) instead of 3 (kb), but the board still cannot take more than 10kb at once, when I use the WebIDE. Is there a way to use these pages in the _4mb firmware ?
In the 4MB version, save() erase the 6 first pages returned by require("Flash").getFree(), I use for my custom modules to run from flash. Possibly caused by the 16pages of flash erased. But I don't understand, are they free to use or not ?
-
-
@Gordon, thanks for your reply. Finally v1.95 worked for me perfectly when I switched to package espruino_1v95_esp8266.tgz, I can finally run it with all my modules. The problem was only with package espruino_1v95_esp8266_4mb.tgz. I'll ask about this in the ESP8266 forum.
Thanks, very handy the .bat files. I followed the procedure with no change in speed. I placed the files in the "espruino_1v95_esp8266" directory. I ran info, erase and flash batch files.
I replugged and reflashed the WSdesp8266C. It does not go faster than before.