Using RTDB and Firebase database in the sam time #224
Replies: 6 comments 5 replies
-
Szia, matehubert, |
Beta Was this translation helpful? Give feedback.
-
You can use the same This statement is not quite right.
The returning payload in case The change on server side depends on your data and function you used. You should use one You should leave Stream task running in its async queue in specific Another one |
Beta Was this translation helpful? Give feedback.
-
The memory option should be set too. If you are using You should set lower buffer size to gain more Heap like this. FirebaseClient/examples/RealtimeDatabase/Async/Callback/Stream/Stream.ino Lines 106 to 107 in 697044a |
Beta Was this translation helpful? Give feedback.
-
You said that you never set the buffer size in ESP8266 WiFiClientSecure which is not possible to get two SSL clients run simultaneously. No matter which library you used e.g. Firebase, HTTP client and MQTT client, you can't get more than one SSL client to work without adjusting the BearSSL buffer size. After you set the BearSSL buffer size lower, you can run two or more SSL clients simultaneously by keeping the TCP session alive with the MMU option 3, 16KB cache + 48KB IRAM and 2nd Heap (shared). The free heap available in your application is too low, only 8k which leads to system task failure and wdt reset crashed. It should have at least 10k free memory. You have to manage your memory usage in your application. |
Beta Was this translation helpful? Give feedback.
-
You should remove your code for printing any large payload as it causes stack overflow too. It should be noted that you don't have enough memory to adapt your Firestore code in your application because of limited memory nearly 30k with blank sketch. I often said about this in the old Firebase library about the risk of ESP8266 when works with Firestore which its payload required large buffer memory to handle. You should consider using ESP32 or RaspberryPi Zero W or Arduino MKR devices. |
Beta Was this translation helpful? Give feedback.
-
Dear Mobizt! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Mobizt,
Thank you for you library!
I want to use two services simultaneously: Realtime Database (RTDB) and the standard Firestore Database.
Short Description of the Program:
The system collects data from two sensors and displays the values on a screen. A Cloud Function, triggered by a button press from a Flutter app, creates an entry in the /sync node of RTDB, which the WEMOS listens to. When a new entry appears, the WEMOS writes the current sensor values into it.
At the same time, every 5 minutes, the system should upload the current sensor data to the Firestore Database.
The Problem:
For some reason, uploading data to Firestore is not working. When the system attempts to upload the sensor data to Firestore, I get the following error:
🔥 Firebase inicializálás...
SSL konfiguráció: setInsecure() called.
✅ Async event (UID: authTask): Code=7 - authenticating
ℹ️ Async callback: no more message.
✅ Async event (UID: authTask): Code=8 - auth request sent
⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...⏳ Firebase auth...✅ Async event (UID: authTask): Code=9 - auth response received
✅ Async event (UID: authTask): Code=10 - ready
✅ Firebase auth ready!
⚠️ Stream callback: Empty message received.
✅ Firestore ready!
🔍 RTDB Stream Listening: /sync
✅ Firebase ready!
🔑 Token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjBjYmJiZDI2NjNhY2U4OTU4YTFhOTY4ZmZjNDQxN2U4MDEyYmVmYmUiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vYXF1YXRoZXJtbzEiLCJhdWQiOiJhcXVhdGhlcm1vMSIsImF1dGhfdGltZSI6MTczOTkwNDg2MywidXNlcl9pZCI6IkFhUGpPb2dzczRlQXVzV2N2YmNLcjdFSTUzSzIiLCJzdWIiOiJBYVBqT29nc3M0ZUF1c1djdmJjS3I3RUk1M0syIiwiaWF0IjoxNzM5OTA0ODYzLCJleHAiOjE3Mzk5MDg0NjMsImVtYWlsIjoibWF0ZXN6b2tvbEBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsibWF0ZXN6b2tvbEBnbWFpbC5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.TuiQ9WoWFnksc9IYvzK-2jQa8ptmjYyQPS8uNTm8pIVdH5kocs_Z7rRq6ZMXfkf6KawvuQdELQI_f4Md1AU8ajmuXKHD4bn7cTw_biMnIZT4ipTBBV0fnVo5T-m9JCfULVh15xG5Iv4BpwmTPYsC_ESXdf-ZGlOwwyB_d84dP8I0LzuA1JHhJGH6cF1mnwvujwsSbDKy3Bif4WHwJ9mL8D39syZA6bwfNJheS_Yn9QKsAEjTIM_hkxi6s-zrPdHh179reRNvmeivLkC2vweav9p0dMvXVRXIwdXSCxJpuTxVUb4KZOQPurtIbbzkQxOX0CoRjicxCS1ZmNb0bqiZOA
⏳ TTL: 3299
🔹 Setup ready.
💾 Szabad heap memória: 13952 bajt
RTDB stream stopped.
❌ Firestore upload failed: TCP connection failed
✅ Firestore: Upload successful.
📄 Measurement uploaded: timestamp: 2025-02-18T19:54:36Z, internalTemp: 21.7, externalTemp: 0.0, humidity: 0.0
RTDB stream restarted.
Meanwhile, RTDB is working perfectly without any issues.
It shows it uploaded but it doesnt(wrong debug handle)
What Could Be the Issue?
I have already checked everything, tested different solutions, and even asked various AI models, but I still can't solve it.
This is the code:
Any help would be greatly appreciated! Thank you!
Beta Was this translation helpful? Give feedback.
All reactions