Help with fetching JSON and parsing with jRead

Hello all,
I am currently using ArduinoJSON to fetch a json file from a URL, parse it and display parsed values on the serial monitor - on an ESP32.
The problem I am facing with this is that the code locks up after running flawlessly for a few hours.
From reading a few posts on here, it seems it is expected behavior since it is very resource intensive.

Can somebody please help me with a code snippet in which I can use the jRead library by @TonyWilk ?
This link can be used to test fetching a JSON file from a URL: http://date.jsontest.com/

I know @WPD64 has done something like this before.

In the current setup, I am using:

      DynamicJsonDocument jsonBuffer(30000); //11000
      DeserializationError error = deserializeJson(jsonBuffer, client);

Where the data is collected from client.

Any help is greatly appreciated.
Thank you!

Is the example JSON date you supplied what your reading and extracting? The jsonBuffer size seems excessive for such a simple value.

{
   "date": "02-23-2022",
   "milliseconds_since_epoch": 1645596593195,
   "time": "06:09:53 AM"
}

If it is a true example then the data is very simple and should really not cause lock-up issues on an ESP32.
I read data like the below JSON on an ESP32 over LoRa, deserialize it, add extra fields like RSSI etc, serialize it and send over MQTT as a JSON string. Up until a couple of days ago where a power cut during a storm reset the ESP32 it had been running for about 8 months without issue

Receive:
{"D":"L2","N":0,"T":26.13,"P":1020.00,"A":-56.06,"H":46.82,"L":496.00,"V":3.73}

Send:
{"D":"L4","N":211,"T":20.44,"P":1018.92,"A":-47.10,"H":49.52,"L":6.70,"V":3.85,"RSSI":-47,"SNR":10,"F_ERR":14722,"TIME":1645598130}

Hi @Riva ,
No, I posted that json link just as an example.
The file I’m trying to read is very long!

Here’s that exact file:
https://www.purpleair.com/json?show=113190

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.