Skip to content

@mega-yfue/eufy-sdk / DEFAULT_KEEPALIVE_MS

Variable: DEFAULT_KEEPALIVE_MS

ts
const DEFAULT_KEEPALIVE_MS: 3000 = 3000;

How often the media start is re-issued to hold a stream open, when a caller expresses no preference.

This is on by default because some cameras stop sending without it. With the nudge disabled, a T8170 went quiet 13.6 s into a plain live() — no stop, no error, the feed simply stopped — and ran the full window with it on (185 frames vs 704 over 40 s).

Which cameras need it does not follow topology or power source, so there is no predicate to gate it on: measured across four cameras, an own-session T8410 and both HomeBase-attached cameras (T8210, T8114) held a 40 s stream up with the nudge disabled, while the own-session T8170 did not. All four are battery. Since a camera that needs it goes silent rather than reporting anything, the default covers the one that fails.

What the nudge costs differs by topology, and only one branch is a true keepalive: an own-session camera's startLiveMedia tracks that the stream is already started and sends the small ping, while a HomeBase-attached camera has no such state and re-sends the full media start — a genuine restart on that path.

That restart is harmless on a station serving ONE camera and harmful on a station serving several: it re-asserts this camera's channel every interval, so two attached streams contend continuously. Measured on a real base as a full start every 3 s from each. So an attached stream stops nudging as soon as the station delivers a frame of its own channel — see the private settleKeepalive. The measurement that justifies it is the one above: the attached cameras held their window with the nudge disabled outright.

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.