bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.
MIT License
185 stars 30 forks source link

[Bug]: Stream in HA can only be started once #274

Closed marcokitzmann closed 9 months ago

marcokitzmann commented 1 year ago

Version

1.7.1

Node version

?

Operating System type

Other

Operating system version

Home Assistant OS 11.1

Describe the bug

After upgrading from Homebase 2 to 3, each camera stream can only be started once. After that, addon eufy-security-ws and integration eufy_security have to be restarted to work again. After starting stream for a 2nd time in debug log appears the message "Received already processed sequence" (see log attached below)

To reproduce

  1. Start RTSP-Stream
  2. Watch Camera Stream
  3. Stop Stream
  4. Start Stream again
  5. Video-Player says "streams: wrong response on DESCRIBE" and stops

Screenshots & Logfiles

eufy-security-ws.log

Additional context

Eufy-Hardware:

2x 2C Pro Homebase 3 (S380)

I reported that issue also here: https://github.com/fuatakgun/eufy_security/issues/978 fuatakgun asked me to provide addon logs also here.

bropat commented 1 year ago

I looked at the log and could not find any problems. The entire P2P communication takes place via UDP (stateless protocol), whereby the same data packets are sent several times. The message "Received already processed sequence" is just the filtering away of packets that have already been processed. Livestreaming is actually only intended via P2P. Livestreaming via RTSP was a request from @fuatakgun and is actually just a hack, as it uses the P2P test command of the NAS configuration in the background (see NAS settings in the Eufy app). If this doesn't work now with the Homebase 3, there is nothing I can do as it probably depends on the firmware. Furthermore, I do not have a Homebase 3 to carry out further tests. As already mentioned, streaming via P2P should be used for live streaming.

fuatakgun commented 1 year ago

So, should we say one of these;

-it cannot be not supported with homebase3 or

bropat commented 1 year ago

It could easily be that the new firmware in the Homebase 3 does not allow the "NAS test" command to start the RTSP stream several times in a short period of time.

What I wanted to say before is the following:

  1. i don't think you should use this method to start the stream as it is less future proof. In the official app it was implemented as a test of the NAS configuration. In the future, this functionality could be limited (e.g.: duration of the active stream, number of calls to this functionality in a short time)
  2. i need a Homebase 3 to be able to say more precisely
marcokitzmann commented 1 year ago

Don't know if this Information is helpful - but what is working as a Workaround: turning the RTSP-Switch off and back on after each stream brings function back.

fuatakgun commented 1 year ago

Toogling the RTSP switch is actually imitating the initial rtsp setup via the app, so the device will stream for couple of minutes so you can test nas setup. But if you are actually recording this into a nas, turning it off might break the recording.

Maybe, you can share your device with bropat if he is available so he can validate what is going on (firmware issue, no more hack, etc)