Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reading temp.csv #101

Open
scalesr1 opened this issue Nov 6, 2023 · 7 comments
Open

Error reading temp.csv #101

scalesr1 opened this issue Nov 6, 2023 · 7 comments

Comments

@scalesr1
Copy link

scalesr1 commented Nov 6, 2023

Hello, I followed your wonderful article regarding the logging of temperature. I had BMP sensors on hand so modified the code to use those.

Everything compiles OK, the code runs - the serial monitor shows the output as described in your article yet, when I read the page in a browser, I get a message saying 'Loading' and the serial monitor shows 'File Not Found' when sending the web pages etc.

Am i being too hasty? - it has been running for 10 minutes now, or might there be some other issue?

Kind regards

Richard

@scalesr1
Copy link
Author

scalesr1 commented Nov 6, 2023

I made a file temp.csv file and put a single line of data which I copied from the serial monitor and uploaded it with the spiffs just in case it was not being created for some reason.
This appears to have remedied the issue. Now I get a graph - albeit with no data (only 1 minute in and only 1 additional line written to the file) - at least now there is no error when requesting the page in a browser.
OH NO!
Now that data has been written to the file - it is no longer found when the page is requested :-(
What might I be doing wrong?
I will get that sensor connected asap so at least the data is correct.
Kind regards

Richard

@scalesr1
Copy link
Author

scalesr1 commented Nov 6, 2023

If I restart the micro - the routine which lists the available files does not list temp.csv.
I think I should read your article from the beginning - I umped straight to the temperature logger page!
Kind regards
Richard

@scalesr1
Copy link
Author

scalesr1 commented Nov 6, 2023

Panic C:\Users\richard.RCS\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.

I get this from time to time.

Kind regards

Richard

@scalesr1
Copy link
Author

scalesr1 commented Nov 6, 2023

This is the serial output:

Connected to MFnewWiFi
IP address: 192.168.1.221

OTA ready

SPIFFS started. Contents:
FS File: /edit.html, size: 1.37KB
FS File: /favicon-144x144.png, size: 2.81KB
FS File: /favicon.ico, size: 37.19KB
FS File: /index.html, size: 1.82KB
FS File: /main.css, size: 745B
FS File: /manifest.json, size: 169B
FS File: /success.html, size: 913B
FS File: /temp.csv, size: 26B
FS File: /temperatureGraph.js, size: 5.55KB

mDNS responder started: http://esp8266.local
HTTP server started.
Starting UDP
Local port: 123
Time server IP: 129.6.15.26
Sending NTP request
NTP response: 1699253356
Temperature requested
Appending temperature to file: 1699253357,21474836.00
File was written
handleFileRead: /
Sent file: /index.html
handleFileRead: /temperatureGraph.js
Sent file: /temperatureGraph.js
handleFileRead: /temp.csv
Sent file: /temp.csv
handleFileRead: /favicon.ico
Sent file: /favicon.ico
handleFileRead: /
Sent file: /index.html
handleFileRead: /temperatureGraph.js
Sent file: /temperatureGraph.js
handleFileRead: /temp.csv
Sent file: /temp.csv
handleFileRead: /favicon.ico
Sent file: /favicon.ico
handleFileRead: /
Sent file: /index.html
handleFileRead: /temperatureGraph.js
Sent file: /temperatureGraph.js
handleFileRead: /temp.csv
Sent file: /temp.csv
handleFileRead: /favicon.ico
Sent file: /favicon.ico
handleFileRead: /
Sent file: /index.html
handleFileRead: /temperatureGraph.js
Sent file: /temperatureGraph.js
handleFileRead: /temp.csv
Sent file: /temp.csv
handleFileRead: /favicon.ico
Sent file: /favicon.ico
Temperature requested
Appending temperature to file: 1699253417,21474836.00
File was written
handleFileRead: /temp.csv
File Not Found: /temp.csv
handleFileRead: /temp.csv
File Not Found: /temp.csv

I was able to display the graph for a few moments before it started saying 'file not found'
I am using a Wemos D1 Mini for this project and SPIFFS are set to 4M(1M SPIFFS).
It just seems that it has something to do with the file system but I am lost at that point.

Kind regards
RIchard

@scalesr1
Copy link
Author

scalesr1 commented Nov 6, 2023

Additional,
I added a sensor - now I am reading a temp though it is reading as 0.0 - not worried about that at the moment.
If I let the code run it continually adds data to the file.
At the moment I request a read by loading the web page I see this:

Temperature requested
Appending temperature to file: 1699255883,0.00
Temperature requested
Appending temperature to file: 1699255893,0.00
Temperature requested
Appending temperature to file: 1699255903,0.00
Temperature requested
Appending temperature to file: 1699255913,0.00
Temperature requested
Appending temperature to file: 1699255923,0.00
Temperature requested
handleFileRead: /temp.csv

Temperature requested
Appending temperature to file: 1699255883,0.00
Temperature requested
Appending temperature to file: 1699255893,0.00
Temperature requested
Appending temperature to file: 1699255903,0.00
Temperature requested
Appending temperature to file: 1699255913,0.00
Temperature requested
Appending temperature to file: 1699255923,0.00
Temperature requested
handleFileRead: /temp.csv

Panic C:\Users\richard.RCS\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: 3fff2244 00000015 3fff0c50 40202cc9
3ffffd60: 3fff19cc 00000000 3fff20e4 4020a655
3ffffd70: 3ffef6a8 000004b0 000004b0 00000015
3ffffd80: 00000015 00000000 3fff2224 40213cb9
3ffffd90: 00000015 00000000 00000015 40214cd4
3ffffda0: 00000000 4bc6a7f0 00000015 40211900
3ffffdb0: 00000000 00000000 3fff2224 4020a2de

This is where I need guidance - I can sort the temp reading out no problem.

Kind regards

Richard

@scalesr1
Copy link
Author

scalesr1 commented Nov 6, 2023

I am now at the point where the wemos seems stable but the files in the SPIFF's appear to be disappearing - they appear to be being consumed in some way - is that as the data file is being wwritten?
Kind regards
Richard

@scalesr1
Copy link
Author

scalesr1 commented Nov 6, 2023

DISREGARD that last comment - a quick reset lists all the files on the serial monitor but a fresh read of the web page causes the PANIC message again ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant