Search code examples
firebasefirebase-realtime-databasearduinotimeout

How long can a Firebase Realtime Database connection stay alive as a stream?


I am building an IoT project with Firebase.

Everything works fine, but after some hours it gets disconnected.

I'm not sure if this is a network problem or a Firebase limit. So is there a limit of time that a stream can stay alive in Firebase Realtime Database?


Solution

  • It is expected that the connection may occasionally be reset from the server, either because of something between your client and the server, or because operations on the server.

    The Firebase SDKs will normally handle this by reconnecting, and restoring their state on the new connection. Since the library you're using is based on the REST API, and not on an SDK, either that library or your application code will have to handle reconnecting after a connection reset.