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

็HELP Firebase.pushJSON #228

Closed keecook closed 2 years ago

keecook commented 2 years ago

I'm using pushJSON with library version 3.16.1 but it doesn't work with error like this:

exit status 1 no matching function for call to 'FirebaseESP32::pushJSON(FirebaseData&, String&, String&)'

This is my Code: String jsonData = "{\"photo\":\"" + Photo2Base64() + "\"}"; String photoPath = "/photo"; Firebase.pushJSON(firebaseData, photoPath, jsonData);

I'm using with ESP32-CAM (AI Thinker ESP32-CAM version 1.0.5)

mobizt commented 2 years ago

You should check the documentation for the function description first. https://github.com/mobizt/Firebase-ESP32/tree/master/src#append-new-child-node-key-and-value-using-firebasejson-object-to-the-defined-database-path

keecook commented 2 years ago

Sorry, I don't know how to fix this problem. can you help me

mobizt commented 2 years ago

The type of third parameter of Firebase.pushJSON functon is FirebaseJson instead of String.

mobizt commented 2 years ago

For FirebaseJson, see this example for the usage.

Instead of convert the image data as base64 encoded string and store it to database, I recommend to store the data to file and use these functions to read data from file and store to database as base64 string.

The file functions above prevent large memory allocation for base64 encoded string which caused the low memory situation which may not enough for SSL client to work.

See these examples for how File functions work.

keecook commented 2 years ago

thank you very much I can fix this problem now. thank you for helping me