Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
431 views

Need help with parsing NWS JSON weather alerts causing reset on ESP8266

I'm trying to parse the JSON string from the National Weather Service Alerts and am encountering a problem where the code can't parse the value and the device auto-resets. I've used this code before ...
user3481929's user avatar
1 vote
1 answer
81 views

ArduinoJson reading `null` from Serial

I have a setup that reads from serial when I sense that there is something to be read (and always assume that what is sent to the arduino is valid json): void setup(){ Serial.begin(9600); ...
Snappawapa's user avatar
1 vote
1 answer
95 views

How to add one JsonDocument to another in ArduinoJson

I'm utilizing this json library: https://arduinojson.org/ I am attempting to write a function that creates a response object, and wraps an already built json document: void sendResponse( ...
Snappawapa's user avatar
2 votes
0 answers
91 views

Using HTTPClient with ESP not working

I have a program running on an esp8266 that attempts to fetch json data from an HTTPS endpoint that is hosted on aws amplify (data comes from a next.js app). I can retrieve the data correctly when I ...
seddouguim's user avatar
1 vote
0 answers
41 views

esp8266 r1 mini stops serial print during execution

The setup includes an WEMOS/ESP8266 R1 mini compatible board, a DHT11, a photo resistor and a magnetic reed. The libs used are: #include <ESP8266WiFi.h> #include <PubSubClient.h> #include &...
thermike's user avatar
3 votes
1 answer
536 views

how to transfer json to string?

I am getting a json object from aws iot MQTT. Assuming that json from aws is {status:opened}. Here is my code. #include <ArduinoJson.h> void messageHandler(char *topic, byte *payload, unsigned ...
Jess's user avatar
  • 53
-1 votes
1 answer
273 views

Best way to get JSON from struct vector class

I have a vector which consist of a struct, see below: struct FileInformation { String name; size_t filesize; }; std::vector<FileInformation> FileInformations; How do I get JSON ...
test's user avatar
  • 11
0 votes
1 answer
435 views

How to allow cross-domain requests with ESP8266WebServer.h ? - CORS policy: Access-Control-Allow-Origin

With an nodeMCUv2 I want: to start a wifi server with ESP8266WebServer.h serve a root html page which will interact with the ESP and fetch external data Issue: CORS policy: No 'Access-Control-Allow-...
user2718593's user avatar
0 votes
2 answers
455 views

ArduinoJSON :: How to determine Array's size in a DOC conatinaing not only Arrays

Parameter file containing MQTT topics as shown below, is read into StaticJsonDocument<1250> DOC variable. Size of some groups may differ between MCU's, for example sub_topics_win may contain ...
guyd's user avatar
  • 993
1 vote
0 answers
87 views

Inconsistant compilation error

It is s a bit complicated to ask such question, but what may be the reason that one time compilation passes and other fails without any changes in code? surely debugging this way is very hard (one ...
guyd's user avatar
  • 993
0 votes
1 answer
206 views

Determining ArduinoJSON document size based on file size

I'm trying to effectively allocate a doc's size, based on the size of the file saved in flash of ESP8266. Is there a way? For example: file.size() X 1.5
guyd's user avatar
  • 993
1 vote
1 answer
1k views

Arduino create Json Array with double values and 2 decimal point

How i can create a Json Array with double values and 2 decimal point using the ArduinoJson Library? https://arduinojson.org/v6/how-to/configure-the-serialization-of-floats/ In the folowing small ...
Carlos Costa's user avatar
-1 votes
1 answer
746 views

Use of ESPAsyncWebServer.h with ArduinoJson version 6 for Master-Client transactions

I want to communicate two (2) ESP32's via Json commands using ESPAsyncWeb.h. The master should have specific operations to execute and respond to the client, and the client should be able to send ...
Ed Zamper's user avatar
1 vote
1 answer
191 views

Reading & writing a configuration file on an Adafruit Circuit Playground Express

I would like to store an application's configuration in a file stored on the Circuit Playground Express (CPX) flash. The application itself needs to be able to update the configuration file. Things I ...
user3308886's user avatar
1 vote
1 answer
911 views

How to convert serialized JSON string back to JSON object?

How to convert JSON String for example {"f0":100,"f1":100,"f2":100} It is what I get from my esp01 side from I2C communication Now I want it to get it back to my Arduino ...
Avon97's user avatar
  • 161
0 votes
1 answer
1k views

Parsing JSON response from Stream

I want to parse JSON response from a GET Request. I do this usually by using a String variable to store the response and later parse this string using ArduinoJSON library like shown below: #include &...
Zaffresky's user avatar
  • 183
2 votes
2 answers
219 views

ArduinoJson library parsing error

I am trying to retrieve JSON mqtt message I received in ESP32. void mqttMsgCallback(char* topic, byte* payload, unsigned int length) { payload[length] = '\0'; String _message = String((char*)...
Abhishek bhatia's user avatar
1 vote
2 answers
2k views

Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1)

Heres my code: #include <WiFi.h> #include <HTTPClient.h> #include <ArduinoJson.h> const char* ssid = "wifiSSID"; const char* password = "wifiPassword"; int ...
TerThesz's user avatar
1 vote
1 answer
592 views

Custom library for Arduino to encode and decode JSON Web Tokens

So I have been recently been trying to create a library for Arduino to encode and decode JSON Web tokens(JWT) using HMAC-SHA256. For those unfamiliar, JWT has 3 parts - The header, body and signature....
Flight64's user avatar
1 vote
1 answer
52 views

ESP8266 AutoConnect ACSelect selection index

I'm trying to retrieve the current selected/saved index of my AutoConnectSelect Right now i'm creating a type that reads the saved json: AutoConnectSelect& bright = settingsAux["...
Boyfinn's user avatar
  • 95
1 vote
1 answer
351 views

How to properly handle the Arduino String

I've read that the Arduino String is bad as it causes memory fragmentation, so I try to avoid them mostly. But I still have some occurences where I'm not quite sure if they are ok after all. The first ...
matthesinator's user avatar
1 vote
0 answers
60 views

How to set maximal execution time of operation

I'm JSON deserializing output from ESP8266 in my Arduino UNO, but when it fails (for some reason every time after it deserializes successfully) the program lags for few seconds and I don't want that ...
krystof18's user avatar
  • 315
3 votes
1 answer
5k views

Getting all data of my JSON object from Serial.read() at once

I'm new to Arduino and I'm building a project that fetches data from a website (using ESP8266) and then transfers them to my Arduino UNO via serial port. Data coming from ESP8266 every 20s - [{"x&...
krystof18's user avatar
  • 315
1 vote
1 answer
2k views

ESP8266 Arduino Json object array deserialisation into struct

I'm trying to de serialize an array of JSON objects into a struct. Following the instructions given by the Arduino JSON assistant, I managed to produce this helper function: void JsonPreprocessor(...
Boyfinn's user avatar
  • 95
1 vote
0 answers
59 views

Changing the order of GUI-elements inside Arduino ESP-Dash-library

I'm trying to add a new item "index" to GUI-elements that are created by using ArduinoJSON and the Vue.js-framework inside the ESP-Dash-library. The library creates GUI-elements like buttons,...
StefanL38's user avatar
0 votes
1 answer
530 views

Remove unwanted characters from char type

I'm working on an ESP8266 module that needs to fetch date data from worldtimeapi, everything works fine but the problem is How do I strip of the time field off the datetime JSON response without loop. ...
Ruby's user avatar
  • 15
1 vote
0 answers
82 views

JSON Parser fails because number of bytes is being sent

Sorry I am new with this. I am trying to read a JSON response from my website using an ESP8266, but it keeps failing. I am using the following code: WiFiClientSecure httpsClient; //Declare object ...
Dan's user avatar
  • 19
0 votes
1 answer
418 views

How to get a specific value from an unknown number of JSON representations?

I am using ArduinoJson and ESP8266HTTPClient. Say I have a DynamicJsonDocument that has an unknown number of entries with information on different persons: [ { "ID": "12345&...
choreley's user avatar
3 votes
2 answers
210 views

Understanding ArduinoJson capacity calculation assistant

I am trying to figure out how ArduinoJson capacity can be calculated, therefore I came by the Assistant web application developed by the developer of the library https://arduinojson.org/v6/assistant/ ...
Mohammed Noureldin's user avatar
0 votes
1 answer
279 views

ArduinoJSON define as extern

My sketch contains 2 .h files. one defines on 1st .h file: #define JSON_SIZE_IOT 400 #define JSON_SIZE_SKETCH 300 StaticJsonDocument<JSON_SIZE_IOT> paramJSON; StaticJsonDocument<...
guyd's user avatar
  • 993
2 votes
1 answer
133 views

RFID reading function returning null

I have a function that reads an RFID card and returns the RFID string. The function reads thr string well but I am using the ArduinoJson library to generate json. This is the function that I am using ...
Enver Pasha's user avatar
1 vote
2 answers
514 views

Unexplained behavior of char array after using `deserializeJson`

I'm using RF24 library to send messages between 2 MCU's : 1) ESP8266 (no Wifi, same code can be compiled to any Arduino board) 2) pro-Micro. Message is sent in JSON format, while using ArduinoJSON ...
guyd's user avatar
  • 993
2 votes
0 answers
2k views

Reading JSON from Arduino over serial in python and writing to a JSON file on computer

I'm fairly new to Arduino so I used a sample code before integrating this into my main code. I'm printing my value in a JSON format over serial. My Arduino outputs this and the python receives this ...
Mike's user avatar
  • 21
0 votes
1 answer
542 views

Reading and Writing to a JSON File on the Desktop from Arduino?

I'm fairly new to Arduino. I'm working on a project where I'm making HTTP requests using a python code and this lets me read and write to a JSON file on my desktop. I have an Arduino with sensors that ...
Mike's user avatar
  • 21
1 vote
1 answer
305 views

cant read json data esp 32 “parseObject() failed”

hello I am just trying to make Youtube Subscribe Counter with led matrix 32*8 and esp 32 and I had this problem when I trying to get subscribers to count so what is the problem and how I can fix it? `...
 abdalrahmanabs's user avatar
-1 votes
1 answer
156 views

ArduinoJson is not adding string to JsonObject. ArduinoJson broken?

So I've got this code String GetTimeString(){ strftime(dateArray, 100, dateFormat, getTimeInfo()); dateString = String(dateArray); Serial.println(dateString); return ...
A.Rowan's user avatar
  • 99
0 votes
1 answer
3k views

Reading a json file from SPIFFS and displaying the info it contains on an embedded web page

I am working on a smart IR receiver that reads an IR signal, decodes it and saves that decoded info in a json file stored on the NodeMCU's SPIFFS. This info is then displayed on the embedded web ...
Mo'men Alaswad's user avatar
-2 votes
1 answer
3k views

What is the maximum size of Static Json Document in Arduino JSON?

I'm trying to do serial communication between Arduino mega and a esp8266, and having issues with determining the size of the JSON document. I have read that the receiver buffer size should be greater ...
Binara Medawatta's user avatar
1 vote
1 answer
473 views

How send method POST with JSON? Arduino UNO R3 + SIM900

Why is the server side of php not loading any data from arduino? What did I do wrong? String reading="{\"latitude\": 12.983027, \"longitude\": 80.2594}"; mySerial.println("AT+HTTPINIT"); ...
wgerro's user avatar
  • 51
1 vote
0 answers
662 views

Edit JSON File on SD Card

I am currently Working on a project, where I save values in a JSON File on an SD Card. The JSON looks something like this: { "ID1":{[[starttime, endtime], [starttime, endtime], [....
Markus's user avatar
  • 11
2 votes
1 answer
242 views

How to get full response json SIM900 + Arduino?

void toSerial(int delay_ms) { delay(delay_ms); while(mySerial.available()) { Serial.write(mySerial.read()); } } Serial.begin(9600); mySerial.begin(9600); mySerial....
wgerro's user avatar
  • 51
1 vote
1 answer
144 views

Large number into variable

Probably something easy but I’ve not resolved it. I’m extracting data from a JSON string and all the values are correct accept for two. They are referring to two date time values and are in ...
Lifesigns's user avatar
1 vote
2 answers
545 views

WiFi.begin doesn't work with ArduinoJson's const char* output

I'm using ArduinoJson to parse a file full of JSON strings that contain the SSID and password for the registered networks. I have a little web interface that runs in soft AP mode so you can scan for ...
CurieOS's user avatar
  • 21
1 vote
1 answer
992 views

Serialize JSON as response to HTTP request

I'd like my ESP8266 to provide some JSON endpoints. I want to use ArduinoJson for serialisation. While this works in general if I serialize into a String and return this String afterwards, I was ...
Nitek's user avatar
  • 123
1 vote
1 answer
792 views

json format in esp32 with arduino json

I am using an ESP32 module for bluetooth connection and scaning wifi network. But I cannot format the json using arduinojson library in the way I want. void scanWifiNetworks() { //creating json ...
sdebarun's user avatar
1 vote
1 answer
4k views

publish json data to mqtt

I am trying to publish JSON data to mqtt with following code snippet #include <Arduino_JSON.h> JSONVar data; data["temperature"] = temperature; data["humidity"] = humidity; data["pressure"] = ...
rp346's user avatar
  • 113
0 votes
1 answer
5k views

Serial communication from Arduino to ESP8266 NodeMCU works, but from NodeMCU to Arduino isn't working

My circuit connection is like: (I am following this tutorial) Code uploaded to Arduino: #include <SoftwareSerial.h> #include <ArduinoJson.h> SoftwareSerial s(5,6); void setup() { s....
partho's user avatar
  • 101
1 vote
0 answers
2k views

How to send JSON on a http POST request using an ESP8266?

I'm working on a project aimed on sending alerts via SMS. I signed up for a SMS service that works via HTTP requests (REST standard). I need, then, to send data as JSON, so that their server processes ...
Saint-Clair's user avatar
0 votes
1 answer
534 views

Second item in array not gets assigned from struct object, ArduinoJson

I got the below code generated this amazing tool. const size_t capacity = JSON_ARRAY_SIZE(2) + JSON_OBJECT_SIZE(1) + JSON_OBJECT_SIZE(4) + 2*JSON_OBJECT_SIZE(7); DynamicJsonDocument doc(capacity); ...
Anum Sheraz's user avatar
0 votes
1 answer
688 views

Can't Compile .ino using ArduinoJson Library

I am using an ESP32 NodeMCU for which I wrote working software before. This also occurs when I just try to compile without uploading, so no hardware problem. I am using the newest version of ...
Michael Santos's user avatar