Comments (5)
I think it designed that way
from esp8266-webserver-tutorials.
But why save it the spiff att all then...
from esp8266-webserver-tutorials.
Because you cannot hold lot of data on Ram or you going to run out of usable ram
from esp8266-webserver-tutorials.
I am getting this output after uploading Part 5 codes:
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
from esp8266-webserver-tutorials.
To solve this problem, I propose to replace the subprogram of the same name with the one below:
void loadHistory(){
DynamicJsonBuffer json_Buffer(5000);
File file = SPIFFS.open(HISTORY_FILE, "r");
if (!file){
Serial.println("No History Exist");
} else {
size_t size = file.size();
if ( size == 0 ) {
Serial.println("History file empty !");
} else {
std::unique_ptr<char[]> buf (new char[size]);
file.readBytes(buf.get(), size);
JsonObject &temp_root = json_Buffer.parseObject(buf.get()); //область видимости в этой подпрограмме только
if (!temp_root.success()) {
Serial.println("Impossible to read JSON file");
} else {
Serial.println("History loaded");
temp_root.prettyPrintTo(Serial);
Serial.println (" ");
//---- заполнение рабочего JsonObject
for (int i=0; i< temp_root["timestamp"].size(); i++){
timestamp.add( long(temp_root["timestamp"][i]));
hist_t.add(double(temp_root["t"][i]));
hist_h.add(double(temp_root["h"][i]));
hist_pa.add(double(temp_root["pa"][i]));
}
if ( temp_root["bart"].size() > 0 ) {
for ( int k = 0 ; k < 7 ; k++ ) {
bart.add(double(temp_root["bart"][k]));
barh.add(double(temp_root["barh"][k]));
}
}
}
}
file.close();
}
}
from esp8266-webserver-tutorials.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266-webserver-tutorials.