Comments (13)
First, try to edit library in this issue.
Try to push this string
String json = "{\"name\":\"iot4\",\"datetime\": \"2019/03/22 11\:27\:59\",\"accelX\": 0.067871,\"accelY\": -0.026367,\"accelZ\":-0.928223,\"temp\": 26.65,\"humid\": 93248.09}";
It should ok. If it's ok, check how you create json string e.g. from ArduinoJson object using printTo or create as string as above string.
Not recommend to include colon (:) i.e. 11:27:59 in database because it used as key/value separator in json object. I use escape character, back slash before colon (:) to make it can parse as :
from firebase-esp8266.
I use doc Arduinojson it is not a problem.
As I said I can send it if there is less characters
There is a limitation somewhere I need to bypass
from firebase-esp8266.
My library sends string as payload to server without any modification as I ask you to send json string of above post. If it works, the problem is in json object you created. You need to check the value you add to root and read it back.
from firebase-esp8266.
Can you show example code for me to test?
from firebase-esp8266.
from firebase-esp8266.
I mean instead of doing
char output[128]; serializeJson(doc, output); Firebase.pushJSON(firebaseData, "/data", output); }
from firebase-esp8266.
You need to assign macro ARDUINOJSON_USE_DOUBLE before include ArduinoJson.h like this
#define ARDUINOJSON_USE_DOUBLE 1
#include <ArduinoJson.h>
Here is the example to test
Try to push json data
DynamicJsonDocument doc(256);
double val1 = -0.00000001; //max 8 decimal places
double val2 = 321.12345678; //max 8 decimal places
doc["val1"] = val1;
doc["val2"] = val2;
char output[128];
memset(output, 0, 128);
serializeJson(doc, output);
Firebase.pushJSON(firebaseData, "/data", output);
Try to read json data back
Firebase.getJSON(firebaseData, "/data");
DynamicJsonDocument _doc(256);
deserializeJson(_doc, firebaseData.jsonData());
double _val1 = _doc["val1"];
double _val2 = _doc["val2"];
Serial.println(_val1,8);
Serial.println(_val2,8);
from firebase-esp8266.
It seems that you did not understood me or that I didn't explain well.
Everything is working fine, it was my fault
char output[128];
is not enough
char output[150];
is ok
I just asked if there is another way instead of going through a fixed buffer, perhaps using String
from firebase-esp8266.
I know as much as information you provide, the only part of your incompleted code then I need to build the basic test and extend the possibility to handle maximum decimal places for ArduinoJSON.
For String object it can because it has write function that ArduinoJson used for modify string.
String output="";
serializeJson(doc, output);
from firebase-esp8266.
thanks
from firebase-esp8266.
I got this error when I was trying to put that code:
no matching function for call to 'FirebaseESP32::pushJSON(FirebaseData&, StringSumHelper&, ArduinoJson::JsonObject&)'
from firebase-esp8266.
@Proxcentaur The library APIs were changed sofar.
You need to provide the FirebaseJson object to the pushJSON function.
For example.
FirebaseJson json;
json.add("data1",100); //add (new) data
json.set("data2/new", "test"); //set (replace or create new) the data
Firebase.pushJSON(firebaseData, "your_node_path", json);
from firebase-esp8266.
@Proxcentaur The library APIs were changed sofar.
You need to provide the FirebaseJson object to the pushJSON function.
For example.
FirebaseJson json; json.add("data1",100); //add (new) data json.set("data2/new", "test"); //set (replace or create new) the data Firebase.pushJSON(firebaseData, "your_node_path", json);
thank you, it works!
from firebase-esp8266.
Related Issues (20)
- ESP8266 is crashing while writing to firebase realtime database HOT 5
- soft wdt reset issue in esp8266 HOT 1
- I'm trying to read this data HOT 2
- WiFiClientSecure issue HOT 6
- Get Token status HOT 1
- issuse HOT 14
- BUG Token info: type = id token (GITKit token), status = on request HOT 1
- PLEASE HELP HOT 3
- [HELP] Cannot connect esp8266 and firebase. Compilation error: invalid conversion from 'int' to 'FirebaseConfig*' {aka 'firebase_cfg_t*'} [-fpermissive] HOT 1
- I've been getting a connection refused after a few seconds
- I've been getting a connection refused after a few seconds after connection to firebase HOT 1
- HELP : Executed HTTPS and connection Firebase HOT 2
- HELP :: captivePortal and firebase connection HOT 4
- BUG FirebaseESP8266.h with version @^4.4.12 of Library HOT 4
- FirebaseJson is confilcted with json inside ESP8266WebServer library HOT 6
- HELP
- Content Available for FCM_HTTPv1_JSON_Message HOT 1
- Unable to Fetch Data from Firebase
- Wi-Fi Reset Doesn't Initialize Firebase Variables and LED Status Doesn't Update Post-Reconnection HOT 6
- ERROR CODE: -3, REASON: NOT CONNECTED STREAM TIMED OUT, RESUMING... HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-esp8266.