Giter Site home page Giter Site logo

Comments (5)

hansaya avatar hansaya commented on May 31, 2024

I think it designed that way

from esp8266-webserver-tutorials.

mstjerna avatar mstjerna commented on May 31, 2024

But why save it the spiff att all then...

from esp8266-webserver-tutorials.

hansaya avatar hansaya commented on May 31, 2024

Because you cannot hold lot of data on Ram or you going to run out of usable ram

from esp8266-webserver-tutorials.

vvaru avatar vvaru commented on May 31, 2024

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.

Igor-from-moscow avatar Igor-from-moscow commented on May 31, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.