siara-cc / esp32_arduino_sqlite3_lib

Sqlite3 Arduino library for ESP32
Apache License 2.0
370 stars 66 forks source link

Database does not contain the information entered after a close and a reset. #35

Closed riquebrenner closed 3 years ago

riquebrenner commented 3 years ago

Good morning.

I come through this, because I already exhausted my research. I'm having trouble closing the database file.

In my project I am planning a lot of firmware updates, but the database must remain unchanged.

I use the extra memory space of ESP32 with the SPIFFS library to create permanent files.

I can execute "flush" in JSON file with the "arduinojson" library but when using the "SQLite3ESP32" v2.3.0 library I do not see this option in the manual and when executing the "sqlite3_close ()" command and then immediately perform a "reset" "at ESP32 the data base file no longer contains the information that was entered and many times the file is corrupted.

Am I running something wrong? Are there any commands missing from the file closing process?

Thank you Henrique Aschenbrenner

siara-cc commented 3 years ago

Please try adding a delay before you reset(). It could be that the reset happens before the write completes.