tttapa / ESP8266

Documentation and help with the ESP8266 chip/boards/modules
GNU General Public License v3.0
661 stars 283 forks source link

Data logging - sudden restart when webpage loaded - panic DataSource.h #35

Open RBlasius opened 6 years ago

RBlasius commented 6 years ago

Hi, thank you for this tutorial, which I found very useful when starting with ESP as a beginner. I've already made some simple sensor projects, but now I'm having something I cannot solve.

I’m working on the data logging part with an ESP8266-01, and somehow I cannot succeed, because I have the following issue. Problem is that when I load the webpage, the ESP restarts. All other things work fine, right until I load the web page. It’s showing the index file (Loading…) only, and simultaneously it makes the ESP restart. The crash is at Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi\src\include/DataSource.h.

Here you find what I have on the terminal: " Connecting .........

Connected to name IP address: 192.168.1.108

OTA ready

SPIFFS started. Contents: FS File: /edit.html.gz, size: 700B FS File: /favicon-144x144.png, size: 2.81KB FS File: /favicon.ico.gz, size: 1.91KB FS File: /index.html.gz, size: 841B FS File: /main.css.gz, size: 349B FS File: /manifest.json, size: 169B FS File: /success.html.gz, size: 456B FS File: /temperatureGraph.js.gz, size: 1.71KB FS File: /temp.csv, size: 18B

mDNS responder started: http://esp8266.local HTTP server started. Starting UDP Local port: 123 Time server IP: 132.163.96.2 Sending NTP request Sending NTP request NTP response: 1540569686 Temperature requested Appending temperature to file: 1540569742,24.44 Temperature requested Appending temperature to file: 1540569802,24.44

// AT THIS POINT I STARTED THE WEBPAGE//

handleFileRead: / Sent file: /index.html.gz handleFileRead: /temperatureGraph.js Sent file: /temperatureGraph.js.gz handleFileRead: /temp.csv

Panic C:\Users\LotusH-4\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi\src\include/DataSource.h:93 const uint8_t* BufferedStreamDataSource::get_buffer(size_t) [with TStream = Stream; uint8_t = unsigned char; size_t = unsigned int]: Assertion 'cb == stream_rem' failed.

ctx: cont sp: 3ffffba0 end: 3fffffd0 offset: 01b0

stack>>> 3ffffd50: 3fff1abc 00000012 3fff0618 40202e0d
3ffffd60: 3fff12fc 00000000 3fff1bf4 4020a765
3ffffd70: 3ffef418 00000419 00000419 00000012
3ffffd80: 00000012 00000000 3fff1a9c 40212281
3ffffd90: 00000012 00000000 00000012 402132d8
3ffffda0: 00000000 4bc6a7f0 00000012 4020ff00
3ffffdb0: 00000000 00000000 3fff1a9c 4020a3ee
3ffffdc0: 3fff12fc 3ffef1a0 401064d4 00000000
3ffffdd0: 00000012 00000012 3fff1bf4 4020a671
3ffffde0: 026ed49b 3ffef1a0 3ffffe7c 00000012
3ffffdf0: 3fff1bf4 3ffffe40 0000001c 00000012
3ffffe00: 3fff1bf4 3ffffe40 3fff1bf4 4020a72c
3ffffe10: 00000012 3ffffe40 00000000 4020aab4
3ffffe20: 00000000 3ffef440 3ffffeb0 00000001
3ffffe30: 00000012 3ffef440 3ffffeb0 40207f85
3ffffe40: 40213828 00000000 000003e8 3ffef11c
3ffffe50: 3fff0d54 3fff0d1c 00000000 00000000
3ffffe60: 00000000 00000009 3ffffeb0 4021122f
3ffffe70: 3fff1bd4 0000000f 0000000c 3fff1bbc
3ffffe80: 0000000f 0000000a 3ffffeb0 40211364
3ffffe90: 00000000 00000000 3ffef1a0 3ffef11c
3ffffea0: 00000000 3ffef1e4 3ffef1a0 40208046
3ffffeb0: 3fff0774 0000000f 00000009 00000000
3ffffec0: 00000000 00000000 3ffef1a0 40212d12
3ffffed0: 00000000 00000000 00000000 4020b846
3ffffee0: 00000000 00000000 00000000 4020ce42
3ffffef0: 00000000 00000000 00000000 00000000
3fffff00: 00000000 00000000 401064d4 00021a9f
3fffff10: 3ffef1e4 00000001 50e56041 00000000
3fffff20: 00000000 00000000 4020c244 0000000f
3fffff30: 00000000 3fff1bf4 401064d4 3ffef11c
3fffff40: 00000001 3ffef1c8 3ffef1a0 4020cfec
3fffff50: 026ec835 00000000 3fff1a34 4020b113
3fffff60: 3fffdad0 3ffef164 00021a9f 3ffef518
3fffff70: 3ffef124 3ffef118 00021a9f 40208506
3fffff80: 40213828 00000000 000003e8 3fffefb0
3fffff90: 00000000 00000000 000001f4 4020151f
3fffffa0: 00000000 00000000 00000001 3ffef518
3fffffb0: 3fffdad0 00000000 3ffef510 40211de0
3fffffc0: feefeffe feefeffe 3ffe8514 40100739
<<<stack<<<

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

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d vbb28d4a3 ~ld

Connecting .........

Connected to name IP address: 192.168.1.108 "

It's the same each every time.

What I’ve tried, but haven’t gained success: I found something similar here: https://github.com/esp8266/Arduino/issues/2504 but after checking the code, I realised I already have the improved DataSource.h. I tried it with SPIFFS size 512K (64K SPIFFS) and 512K (128K SPIFFS) options as well.

It would be very much appreciated if you could spend some time with it, and give a hint, what I’m doing wrong, what should I improve to make it working!

Thank you, Blas

Gord1 commented 6 years ago

Hi, I have the same problem. I'm starting to play with the ESP8266 too.

I get Panic /home/gordon/Downloads/sloeber/arduinoPlugin/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/DataSource.h:93 const uint8_t* BufferedStreamDataSource::get_buffer(size_t) [with TStream = Stream; uint8_t = unsigned char; size_t = unsigned int]: Assertion 'cb == stream_rem' failed.

ctx: cont sp: 3ffffbf0 end: 3fffffd0 offset: 01b0 and then stack dump.

Unfortunately, I'm a beginner too. But from what I understand the error is pointing to the

File file = SPIFFS.open(path, "r"); server.streamFile(file, contentType); <<<< something wrong with the stream file.close();

but this is a bit above my pay grade. Gord_W

Gord1 commented 6 years ago

I think the solution was to reduce the SPIFFS size to 1M under the tools tab board setup section. Gord_W

RBlasius commented 6 years ago

Thank's for the advice. I made some attempts, and set the spiffs size in Tools/ Flash size:

lpaq commented 5 years ago

Hi, I have exactly the same problem. I tried 1M(128K), 1M(192K) and 1M(256K). Trying to get ESP3D to work but my ESP-01 is resetting constantly (whether in AP or STAtion mode) with the same error in line 93 of DataSource.h; The example sketches though were all OK (for AP and STA scanning).

bennyboom38 commented 5 years ago

Hello I've also a ESP-01S and same issue on line 93 of DataSource.h;

Thanks for the help

spilz87 commented 5 years ago

I have the same issue with my ESP-01 no solution / explaination found ?

schimkat commented 4 years ago

I suddenly got the same problem. :-o

More info here: https://github.com/esp8266/Arduino/issues/6907

d-a-v commented 4 years ago

Which example is it ?