Comments (10)
@conorlap On my side I have tested everything flawlessly. I think we have to wait for @fuatakgun now.
from eufy-security-ws.
I cannot follow this statement
I've set-up a script in Home Assistant that calls 'start_livestream' targeted at my Eufy 2k Wired doorbell, however most of the time when I trigger this script I get the below error in bropat/eufy-security-ws logs:
because the error LivestreamNotRunningError
is only triggered if you try to stop the livestream from a websocket client connection that has not executed a start livestream command:
To understand exactly what is happening, you have to activate the debug mode of eufy-security-ws. This is activated by setting the DEBUG variable:
https://github.com/bropat/eufy-security-ws#docker
in fact I've noticed that the doorbell seems to automatically start streaming as soon as bropat/eufy-security-ws is started
eufy-security-ws starts the stream ONLY on request. There is no automatism.
I think the problem lies in the client-side implementation:
And maybe the rest too.
from eufy-security-ws.
I've sent you the log files via Home Assistant forum PM.
Please note I am in BST timezone but the logs are reporting GMT time, so I've set my times back 1 hour below. The below two scenarios relate to the two separate log files I sent you.
Scenario 1:
8.02pm - the stream works after restarting Home Assistant & Eufy Security dockers and I call Eufy Security: Start Live Stream over P2P within Home Assistant
8.08pm - automatically stops streaming
8.10pm - I try to trigger start live stream again, nothing happens.
8.11pm - I send Eufy Security: Stop Live Stream over P2P command
30 seconds later: I sent start livestream command, nothing happens.
8.14pm - I sent livestream command, nothing happens.
Scenario 2:
8.34pm - the stream works after restarting home assistant & eufy security dockers and I call Eufy Security: Start Live Stream over P2P
30 seconds later: I call Eufy Security: Stop Live Stream over P2P, it looks like it stops for a split second then starts back.
Repeat the stop command a few times, still does not fully stop - the stream only seems to stop by itself after several minutes.
Also, regarding
I cannot follow this statement
I've set-up a script in Home Assistant that calls 'start_livestream' targeted at my Eufy 2k Wired doorbell, however most of the time when I trigger this script I get the below error in bropat/eufy-security-ws logs:
This was my mistake, I was calling stop livestream command - not start!
from eufy-security-ws.
Hi all,
When HA is starting up, integration is checking live stream state and if it is running, it sends a message as start_livestream
so that it can get video chunks.
Live stream can be started independent of HA, it can be always up and running independent of HA. I see some cases users are recording to NAS, so it is always running but this was an example of RTSP, not sure if it is possible with P2P.
So, back to story, if a client (this can be HA or mobile app) initiated a p2p live stream, it can only be stopped by initiator.
When you get this error, it means something else started it.
@bropat what is the correct way to identify clients triggered start events? Can we inform user on this?
from eufy-security-ws.
One thing to add; if you enable preload stream
on HA, it will try to start streaming automatically when HA is starting up, but you should be able to stop it because you are the initiator client here.
from eufy-security-ws.
I'll explain it better with an example.
Preface:
- There are 4 clients that are connected via the websocket interface.
- All of them start/stop the livestream of the same device.
Example:
- Client 1 has started the livestream, this leads to the effective start of the p2p livestream
- Client 2 has started the livestream, the livestream is already running, so this client only receives the start event and the events of the video/audio data.
- Client 3 tries to stop the livestream and since it has never executed a start livestream, it receives the error
LivestreamNotRunningError
. - Client 4 starts the livestream (same as point 2).
- Client 4 stops the livestream. Since other clients have started the same livestream, it receives the stop event and no more video/audio data, but the actual p2p livestream is not stopped.
- Client 1 loses the websocket connection. As another client has started the same livestream, the p2p stream continues (if this was the last client to start the livestream, the p2p stream would effectively be stopped).
- Client 2 stops the livestream and since it is the last client that started the same livestream, the p2p livestream is effectively stopped.
from eufy-security-ws.
One thing to add; if you enable
preload stream
on HA, it will try to start streaming automatically when HA is starting up, but you should be able to stop it because you are the initiator client here.
I don't have preload stream
enabled.
I notice that if I open the Home Assistant app (Android), and call the stop stream service it stops the feed - but only for approx 8-10 seconds before automatically starting it again. I also called the service from my browser (macOS/Firefox) on my laptop while viewing the Android app dashboard (where all my lovelace cards are etc) and it stops it for 8-10 seconds before automatically starting it again.
However, on my laptop web browser, if I call the Eufy Security: Stop Live Stream over P2P
service and then go back to my dashboard it seems to instantly start the feed again with no 8-10 second delay. Same result if I call the stop live stream service from my Android app - as long as the dashboard is in focus on the laptop web browser, it seems to automatically re-start the stream instantly with no 8-10 second delay.
After a few minutes the stream stops and then cannot be triggered again with the Eufy Security: Start Live Stream over P2P
service command. When this happens, the only way I can get a live stream video feed again is by restarting @bropat 's docker container.
from eufy-security-ws.
@conorlap Try version 0.4.2 and let me know.
from eufy-security-ws.
Getting the following error from @fuatakgun 's HA integration in the HA logs:
2021-08-19 17:19:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.0.22 for eufy_security
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/eufy_security/__init__.py", line 44, in async_setup_entry
await coordinator.initialize_ws()
File "/config/custom_components/eufy_security/coordinator.py", line 94, in initialize_ws
raise Exception("Start Listening was not completed in timely manner")
Exception: Start Listening was not completed in timely manner
from eufy-security-ws.
I did a second restart of Home Assistant container and it worked when I triggered start livestream, but as soon as I triggered the stop livestream it crashed - it's saying it's Streaming - p2p
under state in HA but the bropat docker gives the following:
2021-08-19 17:16:06.458 ERROR Message error
LivestreamNotRunningError Livestream for device T8200N00XXXXXXX could not be stopped, because it is not running
details:
{
name: 'LivestreamNotRunningError'
�������
m
error stack:
• message_handler.ts:145 handle
src/lib/device/message_handler.ts:145:31
• server.ts:46 device
src/lib/server.ts:46:34
• server.ts:98 receiveMessage
src/lib/server.ts:98:58
• server.ts:57 <anonymous>
src/lib/server.ts:57:53
• events.js:400 emit
events.js:400:28
• websocket.js:1009 receiverOnMessage
node_modules/ws/lib/websocket.js:1009:20
• events.js:400 emit
events.js:400:28
• receiver.js:522 dataMessage
node_modules/ws/lib/receiver.js:522:14
• receiver.js:440 getData
node_modules/ws/lib/receiver.js:440:17
• receiver.js:148 startLoop
node_modules/ws/lib/receiver.js:148:22
While aler9/rtsp-simple-server
container gives the following in logs:
2021/08/19 17:16:05 I [1/1] [RTSP] [conn 192.168.0.22:43180] ERR: read tcp 192.168.0.22:8554->192.168.0.22:43180: i/o timeout
2021/08/19 17:16:05 I [0/0] [RTSP] [conn 192.168.0.22:43180] closed
2021/08/19 17:16:05 I [0/0] [RTSP] [conn 192.168.0.22:43282] closed
2021/08/19 17:16:05 I [0/0] [RTSP] [session 146959958] closed
2021/08/19 17:16:05 I [0/0] [path eufy_security-T8200N00XXXXXXX] destroyed
2021/08/19 17:16:05 I [0/0] [RTSP] [session 613266367] closed
2021/08/19 17:16:06 I [0/0] [RTSP] [conn 192.168.0.22:43292] opened
2021/08/19 17:16:06 I [0/0] [path eufy_security-T8200N00XXXXXXX] created
2021/08/19 17:16:06 I [0/0] [RTSP] [conn 192.168.0.22:43292] ERR: no one is publishing to path 'eufy_security-T8200N0020080003'
2021/08/19 17:16:06 I [0/0] [RTSP] [conn 192.168.0.22:43292] closed
from eufy-security-ws.
Related Issues (20)
- [Question:] When S350 will be added? HOT 2
- [Feature request]: T8506 Lock/Unlock HOT 3
- Home Assistant Add On crashes on boot. "Killed" HOT 1
- [Error]: DeviceNotFoundError: Device doesn't exists HOT 1
- [Bug]: S220 (T8134) battery drain: battery only lasts 24h HOT 1
- [Question]: On startup I get an ECONNREFUSED 0.0.0.0:443 HOT 1
- Dashboard
- [Bug]: When adding Homebase missing most functions. (Only noticed since having two Homebases S380 and Homebase 2 on same account) HOT 1
- [Question]: Why my Eufy not update picture camera (and doorbell) HOT 2
- [Question]: All address lookup tentatives failed HOT 2
- [Feature request]: T8520P smart lock Support HOT 3
- [Bug]: Error: read ECONNRESET - Client disconnected HOT 3
- [Bug]: S100(T84A1): getting/setting color properties raise error HOT 1
- [Bug]: HomeBase trigger alarm button stopped working HOT 2
- [Bug]: Push connection not initiated HOT 2
- Why doesn't it not work HOT 4
- [Feature request]: Support broadcast names in station lists HOT 1
- [Bug]: No device is found. Only the UPDATE configuration is showing up on the list of available devices HOT 1
- P2P stream never initializes on T8424 Floodlight HOT 1
- [Question]: Change Cameras to Home/Away HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eufy-security-ws.