Questions tagged [json]

99 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
  • 1
  • 4
  • 14
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
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
  • 1,049
  • 2
  • 26
  • 61
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,486
  • 14
  • 28
2
votes
1 answer

ESP32 webserver with a loaded page fails to update data in elements after sending an Json file, the Json data is printed instead of the loaded page

I have a ESP32 with a web server. In the page where I show the sensor readings and the state of the system, right now the readings are showing themselves well. The problem comes when I want to show the state of the system. Right now I'm testing the…
vram
  • 31
  • 3
2
votes
1 answer

ArduinoJson- unexplained '.size()' behaviour

I'm using an ESP8266, ArduinoJson v6.21.5. PlatformIO, and Vscode. The config file is saved and read correctly to the ESP8266's flash: { "gen_pubTopic": [ "DvirHome/Messages", "DvirHome/log", "DvirHome/debug" ], …
guyd
  • 1,049
  • 2
  • 26
  • 61
2
votes
0 answers

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 use WifiClient alone, but when I want to use…
seddouguim
  • 121
  • 2
2
votes
2 answers

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 the 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
  • 1
  • 2
2
votes
1 answer

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.println("AT+HTTPINIT"); toSerial(500); …
wgerro
  • 51
  • 3
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
  • 1,049
  • 2
  • 26
  • 61
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
1
2 3 4 5 6 7