Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By ChenBH
#57289
DaveEvans wrote:See igrr's second Jul 25 comment about using client.write(webFile);

https://github.com/esp8266/Arduino/issues/1853

It serves a 307kB file in less than a second.

I'll do it right away. Thanks!

martinayotte wrote:I think you're confused between ESP82WiFi and ESP82WebServer :
server.on() and server.send() are coming from ESP82WebServer, which is built on top of ESP82WiFi.


Is there a better one out of the two?
I see that server.send and .on are way shorter methods when trying to parse a request from the client. But what will happen when I'll need to basic-authenticate the client? server.on only takes the first line of the request header.


UPDATE:
Using Ubuntu 64bits on VM that runs Arduino 1.6.12, I cloned the current ESP8266/Arduino git version.
I manage to stream the file directly from the SD card but in the second time I try, I get this error:\
Code: Select allPanic /usr/share/arduino-1.6.12/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_main.cpp:98 __yield



ctx: sys

sp: 3ffffc80 end: 3fffffb0 offset: 01b0



>>>stack>>>

3ffffe30:  3ffefa3e 000002c1 000002c1 4010020c 

3ffffe40:  00000000 3ffe88ca 00000001 4020801d 

3ffffe50:  5f6e6542 6f726148 3fff09f0 402078b9 

3ffffe60:  3ffefa60 000001b3 000001a9 402078f7 

3ffffe70:  3fff208c 3fff10f0 3fff208c 3fff10e4 

3ffffe80:  3fff1d8c 00000568 3fff20a4 402047fb 

3ffffe90:  3fff208c 00000568 3fff1e74 402049ab 

3ffffea0:  00000000 001d68b6 3fff1d8c 3fff10e4 

3ffffeb0:  3fff1d8c 3fff10ec 3fff1e74 40204ad8 

3ffffec0:  00000000 3fffdcb0 3fff10e8 40204af8 

3ffffed0:  3fff1d8c 3fff10ec 3fff10e8 40226661 

3ffffee0:  00000000 0d00000a 00000010 00000000 

3ffffef0:  00000000 00000010 3ffeb1b9 40107af8 

3fffff00:  00000000 00000000 3ffeb1da 3fff118c 

3fffff10:  3ffeab6a 3fff1190 3fff13a4 40224a8d 

3fffff20:  3fff0ff8 3fff17a4 3fff17a4 3ffee7d0 

3fffff30:  00000000 3fff20c4 0000001c 3fff17a4 

3fffff40:  3ffeab5c 00000000 3fff13a4 40223e89 

3fffff50:  0e00000a 0000005e 00000000 00000020 

3fffff60:  00000002 0000001a 40210683 3ffed660 

3fffff70:  3ffeb7bc 3fffdcc0 3ffe9d30 3ffe9d30 

3fffff80:  402105f6 3ffed660 00000000 3fff1834 

3fffff90:  3fffdc80 00000000 3fff13a4 4022cda7 

3fffffa0:  40000f49 3fffdab0 3fffdab0 40000f49 

<<<stack<<<



 ets Jan  8 2013,rst cause:2, boot mode:(3,6)



load 0x4010f000, len 1384, room 16

tail 8

chksum 0x2d

csum 0x2d

v4897e000

~ld

And sometimes the chip restarts.

any suggestions?
User avatar
By martinayotte
#57407
ChenBH wrote:Is there a better one out of the two?
I see that server.send and .on are way shorter methods when trying to parse a request from the client. But what will happen when I'll need to basic-authenticate the client? server.on only takes the first line of the request header.


You still confuse between ESP8266WiFi and ESP8266WebServer.
The first one is plain socket while the second is really WebServer built on top of the first one.
For basic-authenticate, simply look at the ESP8266WebServer/examples/HttpBasicAuth example.
If you still use ESP8266WiFi, then you will have to re-invent the wheel for every things.

For the exception, you need to install EspExceptionDecoder to get more meaningful details :
https://github.com/me-no-dev/EspExceptionDecoder