Most recent activity
-
@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
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.