mrlt8 / docker-wyze-bridge

WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container
GNU Affero General Public License v3.0
2.45k stars 151 forks source link

connection issue with V4, V3 cam #1216

Open tam1230 opened 1 month ago

tam1230 commented 1 month ago

Describe the bug

Provide a clear and concise description of the issue and include logs if applicable.

This is config yaml file.

ENABLE_AUDIO: false ON_DEMAND: false WB_AUTH: false MOTION_API: false MQTT_DTOPIC: homeassistant CAM_OPTIONS:

and this is log file. 23:42:49 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:42:49 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:42:49 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:43:09 [WARNING][front] [-13] IOTC_ER_TIMEOUT 23:43:10 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:43:10 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:43:10 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:43:30 [WARNING][front] [-13] IOTC_ER_TIMEOUT 23:43:31 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:43:31 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:43:31 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:43:51 [WARNING][WyzeBridge] ⏰ Timed out connecting to Front. 23:43:52 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:43:52 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:43:52 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:44:12 [WARNING][front] [-13] IOTC_ER_TIMEOUT 23:44:13 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:44:13 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:44:13 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:44:15 [INFO][WyzeBridge] 172.30.32.2 - - [19/May/2024 23:44:15] "GET /api/front HTTP/1.1" 200 - 23:44:33 [WARNING][WyzeBridge] ⏰ Timed out connecting to Front. 23:44:34 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:44:34 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:44:34 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:44:54 [WARNING][front] [-13] IOTC_ER_TIMEOUT 23:44:54 [INFO][WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API... 23:44:54 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443 23:44:55 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/home_page/get_object_list HTTP/1.1" 200 1618 23:44:55 [INFO][WyzeBridge] [API] Fetched [4] cameras 23:44:55 [INFO][WyzeBridge] 💾 Saving 'cameras' to local cache... 23:44:56 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:44:56 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:44:56 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:45:02 [INFO][WyzeBridge] 172.30.32.2 - - [19/May/2024 23:45:02] "GET / HTTP/1.1" 200 - 23:45:02 [INFO][WyzeBridge] 172.30.32.2 - - [19/May/2024 23:45:02] "GET /static/bulma.css HTTP/1.1" 304 - 23:45:02 [INFO][WyzeBridge] 172.30.32.2 - - [19/May/2024 23:45:02] "GET /static/site.js HTTP/1.1" 304 - 23:45:02 [INFO][WyzeBridge] 172.30.32.2 - - [19/May/2024 23:45:02] "GET /static/bulma-toast.js HTTP/1.1" 304 - 23:45:02 [INFO][WyzeBridge] 172.30.32.2 - - [19/May/2024 23:45:02] "GET /static/site.css HTTP/1.1" 304 - 23:45:02 [INFO][WyzeBridge] 172.30.32.2 - - [19/May/2024 23:45:02] "GET /api/sse_status HTTP/1.1" 200 - 23:45:16 [WARNING][WyzeBridge] ⏰ Timed out connecting to Front. 23:45:17 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:45:17 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:45:17 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:45:37 [WARNING][front] [-13] IOTC_ER_TIMEOUT 23:45:38 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:45:38 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:45:38 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:45:58 [WARNING][front] [-13] IOTC_ER_TIMEOUT 23:45:59 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.1.101 23:45:59 [WARNING][WyzeBridge] WARNING: This process (pid=8) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:45:59 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx

I use one V4 camera and three V3 cameras. The V4 camera is online, but the V3 cameras are offline because they are not powered on.

In this situation, the V4 camera can connect with the Wyze bridge, but there is some connection issue.

Could you help me?

I have tried both P2P mode and ANY mode.

My camera and Wyze bridge are connected to different networks.

It is normal for the V3 cameras to show as offline in the Wyze bridge since they are not powered on.

Even when I power on the V3 cameras, they show the same error message as the V4 camera.

The firmware version of the V4 camera is 4.52.3.9455, and the firmware version of the V3 cameras is 4.36.11.8391.

Environment (if applicable)

mrlt8 commented 1 month ago

No, you'd normally get the IOTC_ER_DEVICE_OFFLINE message if the camera is "off" or in privacy mode.

Unfortunately, there seems to be some kind of NAT punching bug with the latest camera firmware that prevents non-local connections. The only solution right now is to either downgrade the camera or put the bridge on the same network via VPN.

Is the V4 on the same LAN? We may have to extend the connection timeout if it is.

tam1230 commented 1 month ago

Can i get the V4 and V3 camera version that i can use ? I will downgrade the camera version and retest it. no, V4 and V3 camaera are not same network.

mrlt8 commented 1 month ago

I believe 4.36.11.7095 should work for the v3:

https://download.wyzecam.com/firmware/v3/demo_wcv3_4.36.11.7095.bin.zip

I don't think there is an older version for the v4.

bobloadmire commented 1 month ago

The only solution right now is to either downgrade the camera or put the bridge on the same network via VPN.

Can you explain a little more so we can impliment this? I'm running OPNsense so I think I should have the tools to do this.

mrlt8 commented 1 month ago

here's an example using open vpn:

services:
  openvpn:
    image: dperson/openvpn-client
    restart: unless-stopped
    ports:
      - 8554:8554 # RTSP
      - 8889:8889 #WebRTC
      - 8189:8189/udp # WebRTC/ICE
      - 5050:5000 # WEB-UI 
    cap_add: [NET_ADMIN]
    command: "-f /vpn/config.ovpn"
    volumes:
      - ./config.ovpn:/vpn/config.ovpn
  wyze-bridge:
    depends_on:
      - openvpn
    network_mode: service:openvpn
    container_name: wyze-bridge
    image: mrlt8/wyze-bridge:latest
    restart: always
    environment:
     ... same as before
tam1230 commented 1 month ago

23:08:00 [INFO][WyzeBridge] Press CTRL+C to quit 23:08:01 [DEBUG][WyzeBridge] https://auth-prod.api.wyze.com:443 "POST /api/user/login HTTP/1.1" 200 None 23:08:01 [INFO][WyzeBridge] 💾 Saving 'auth' to local cache... 23:08:01 [INFO][WyzeBridge] 🔍 Could not find local cache for 'user' 23:08:01 [INFO][WyzeBridge] ☁️ Fetching 'user' from the Wyze API... 23:08:01 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443 23:08:02 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/user/get_user_info HTTP/1.1" 200 265 23:08:02 [INFO][WyzeBridge] 💾 Saving 'user' to local cache... 23:08:02 [INFO][WyzeBridge] 🔍 Could not find local cache for 'cameras' 23:08:02 [INFO][WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API... 23:08:02 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443 23:08:02 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/home_page/get_object_list HTTP/1.1" 200 1618 23:08:02 [INFO][WyzeBridge] [API] Fetched [4] cameras 23:08:02 [INFO][WyzeBridge] 💾 Saving 'cameras' to local cache... 23:08:02 [INFO][WyzeBridge] [+] Adding Right [WYZE_CAKP2JFUS] 23:08:02 [INFO][WyzeBridge] [+] Adding Front [HL_CAM4] 23:08:02 [INFO][WyzeBridge] [+] Adding Left [WYZE_CAKP2JFUS] 23:08:02 [INFO][WyzeBridge] [+] Adding Rear [WYZE_CAKP2JFUS] 23:08:02 [INFO][WyzeBridge] starting MediaMTX 1.1.1 23:08:02 [INFO][WyzeBridge] 🎬 4 streams enabled 23:08:03 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V3 - Right on 192.168.0.163 23:08:04 [WARNING][WyzeBridge] WARNING: This process (pid=7) is multi-threaded, use of fork() may lead to deadlocks in the child. 23:08:04 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.0.161 23:08:04 [WARNING][WyzeBridge] WARNING: This process (pid=7) is multi-threaded, use of fork() may lead to deadlocks in the child. 23:08:04 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V3 - Left on 192.168.0.164 [right] Connect via IOTC_Connect_ByUIDEx 23:08:04 [DEBUG][right] Connect via IOTC_Connect_ByUIDEx 23:08:04 [WARNING][WyzeBridge] WARNING: This process (pid=7) is multi-threaded, use of fork() may lead to deadlocks in the child. 23:08:04 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V3 - Rear on 192.168.0.162 [front] Connect via IOTC_Connect_ByUIDEx 23:08:04 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:08:04 [WARNING][WyzeBridge] WARNING: This process (pid=7) is multi-threaded, use of fork() may lead to deadlocks in the child. [left] Connect via IOTC_Connect_ByUIDEx 23:08:04 [DEBUG][left] Connect via IOTC_Connect_ByUIDEx [rear] Connect via IOTC_Connect_ByUIDEx 23:08:04 [DEBUG][rear] Connect via IOTC_Connect_ByUIDEx 23:08:05 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:05] "GET / HTTP/1.1" 200 - 23:08:05 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:05] "GET /static/bulma.css HTTP/1.1" 200 - 23:08:05 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:05] "GET /static/site.css HTTP/1.1" 200 - 23:08:05 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:05] "GET /static/site.js HTTP/1.1" 200 - 23:08:05 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:05] "GET /static/bulma-toast.js HTTP/1.1" 200 - 23:08:05 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:05] "GET /api/sse_status HTTP/1.1" 200 - 23:08:05 [WARNING][right] [-90] IOTC_ER_DEVICE_OFFLINE 23:08:05 [WARNING][left] [-90] IOTC_ER_DEVICE_OFFLINE 23:08:05 [WARNING][rear] [-90] IOTC_ER_DEVICE_OFFLINE 23:08:06 [INFO][WyzeBridge] 🪦 right is offline. WILL ignore. 23:08:06 [INFO][WyzeBridge] Disabling right 23:08:06 [INFO][WyzeBridge] 🪦 left is offline. WILL ignore. 23:08:06 [INFO][WyzeBridge] Disabling left 23:08:06 [INFO][WyzeBridge] 🪦 rear is offline. WILL ignore. 23:08:06 [INFO][WyzeBridge] Disabling rear 23:08:10 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:10] "GET / HTTP/1.1" 200 - 23:08:10 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:10] "GET /static/bulma-toast.js HTTP/1.1" 304 - 23:08:10 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:10] "GET /static/bulma.css HTTP/1.1" 304 - 23:08:10 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:10] "GET /static/site.css HTTP/1.1" 304 - 23:08:10 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:10] "GET /static/site.js HTTP/1.1" 304 - 23:08:10 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:10] "GET /api/sse_status HTTP/1.1" 200 - 23:08:14 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:14] "GET /api/front HTTP/1.1" 200 - 23:08:21 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:21] "GET /api/right HTTP/1.1" 200 - 23:08:22 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:22] "GET /api/left HTTP/1.1" 200 - 23:08:23 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:23] "GET /api/rear HTTP/1.1" 200 - 23:08:24 [WARNING][WyzeBridge] ⏰ Timed out connecting to Front. 23:08:25 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.0.161 23:08:25 [WARNING][WyzeBridge] WARNING: This process (pid=7) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:08:25 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:08:38 [INFO][WyzeBridge] 172.30.32.2 - - [24/May/2024 23:08:38] "GET /api/front HTTP/1.1" 200 - 23:08:45 [WARNING][front] [-13] IOTC_ER_TIMEOUT 23:08:46 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.0.161 23:08:46 [WARNING][WyzeBridge] WARNING: This process (pid=7) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:08:46 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx 23:09:06 [WARNING][front] [-13] IOTC_ER_TIMEOUT 23:09:07 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V4 - Front on 192.168.0.161 23:09:07 [WARNING][WyzeBridge] WARNING: This process (pid=7) is multi-threaded, use of fork() may lead to deadlocks in the child. [front] Connect via IOTC_Connect_ByUIDEx 23:09:07 [DEBUG][front] Connect via IOTC_Connect_ByUIDEx

now i am using vpn. so my camera and homeassisant is same network. but the another error happened.

could you check it?

Thanks

mrlt8 commented 1 month ago

@tam1230 Can you ping devices on the 192.168.0.0 network?