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

Stream stops working when delays are used #54

Closed itsmebasti closed 4 years ago

itsmebasti commented 4 years ago
  1. Run the stream_loop example.

  2. Change the loop method like this:

    • Remove the database update part
    • Add a delay(1000); to the bottom of the loop method.
  3. Rerun it and apply changes to the database manually.

The changes will never be noticed by the readStreammethod. The initial state is not even queried on the first loop.

Arduino IDE 1.8.10 ESP32 Dev Module

mobizt commented 4 years ago

That is normal behavior not for this library.

As in web server library, you need to allow stream to run freely without block code e.g. delay or some time consuming tasks.

You can set stream callback function to get the stream changes which stream call will run forever internally in RTOS task.