Questions tagged [json]

89 questions
3
votes
1 answer

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 void messageHandler(char *topic, byte *payload, unsigned int length) { StaticJsonDocument<32> doc; …
Jess
  • 53
  • 2
3
votes
1 answer

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": 0,"y": 0,"rgb": [255, 200, 174]},{"x": 1,"y":…
krystof18
  • 315
  • 4
  • 10
3
votes
2 answers

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/ Here what I do not understand is, why when I use…
3
votes
2 answers

Serial data affected by interrupt

In my recent project, I have done everything means capture serial data and split it out in proper form. Until now everything is fine. But when I add another portion of code which contains Interrupt. Now, whenever Interrupt come into the picture, my…
Hasan
  • 1,468
  • 13
  • 27
2
votes
1 answer

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*)payload); String _topic = String(topic); …
2
votes
1 answer

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 to read RFID cards: String rfidOku() { String…
2
votes
0 answers

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 and prints it in the same format { "value" :…
Mike
  • 21
  • 2
2
votes
0 answers

ArduinoJSON v6 - return a StaticJsonDocument from a function

I'm reading a stored JSON file from an ESP8266. I wish to return it as a StaticJsonDocument for further use. return it at the end of function was done OK, but I need to assign it for document. #include #include "FS.h" #define…
guyd
  • 898
  • 1
  • 13
  • 39
2
votes
1 answer

ArduinoJSON v6 - Passing buffer as function parameter

I'm new to ArduinoJSON - so perhaps it is a newbie's question.... but I wish to pass a StaticJsonDocument into a function as a parameter ( later on it should be implemented in a library ). exmaple below shows test_1 what I wish to obtain, but by…
guyd
  • 898
  • 1
  • 13
  • 39
2
votes
0 answers

Reducing json upload time

I'm using an ESP32 WROOM board to capture some data in the field and send it over using arduino json. However, the complete process of sending and receiving confirmation takes up around 12 seconds and my ESP is frozen in that time. As a result, I…
2
votes
2 answers

NodeMCU (Arduino IDE) 'DynamicJsonBuffer' was not declared in this scope

#include #include #include #include #include #define USE_SERIAL Serial ESP8266WiFiMulti WiFiMulti; String url = "http://192.168.31.170/api/mode/qwertyui"; void…
Adnan Sabbir
  • 23
  • 1
  • 1
  • 4
2
votes
1 answer

How to post JSON data from Arduino?

I want to post data that I'm getting from the sensor every 5 seconds to my application in JSON format. Initially, I'm getting data as int and converting into String. For example: if data=15, it is converting into string. String st=String(data); Now…
Anne Lingesh
  • 41
  • 1
  • 4
2
votes
0 answers

Convert String data To char Array in Arduino

I'm able to get json data and storing in String object, now i want to convert string into Char Array for parsing json data I'm tried with this code, but it is not responding String data = http.getString(); //Get the request response payload …
Anne Lingesh
  • 41
  • 1
  • 4
1
vote
0 answers

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 time commenting out one part of code seems to stop…
guyd
  • 898
  • 1
  • 13
  • 39
1
vote
1 answer

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 example it is possible to write to the Json file a…
1
2 3 4 5 6