FiveLeavesLeft / WyzeCameraLiveStream

Hack to allow live streaming from wyze cameras to vlc or mpv on your desktop.
MIT License
100 stars 7 forks source link

Stream disconnects when V3 is blocked from accessing the internet #11

Closed aechelon closed 3 years ago

aechelon commented 3 years ago

Not sure if this is specific to the streaming library but I've noticed that if I prevent the V3 from accessing the internet after about an hour the stream stops and I can no longer connect to it.

I can still ping the camera and it seems to continue to record to the SD card. If instead I allow the V3 to access the internet the stream seems to work indefinitely.

Is it possible to use the live stream and also keep the V3 off the internet?

FiveLeavesLeft commented 3 years ago

I turned off my internet access and I did see it stall but I was able to reconnect. It's not obvious why this is happening. If you enable export STREAM_HACK_OUTPUT=/tmp/stream_hack.log in the config file, it may print some messages.

aechelon commented 3 years ago

Thanks for testing! I'll try the debug log and report back. Out of curiosity, how long did it take it to stall? What firmware version are your running? I'm on the latest firmware and I suspect that the it's timing out somehow while attempting to connect to wyze's servers.

aechelon commented 3 years ago

I haven't grabbed the logs yet, but I tried moving the camera closer to my router and the problem disappeared. It looks like the issue is more prominent when the wifi connection is unstable while the camera has no internet access.
Is there a way to restart the stream periodically (say every few hours)? Maybe with a cron job?

aechelon commented 3 years ago

Looks like the issue was specific to Netgear Orbi access points. Switching the camera to a TP-Link access point resolved the issue. Stream is rock-solid for 2-3 days with Blue Iris + DeepStack after which it requires a reboot -- which is perfectly fine for my use case. Closing.

teredactle commented 3 years ago

@aechelon "Stream is rock-solid for 2-3 days with Blue Iris "

Hi, I was wondering what you consider rock-solid? If I look at BI, the disconnect issues I have are only with Wyze Cams. The 2 x WC3s have a boatload of disconnects, the 1 x WC2 with RTSP fw also (we all know this fw sucks with the sloppy RTSP implementation). The others except for 1 are also WIFI 2.4Ghz and no disconnects.

bi

So I'm just wondering what your NoSignal number is? The numbers I've attached are for a now around 36 hour period.

gtxaspec commented 3 years ago

RTSP has been rock solid for me, as well as NFS using wyzehacks. the Livestream has been good as well.

I can tell you, that ANY interference on the wifi channel that you experience will mess your stream up, even if only momentary, and it's not due to the camera or the software. these cameras are very sensitive on their radios.

I was not able to achieve success on the v2 or v3, until I got a dedicated router, and experimented with the channel setup.

just FYI.

On Fri, Jun 4, 2021, 1:30 PM teredactle @.***> wrote:

@aechelon https://github.com/aechelon "Stream is rock-solid for 2-3 days with Blue Iris "

Hi, I was wondering what you consider rock-solid? If I look at BI, the disconnect issues I have are only with Wyze Cams. The 2 x WC3s have a boatload of disconnects, the 1 x WC2 with RTSP fw also (we all know this fw sucks with the sloppy RTSP implementation). The others except for 1 are also WIFI 2.4Ghz and no disconnects.

[image: bi] https://user-images.githubusercontent.com/37247773/120859220-e6322180-c551-11eb-95fd-c0f4098bc68e.jpg

So I'm just wondering what your signal/disconnect number is?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FiveLeavesLeft/WyzeCameraLiveStream/issues/11#issuecomment-854982262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4N2SFHZLGXNB35G3X33OTTREZVTANCNFSM44WAQGKQ .

aechelon commented 3 years ago

I concur with @gtxaspec, the wifi on the V3's is sensitive.

I happened to have a cheap TP-Link N300 sitting around. I configured it in AP mode, patched it into a gigabit switch and connected the cameras to that on a dedicated wifi channel.
In this configuration with 2 x V3's I had 2 BI disconnects (both on the same camera) over a 5-day period. The IP traffic for the cameras is now also segregated from my main wifi network, which is a nice bonus.

I've since configured the v3's to reboot nightly to circumvent even those sporadic disconnect events.

teredactle commented 3 years ago

Well, i have to say, these are consumer cameras and the expectation is that I won't need to create special networks just to make a device run properly. People have all kinds of IOT stuff, and adding a camera shouldn't make one need to dedicate a router just to work as expected. So to me, if the radio is that sensitive, then it's a poor implementation/product.

Also, I find it interesting that while the stream (http) goes out from BI, if I'm watching it on the Wyze app, that app's stream is not affected. So either 1) it's an issue with BI and how it handles in particular Wyze Cam streams, or 2) it's an issue with the camera prioritizing the Wyze App stream, before any type of other stream RTSP/HTTP.

I don't believe it's a BI issue, as I have other RTSP cameras on wifi that don't have this issue at all, so to me it points to the Wyze cam, which is disappointing.

Having a dedicated router just for Wyze cams is just out of the question, I will just return them. Too bad, the starlight sensor is super nice as well as the FOV and I do like the new package as well.

@aechelon How are you getting the V3s to reboot on a schedule? Is it part of this firmware?

In a side note, the WC2s have a USB port. It's too bad the noone was able to create a firmware where it allow you to use a USB to RJ45 dongle on that port, essentially making the camera have wired capability.

aechelon commented 3 years ago

@teredactle, Auto Rebooting is documented in the original WyzeHacks readme.

Keep in mind that this LiveStream functionality is not new firmware. It's a hack that takes advantage of a hook in the existing video stream implementation. As such, your mileage may vary.

Someone had started working on uboot for the V3 and I suspect firmware with native RTSP support will come eventually.

For me the LiveStream is an adequate solution to keep my V3's from sitting on a shelf collecting dust while we wait for Wyze to release RTSP support as they had promised or until 3rd-party firmware becomes available.

I actually don't mind the extra access point. The benefit of segregating the camera's traffic out of my wifi network is worth the extra 5v@1A power draw. I might have gone that way even if connectivity wasn't an issue.

I have yet to find another outdoor-rated camera with decent optics, BI support, and such a small footprint at this price point.

teredactle commented 3 years ago

@aechelon I will take a look at the original docs for the reboot, thanks. "5v@1A power draw" which AP is this? I would like as little as possible additional electrical usage! Price wise, huge value that you can't find anywhere! Much agreed here!

These hacks are great, I am too hoping wyze will pony up RTSP fw soon, but I'm not sure if that will happen....we will see. Thanks

aechelon commented 3 years ago

@teredactle, I'm using a little TP-Link N300 I happened to have sitting around (also collecting dust next to the V3's I had purchased in anticipation for Wyze to release RTSP support).

teredactle commented 3 years ago

I'm using a little TP-Link N300 I happened to have sitting around

I think I have one of these I got for travel and never used it....