Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
2answers
432 views

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. ...
2
votes
1answer
3k views

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 ...
1
vote
2answers
7k views

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

#include <Arduino.h> #include <ESP8266WiFi.h> #include <ESP8266WiFiMulti.h> #include <ArduinoJson.h> #include <ESP8266HTTPClient.h> #define USE_SERIAL Serial ...
1
vote
1answer
168 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 ...
1
vote
1answer
812 views

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 ...
1
vote
1answer
212 views

Sending JSON message to web api via post. Why does HTTP 1.0 versus 1.1 make a difference?

I am sending a message to a web api call every xx seconds. I could not get it to work at all until I changed the header from HTTP 1.1 which is what I was using to HTTP 1.0. Then, it started working. ...
1
vote
2answers
69 views

Problem regarding getting split data of JSON - Another issue

In my recent project, I'm working with Arduino and JSON. I've successfully split the JSON data I want. My JSON data length is fixed. So, I used the length() function and I'm getting the length of my ...
1
vote
2answers
157 views

ArduinoJSON: Using a reference to a reference when parsing array of arrays

I started to play around with the ArduinoJson library to parse data I got from one of my APIs (the format of the JSON data I get from my API can be improved for sure, but the software I had to ...
1
vote
1answer
124 views

Arduino Uno with Adafruit CC3000

I am using Arduino Uno with Adafruit CC3000 wifi shield to connect to the internet and get data for Arduino. Everything works fine but I can't figure out how to use HttpClient library. The code is: #...
1
vote
1answer
6k views

How to pass JsonObject from ArduinoJson to ESP8266WebServer object?

I am learning the ArduinoJson.h library and creating jsonOject: JsonObject& prepareResponse(JsonBuffer& jsonBuffer) { JsonObject& root = jsonBuffer.createObject(); JsonArray& ...
1
vote
2answers
1k views

POST to server using ESP8266 module- Arduino Uno- AT+ commands

I'm trying to send a set of data in Json format to a server I have set up which has a specific URL and an access token. The server requires a POST command. So my final URL is: http://myurl.com/...
1
vote
0answers
68 views

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 ...
1
vote
2answers
745 views

Arduino WiFi Rev2 JSON String

I have been trying to use the WifiNINA library to access the JSON output from the following API using the WifiNINA library and the Arduino Wifi Rev2. This is the code that I have been using (it is an ...
1
vote
0answers
2k views

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....
0
votes
1answer
921 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"] = ...
0
votes
1answer
48 views

String class summation disappears the right operand

I intend to create a function to jsify sensors' content and save it on a SD-card or send through a http client. Except for the Serial.println's, the function is transcripted below. String jsonificar(...
0
votes
1answer
134 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 ...
0
votes
1answer
219 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); ...
0
votes
2answers
96 views

Firmware gets stuck at obj.printto(client) in esp32

I am using an ESP32 to capture some data and then sending it over using ArduinoJson. However, sometimes, the firmware gets stuck at the line where it is transmitting data at obj.printTo(client). I ...
0
votes
2answers
4k views

Reading file from SPIFFS in nodemcu using ArduinoJson

#include <ArduinoJson.h> #include <FS.h> /* Set these to desired credentials in runtime */ struct Config { String ssid = ""; String pass = ""; bool hFlag = false; }; void ...
0
votes
1answer
2k views

Arduino JSON foreach loop

I'm trying to extract values using ArduinoJson. The values aren't fixed, therefore I need to use the foreach loop. I'm trying this, but I can't seem to use the values like I could with. root["0"]["...
0
votes
1answer
288 views

Arduino parsing JSON

I have created an API in Ruby on Rails and it send the following JSON response: {"sun_position":{"altitude":"32.46","azimuth":"223.93"}} I'm able to successfully hit the API and store the response. ...
0
votes
1answer
136 views

Not able to add JSON data to Arduino data

In my recent project, I'm working with Arduino with JSON. I made software on JSON. Now, I want to send data from this software to my Arduino. Serial communication is done between Arduino and JSON. ...
0
votes
1answer
64 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 ...
0
votes
1answer
201 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 ...
0
votes
1answer
69 views

Global JsonObject (ArduinoJson)

I know a global JsonObject shouldn't be used, but I have my reasons. I have a JsonObject* functions and I want him to save the content of a file. With functions=new JsonObject(jsonBuffer.as<...
0
votes
1answer
978 views

How to interface MPU9250 and NodeMcu?

I am trying to send MPU sensor data to Pubnub IOT platform but not able to do it since there is some unknown problem. There is no error in code but following issue pops up in com port:- It looks like ...
0
votes
2answers
2k views

Parse a large json response with ESP8266

I'm doing a project where my Arduino uses an external ESP8266 wifi module (with AT firmware) to send http requests and receive server response. I'm trying to get an NBA scoreboard, and here's what my ...
0
votes
1answer
150 views

Which is a better? GPRS SIM800L or GPRS SIM900?

I will implementate the GPRS technologity in my Arduino project, but before buy the module, I want to know which is a better. If GPRS SIM800L or GPRS SIM900? My needs are send JSON array through POST ...
0
votes
1answer
525 views

ESP8266 SPIFFS not saving correctly?

Hey all I am having some issues with the SPIFFS for this Wemos D1 mini ESP8266 controller. This is my Arduino sketch: #include <FS.h> #include <ArduinoJson.h> struct RGBLA { uint8_t R;...
0
votes
1answer
184 views

Urgent need of help splitting a JSON formatted string received by UDP

I guess that my problems are because I'm new to C, but after spending three evenings without success I thought I'd give it a try to ask here! I receive a JSON-formatted string in a UDP message. It ...
0
votes
2answers
162 views

Data not updated in real time

In my recent project, working with JSON and Arduino. Till now, I am getting proper JSON data and add this one into Arduino data. But here I face one problem. My data are not updated in real time. For ...
0
votes
1answer
546 views

Possible ArduinoJson bug on ESP8266?

I'm making a small IOT project using the ESP8266 in which I make 2 API calls: api.openweathermap.org for weather data api.timezonedb.com The request logic is the same for both calls, the only ...
0
votes
2answers
2k views

How to get different parsed JSON data?

In my recent project, I have to parse incoming JSON data in Arduino and I successfully did it. But it is only for one constant data string. For example, if my incoming JSON string like: {"TPS":"0.40"...
0
votes
1answer
254 views

Parse an element that consists of an array using ArduinoJson [closed]

I want to parse an json element that consists of an "array". In this case solar->solardata->calculatedconditions->band[0-7] How can i do this? My attempt was: String data = root["solar"]["...
0
votes
1answer
454 views

How can I split data coming from JSON?

In my recent project, I'm working with Arduino and JSON. Now, I get data from JSON and I can able to receive in Arduino side. Below one is my Arduino code: #include<LiquidCrystal.h> ...
0
votes
0answers
40 views

Two way serial communication between arduino mega and NodeMCU

I'm trying to create an IoT device that will collect data from the sensors and display them in a mobile app, also let the user control the device using the mobile app. So I need to set up two-way ...
0
votes
1answer
52 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"); ...
0
votes
0answers
42 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], [....
0
votes
1answer
35 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....
0
votes
2answers
90 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 ...
0
votes
0answers
55 views

Error sending data too large for ESP8266

The code below I use it to send data to a server. However, if you add one more node to json postRequest, the serial will stop showing data and it will not be sent to the server. However, if I remove a ...
0
votes
0answers
122 views

Arduino uno wifi rev2 get json data from api

I'm not so familiar with Arduino UNO wifi rev2. I bought it for a project that I am working on. In general, I have a box that you can open with a code. The Arduino should make a call to the API and ...
0
votes
0answers
233 views

SPIFFS file append does not work when adding data in JSON format (ESP32. ArduinoJSON v1.6)

There is a file "/transact.txt", which stores the following data: { uid: 123456789 time_start: 2019-12-22 10:35:00 time_stop: } The challenge is to replace the contents of time_stop without ...
0
votes
1answer
1k 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....
0
votes
0answers
695 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 ...
0
votes
0answers
120 views

Can't print out a field with ArduinoJSON

I'm trying to create a command interpreter. Allowed commands are stored in a JSON document inside SPIFFS. If I send an allowed command, it doesn't print the field associated with that value (end of ...
0
votes
0answers
30 views

About split string

Sorry my English is poor. I use nodemcu to get a json data. By this String alldata = client.readString(); But it turn this: HTTP/1.1 200 OK Server: nginx Date: Sat, 10 Aug 2019 04:53:16 GMT ...
0
votes
0answers
502 views

How to get Json String from URL?

I want to get JSON string from a URL which goes like this https://maps.googleapis.com/maps/api/directions/json?origin=7649+Paseo+Santa+Cruz&destination=SJSU&key=MY_API_KEY and here is my ...
0
votes
0answers
378 views

ArduinoJSON v6- Add value to array

I have a JSON file stored in ESP8266, which I read need to add a value and save it back to file on ESP8266. I have an array at when saved at the first time as: JsonArray data = doc....