Reading from a large JSON file with ESP32

reesebrogd
Posts: 1
Joined: Wed Feb 14, 2024 6:45 pm

Reading from a large JSON file with ESP32

Postby reesebrogd » Wed Feb 14, 2024 8:13 pm

I am curious if anyone has any suggestions for reading from a 2MB JSON file with the ESP32 and an SD card.

Currently, we are thinking of creating a hashtable with the JSON objects, partitioning the hashtable into smaller files, and loading them onto an SD card. Then we will be able to hash our key and know which file to read from on the SD card to locate our key-value pair.

Alternatively, we could use the SQLite database management system on the ESP32 to handle the JSON data.

Does anyone know which solution would read files faster and load key-value pairs faster on the ESP32? Are there any other solutions?

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: Reading from a large JSON file with ESP32

Postby liaifat85 » Thu Feb 15, 2024 3:32 pm

You can consider JSON streaming.

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Reading from a large JSON file with ESP32

Postby chegewara » Fri Feb 16, 2024 4:54 am

Hi,
it is only theory, but i doubt you will be able to parse 2MB json string on esp32.
I would suggest to use CSV instead, where you can read line by line from file.

Who is online

Users browsing this forum: Bing [Bot] and 72 guests