-
I have set a stream in my setup: and I have this in my loop:
and this is in my callback which updates the value of feedOn from rtdb.
EXPLANATION: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
Which device you are using? Did you understand your device memory architecture? Have you check your device free memory and estimate the size of your detabase data under the root (by export or download) and is it proper for your device to handle? If you use ESP8266, do you understand how And did you see this, and do you understand it? FirebaseClient/examples/RealtimeDatabase/Async/Get/Get.ino Lines 98 to 101 in edcb444 |
Beta Was this translation helpful? Give feedback.
-
Nobody streams or listen to the data at the root even in web or the Firebase SDK client app that runs in mobile device that has unlimited memory. You have to redesign your code and think of small data and speed. I don't want to teach you but you have to learn by yourself. You are actually new to Firebase. Please keep in mine that Firebase does not design for embedded device. Your device memory is limited and you have to manage. |
Beta Was this translation helpful? Give feedback.
-
Your device may have available memory nearly 200k that is large enough for your whole database data. If you notice that, once the stream connected, all data under the streaming path will be received on the payload because it is actually the response from HTTP GET request. After it was connected, the small data based on the database data changes called event-data will be received. If the buffer (String object) that needed to store this response payload fail to allocate memory, the stream data to be processed will be invalid and stream operation will fail and run into unknown situation with no error. You can check the maximum heap size that can be allocated in case heap fragmentation from dynamic memory allocation in the code or in library.
We cannot do this all the time to estimate how big of data to be streamed, then keep your stream data as small as possible and data that being stream should not grow up. |
Beta Was this translation helpful? Give feedback.
I figure it out now sir
I used the the same AsyncClientClass in my stream and Database.set<>() thats why my callback doesnt response. I changed my AClientClass in my stream and its working now