docker-wyze-bridge icon indicating copy to clipboard operation
docker-wyze-bridge copied to clipboard

Performance issues with more than 3 cams

Open CB954 opened this issue 2 years ago • 18 comments

Anything more than 2 cams I start having performance issues with V3 cams. Anything past 3 cams the Wyze app won't connect to v3 cameras and when the rtsp stream works it is choppy and stops for V3 cams. - The V2 cam keeps working...

I have 3 V3s and 1 V2.

All cams are on the latest firmware.

I have tried: IGNORE_RES=1 NET_MODE=LAN FRESH_DATA=true

CB954 avatar Jan 30 '22 01:01 CB954

Could this be a network/wifi issue?

mrlt8 avatar Feb 09 '22 14:02 mrlt8

I have 10 cameras and am experiencing the same problem - streams starting and stopping. Unfortunately, it makes the bridge unusable. I also see the start/stop problem in the native Wyze app, so I wonder if they are having a problem on their side. I was hoping to tie the bridge into frigate but it doesn't look that will work due to the flakiness of the camera stream.

rugene76 avatar Feb 14 '22 18:02 rugene76

Could this be a network/wifi issue?

I do not think so, as I do not have the issue when I stop the container. I have 1 V2 and 3 V3s. With the container is running, the connection via RTSP is slow and extremely laggy. Interestingly, when the container is running, cameras won't even load in the Wyze app. As soon as I stop this container, the cameras work flawlessly in the Wyze app. It's almost like Wyze throttles how many streams can be running simultaneously. If I limit the container to only two cameras I do not have this issue.

CB954 avatar Feb 17 '22 14:02 CB954

I've done some experimenting and have found that more than 4 or 5 camera causes issues in general for wyze cam streams. No matter where they come from. I've also tried their RTSP firmware load and got similar results even with a local stream. I contacted wyze to discuss but they gave the usual "reboot and retry" BS.

Filtering down to one camera helps, but after running a few minutes, I get a "stream is down" with AV_ER_DATA_NOREADY.

I run on a 3 node ASUS ZEN xt8 mesh router so I doubt I have a router issue. Internet connection speed is about 400/50mbs down/up on T-mobile internet. I did however bind each camera to a mesh node to be sure they had the best connection. That might of helped....

In any case, I'm not sure what is causing the connection issues when lot's of cameras are connected. Even with 10 camera's the total bandwidth is modest. I can run multiple TVs streaming netflix 4k, et al, with no problem.

Next up I'm gonna try the dafang hacks on github and see how that works.

Anybody have any ideas?

rugene76 avatar Feb 17 '22 15:02 rugene76

@CB954 Can you stream from multiple cameras in the app without any issue? + > Add Device Group > Camera Group.

@rugene76 Pretty sure it's the wifi chip/antenna on the cameras that cause it to hog the 2.4ghz channel. WAN speed shouldn't matter if you're streaming over LAN mode. You might also want to turn off some non-standard wifi options on your 2.4 bands like airtime fairness.

I've noticed more connection drops when channel utilization is higher (channel capacity in asus' wifi radar?), which you might be able to check with something like sudo iw wlan0 scan | egrep 'SSID|primary channel|utilisation'

mrlt8 avatar Feb 17 '22 16:02 mrlt8

@CB954 Can you stream from multiple cameras in the app without any issue? + > Add Device Group > Camera Group.

@mrlt8 Yes, no issue streaming all cameras with a camera group. However, as soon I start the bridge, the camera group will no longer stream.

CB954 avatar Feb 24 '22 18:02 CB954

Could you see if v1.2.0 improves/resolves this issue?

mrlt8 avatar Feb 25 '22 02:02 mrlt8

Could you see if v1.2.0 improves/resolves this issue?

@mrlt8 Nope, same issue. It seems to really effect the V3 my V2 will connect while the bridge is running. I see lots of frame drops when running the bridge.

CB954 avatar Feb 27 '22 18:02 CB954

I redeployed on docker, thinking I pulled the latest version, and so far things seem much more stable when I read from one camera....but I'm a little confused in that the version listed in the logs says I now have version 1.1.1 Where else would I look on portainer to verify the version?

rugene76 avatar Feb 27 '22 19:02 rugene76

@rugene76 the version number printed in the log should be most accurate.

mrlt8 avatar Mar 01 '22 15:03 mrlt8

hmmm, I'm wondering what I did wrong in Portainer. I deleted the stack and redeployed it from scratch. When the container starts up using the env FRESH_DATA=true , I get wyze-bridge ver 1.1.0 and rtsp v0.17.17

rugene76 avatar Mar 01 '22 15:03 rugene76

I've done some experimenting and have found that more than 4 or 5 camera causes issues in general for wyze cam streams. No matter where they come from. ... I run on a 3 node ASUS ZEN xt8 mesh router so I doubt I have a router issue. Internet connection speed is about 400/50mbs down/up on T-mobile internet. In any case, I'm not sure what is causing the connection issues when lot's of cameras are connected. Even with 10 camera's the total bandwidth is modest. I can run multiple TVs streaming netflix 4k, et al, with no problem.

I also have the XT8 and also had stuttering issues in the Wyze app itself. It turned out to be WiFi Agile Multiband and Protected Management Frames on the 2.4Ghz band. Once disabled, things cleared up quite nicely in the Wyze app. I can stream 4+ cams at once no problem (I have 6 cams).

However, wyze-bridge did not benefit from this. The feeds are still unusable for me. Seems like I get a frame every 2 seconds, if I can stay connected.

Edit: Filtering down to even a single cam doesn't seem to help.

RyanEwen avatar May 16 '22 15:05 RyanEwen

Ryan, thanks for the info, I'll try it out. In general I'm experiencing quirkiness with the xt8 on other things so I appreciate your insights.

rugene76 avatar May 16 '22 16:05 rugene76

Ryan, thanks for the info, I'll try it out. In general I'm experiencing quirkiness with the xt8 on other things so I appreciate your insights.

FWIW I'm using the latest beta firmware: 9.0.0.4.386_46980

RyanEwen avatar May 16 '22 16:05 RyanEwen

Seems like I’m running into the same problem. Anything over 4 cameras on, and I’m seeing this in the logs for most cameras.

2022/06/12 11:15:30 [Camera] WARNING: Frame not available yet 2022/06/12 11:16:02 [TSP] [Camera] Client stopped reading 2022/06/12 11:16:07 [RTSP][Camera] New client reading 2022/06/12 11:16:08 [TSP] [Camera] Client stopped reading 2022/06/12 11:16:08 [TSP] [Camera]*'/camera' stream is down 2022/06/12 11:16:09 [Camera] Stream did not receive a frame for over 20s

Troubleshooting done:

  • Pause Wyze Bridge container. In Wyze app, added all 6 cameras into one group. Able to load and see all 6 streams at one time.
  • Turn off all cameras. Un-pause Wyze bridge container. Turned on one camera at a time and watched the logs until the rtsp stream came UP. 4 cameras came up. With 5th camera turned on, different cameras started dropping.

Tested using following models:

  • Cam v2
  • Cam v3
  • Pan cam v1
  • Pan cam v2

Is there a way to ignore cameras that we don’t want to have rtsp enabled for? This would make the container usable with rtsp streams for 4 cameras, until this bug is solved.

tetris-rom avatar Jun 12 '22 19:06 tetris-rom

  • Able to load and see all 6 streams at one time

I have 2 beta db cams I’m ignoring by just using the filtering as shown in the instructions for the env variables - I’m listing just the 2 cams and db I want to include.

cheme75 avatar Jun 12 '22 20:06 cheme75

Thank you for calling that you are able to filter by cameras. I missed that section when skimming through the read me. I’m able to filter for the four cameras that I want/need most and see the streams. It would still be good to see if the bug can be fixed to allow more than 4 cameras to be added.

tetris-rom avatar Jun 12 '22 20:06 tetris-rom

Was pulling out my hair with this exact same issue. Even a single camera with Wyze Bridge running would kill the Wyze app completely. Turn off Wyze Bridge, everything worked fine.

I had replaced my router and it had by default enabled QoS and some sort of multimedia prioritization preference. Similar to the comments above, make sure you don't have any QoS type settings enabled. Once that was disabled, 5+ cameras with no delay or choppiness.

McCloudS avatar Sep 19 '22 13:09 McCloudS

I'm getting this as well, but i try to filter out various cameras and now its happening with just 2 cams even. Getting that No frame for 20s issue. Thing is this was all working fine for me, then I had to reformat my Windows 11 machine. Resetting up and now I have this issue making it unusable which gives me a sad cause man what a cool thing this was for my cams. Not sure if its wins11 or my machine.. or i didn't have latest perhaps before the reformat. I want to go back in time lol. it was working so well. If anyone comes up with any other ideas please do comment!

gitloon avatar Oct 22 '22 13:10 gitloon

I have to go down to simply 1 cam for it not to disconnect. it is steady as a rock with only one cam.. :(

gitloon avatar Oct 24 '22 13:10 gitloon

Nevermind, that just reconnected too.. no frame for over 60s (i bumped up from default 20s) it lasted longer than with 2 or more. just not sure what the issue is at this point. the Wyze app doesn't stutter at all.. will set up Blue Iris shortly again, (everything was working before until i reformatted and reinstalled win11, as noted above) and see if it has problems as well.

gitloon avatar Oct 24 '22 13:10 gitloon

I don't think it matters how many cameras are enabled in the bridge. It seems to be an issue depending how many cameras are on the network. Since I got more than 4, I cannot use the bridge at all. :(

RyanEwen avatar Oct 24 '22 14:10 RyanEwen

@gitloon is your host running the bridge connected over wifi? Is there another machine you could test the bridge on?

@RyanEwen Could be a router issue? Might want to double check the setting on your router - IGMP, multicast routing, airtime fairness, etc.

mrlt8 avatar Oct 24 '22 14:10 mrlt8

hrm, i didn't try completely disconnecting a cam.. i'll try that just to confirm. I too have 4 cams going.

Well even with 3 cams going I am seeing this issue. Not sure whats up.

@mrlt8 It is not on wifi it is hardlined with a 1G connect to my router. Like i said, i half blame something here, because i don't know what is different now vs what I was using successfully for months before the reformat. :/ only thing i can think of was perhaps i wasn't using "latest" but I've tried downgrading to no avail.

gitloon avatar Oct 24 '22 15:10 gitloon

@mrlt8 I do suspect it's unrelated to wyze-bridge.

Here's my WiFi settings: https://imgur.com/a/Izcst9v

Earlier in this thread I mentioned that I had issues even in the Wyze app until I turned off WiFi Agile Multiband and Protected Management Frames. I also turned off Smart Connect so that I could control these settings per-band. At least the app works half decently now.

I am planning on replacing my ASUS XT8s with something else over the winter as I find they are flaky in other ways as well. I'll report back when I've done that in case it makes a difference.

RyanEwen avatar Oct 24 '22 15:10 RyanEwen

FWIW Blue Iris is back running, 4 cameras, all connected via RTSP and are doing as well as normal. the 2.4ghz congetstion at my condo is stupid, but here we are :D They are definitely working at least... and as i mentioned before, the wyze app is working. i set NET_MODE=P2P and it still always said LAN mode. is there a way to force it from the wyze api?

gitloon avatar Oct 24 '22 15:10 gitloon

@RyanEwen First, I'd try to set the wifi channel to either 1, 6, or 11 - whichever is least congested and has the least overlap with other networks. Other setting should be under the professional tab and I believe LAN/IPTV..?

@gitloon p2p is essentially the same as LAN except it goes over the internet (e.g. streaming direct from the camera from a remote location) and the tutk library will try to go from LAN > P2P > relay, but since your bridge is on the same LAN as the cameras, it's streaming direct from them locally. Might want to take a look at your channel utilization as well, could be some neighbor congesting the channel you're on. Could it be a windows related firewall setting? I believe @cheme75 had some networking issue on windows.

mrlt8 avatar Oct 24 '22 15:10 mrlt8

Fwiw, I got 2 v2 cams and 2 db cams original install went to relay and nothing I could find in win had any affect to change it. Trying to specify LAN always resulted in errors. I had some glitch when updating docker after windows update/reboot, pc crashed during docker update process, so I uninstalled docker, rebooted, then did a fresh install, then pulled the bridge to reinstall the container and bingo, it came back up in LAN mode as the default and has remained. Weird since nothing else changed.

cheme75 avatar Oct 24 '22 16:10 cheme75

@mrlt8 the imgur link has a screenshot of the Professional tab as well as the General tab, but I've been playing around with the Professional settings since the screens were uploaded. I've tried those channels and others in the past, but it didn't help unfortunately.

New things I've tried:

  • Disabling IGMP snooping (was better on, which is what I assume you were suggesting anyway)
  • Changing Preamble Type to Short (based on the description of the setting, Short is better w/ high-traffic networks)
  • Disabling WMM APSD (power-saving feature, figured I would just try turning it off)
  • Changing Channel Bandwidth from 20 MHz to 20/40 MHz (I had limited this to 20 previously to help with congestion)

I think the Preamble Type and/or Channel Bandwidth changes do actually help, but not enough to stream 4+ cameras at once. Before those changes I couldn't even stream a single one at once, so it's a move in the right direction at least. All 6 cameras appear to have solid connections and the router claims they are all linked at 72 mbps.

Curious how the Wyze app can handle all 6 at once without blinking an eye. You would think that the network traffic etc would be the same?

RyanEwen avatar Oct 24 '22 18:10 RyanEwen

So.. i believe in my case using docker-desktop is the culprit. I've switched to just running docker inside a Ubuntu 22 WSL and everything with 4 cameras is smooth as silk. Not sure if docker-desktop has changed recently but that is definitely the issue. Since removing docker-desktop, as a side note, my Blue Iris install is working even better :D (though could be anectdotal.) Thanks to @cheme75 for the idea of uninstalling, which in turn led me to just not use docker-desktop.

gitloon avatar Oct 24 '22 18:10 gitloon