mobizt / Firebase-ESP32

[DEPRECATED]🔥 Firebase RTDB Arduino Library for ESP32. The complete, fast, secured and reliable Firebase Arduino client library that supports CRUD (create, read, update, delete) and Stream operations.
MIT License
415 stars 118 forks source link

BUG #50

Closed fervenceslau closed 4 years ago

fervenceslau commented 4 years ago

Describe the bug Error when trying to send double data to firebase through a json object: "bad request, Invalid data; couldn't parse JSON object. Are you sending a JSON object with valid key names?".

This happens when I try to send a double value of 0.

Printing the json object I see that the sensor data (double) is being displayed as "0." when this error occurs. Whenever I set some other value to this sensor different than 0, e.g. 0.1, everything works fine...

To Reproduce FirebaseJson json; double doubleVariable = 0;

json.set(pathVariable, doubleVariable);

if (!Firebase.updateNode(gFirebaseData, path, json)) { Serial.println(gFirebaseData.errorReason()); return false; }

IDE and its version:

ESP32 Arduino Core SDK version

FirebaseESP32 version

FirebaseJson version

mobizt commented 4 years ago

Thanks for report this.

The bug is in double to string conversion of FirebaseJson library.

I will fix it and update soon.

mobizt commented 4 years ago

Now the library was update with bug fixed.