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.46k stars 151 forks source link

No motion events - stopped recently #1125

Closed kiwi-cam closed 1 month ago

kiwi-cam commented 4 months ago

Recently I've stopped getting motion alerts via webhooks from all my cameras. It seems to have started around the same time as #1108. Unfortunately this is both around the time v2.7.0 was released, and the last firmware update to the cameras. I've rolled back to 2.5.3 which seems to have helped with the sync issue - but still no motion events.

My docker compose file is (which is unchanged other than the image version):

version: '2.4'
services:
    wyze-bridge:
        container_name: wyze-bridge
        restart: unless-stopped
        image: mrlt8/wyze-bridge:2.5.3
        ports:
            - 1935:1935 # RTMP
            - 8554:8554 # RTSP
            - 8888:8888 # HLS
            - 5000:5000 # HTML
        environment:
            - WYZE_EMAIL=xxxxx
            - WYZE_PASSWORD=xxxxx
            - QUALITY=HD
            - ENABLE_AUDIO=False
            - SUBSTREAM=True
            - SNAPSHOT=API
            - IMG_DIR=/img/
            - CONNECT_TIMEOUT=45
            - MOTION_API=True
            - MOTION_START=True
            - MOTION_WEBHOOKS_xxxx_CAM=http://192.168....
            - MOTION_WEBHOOKS_xxxx_CAM=http://192.168....
            - MOTION_WEBHOOKS_GARAGE_CAM=http://192.168....
        volumes:
            - ./img:/img
rmaes4 commented 4 months ago

I've noticed that I have been getting rate-limited recently. I wonder if Wyze has made some changes on their end..

kiwi-cam commented 4 months ago

To add to this, I'm seeing this in the output (haven't noticed it before):

wyze-bridge  | [WyzeBridge] starting MediaMTX 1.1.1
wyze-bridge  | [WyzeBridge] 🎬 8 streams enabled
wyze-bridge  | [WyzeBridge] API Motion Events Enabled [interval=1.5]
wyze-bridge  | [WyzeBridge] [API] code='1001' msg='User device relationship does not exist.'
wyze-bridge  | Exception in thread Thread-1:
wyze-bridge  | Traceback (most recent call last):
wyze-bridge  |   File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
wyze-bridge  |     self.run()
wyze-bridge  |   File "/app/wyze_bridge.py", line 37, in run
wyze-bridge  |     self.streams.monitor_streams(self.rtsp.health_check)
wyze-bridge  |   File "/app/wyzebridge/stream.py", line 112, in monitor_streams
wyze-bridge  |     events.check_motion()
wyze-bridge  |   File "/app/wyzebridge/wyze_events.py", line 63, in check_motion
wyze-bridge  |     for event in self.get_events():
wyze-bridge  |                  ^^^^^^^^^^^^^^^^^
wyze-bridge  |   File "/app/wyzebridge/wyze_events.py", line 29, in get_events
wyze-bridge  |     self.last_check, resp = self.api.get_events(self.enabled_cams(), self.last_ts)
wyze-bridge  |     ^^^^^^^^^^^^^^^^^^^^^
wyze-bridge  | TypeError: cannot unpack non-iterable NoneType object
rmaes4 commented 4 months ago

I have gotten that same code=1001 too.

kiwi-cam commented 2 months ago

Just wanted to update. I've now updated to v2.8.1 and I'm still getting the same error:

wyze-bridge  | 05:56:50 [INFO][WyzeBridge] API Motion Events Enabled [interval=3.0]
wyze-bridge  | 05:56:51 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:51] "GET /api/sse_status HTTP/1.1" 200 -
wyze-bridge  | 05:56:51 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET / HTTP/1.1" 200 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /static/bulma.css HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /static/site.css HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/garage-cam-sub.jpg HTTP/1.1" 200 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/garage-cam.jpg HTTP/1.1" 200 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /static/bulma-toast.js HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/kitchen-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/kitchen-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/dog-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/back-lawn-cam-sub.jpg HTTP/1.1" 200 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/back-lawn-cam.jpg HTTP/1.1" 200 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/dog-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /static/site.js HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/garage-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/garage-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/kitchen-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/kitchen-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/back-lawn-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/back-lawn-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/dog-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/dog-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /api/sse_status HTTP/1.1" 200 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/garage-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/garage-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/kitchen-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/kitchen-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/back-lawn-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/dog-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/back-lawn-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [INFO][WyzeBridge] 192.168.1.10 - - [30/Apr/2024 05:56:52] "GET /img/dog-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 05:56:52 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/device/get_event_list HTTP/1.1" 200 138
wyze-bridge  | 05:56:52 [ERROR][WyzeBridge] [API] code='1001' msg='User device relationship does not exist.'
wyze-bridge  | Exception in thread Thread-1:
wyze-bridge  | Traceback (most recent call last):
wyze-bridge  |   File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
wyze-bridge  |     self.run()
wyze-bridge  |   File "/app/wyze_bridge.py", line 37, in run
wyze-bridge  |     self.streams.monitor_streams(self.rtsp.health_check)
wyze-bridge  |   File "/app/wyzebridge/stream.py", line 112, in monitor_streams
wyze-bridge  |     events.check_motion()
wyze-bridge  |   File "/app/wyzebridge/wyze_events.py", line 63, in check_motion
wyze-bridge  |     for event in self.get_events():
wyze-bridge  |                  ^^^^^^^^^^^^^^^^^
wyze-bridge  |   File "/app/wyzebridge/wyze_events.py", line 29, in get_events
wyze-bridge  |     self.last_check, resp = self.api.get_events(self.enabled_cams(), self.last_ts)
wyze-bridge  |     ^^^^^^^^^^^^^^^^^^^^^
wyze-bridge  | TypeError: cannot unpack non-iterable NoneType object
wyze-bridge  | 05:57:07 [INFO][WyzeBridge] [CONTROL] ☁️ get_device_Info for dog-cam via Wyze API
wyze-bridge  | 05:57:07 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 05:57:07 [INFO][WyzeBridge] [CONTROL] ☁️ get_device_Info for kitchen-cam via Wyze API
wyze-bridge  | 05:57:07 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
mrlt8 commented 2 months ago

We can catch the exception, but still not sure what's causing:

code='1001' msg='User device relationship does not exist.'

Is this a shared camera?

kiwi-cam commented 2 months ago

Thanks @mrlt8

They are shared cameras so I've just unshared them and changed my config to authenticate with the owner account - I still get the error.

I see you've added a commit to include the exception - how do I update my docker-compose file to pull this update?

kiwi-cam commented 2 months ago

@mrlt8 - I found the list of tags and switched to the dev tag. I now get this output:

WARN[0000] /var/lib/docker-wyze-bridge/docker-compose.yml: `version` is obsolete -cam via Wyze API
[+] Running 0/111:36:28 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
 ⠹ Container wyze-bridge  Recreated                                                                                                                                            0.2s
Attaching to wyze-bridge[DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 21:38:08 [WARNING][WyzeBridge] WARNING: invalid escape sequence '\d'
wyze-bridge  | 21:38:08 [WARNING][WyzeBridge] WARNING: invalid escape sequence '\w'
wyze-bridge  |
wyze-bridge  | 🚀 DOCKER-WYZE-BRIDGE v2.3.16 [DEV BUILD]
wyze-bridge  |
wyze-bridge  | 21:38:08 [WARNING][WyzeBridge] [WARN] Credentials are NOT set
wyze-bridge  | 21:38:08 [INFO][WyzeBridge] 🔍 Could not find local cache for 'auth'
wyze-bridge  | 21:38:08 [INFO][WyzeBridge] ☁️ Fetching 'auth' from the Wyze API...
wyze-bridge  | 21:38:08 [ERROR][WyzeBridge] Credentials required to complete login!
wyze-bridge  | 21:38:08 [INFO][WyzeBridge] Please visit the WebUI to enter your credentials.
wyze-bridge  |  * Serving Flask app 'frontend'
wyze-bridge  |  * Debug mode: off
wyze-bridge  | 21:38:08 [INFO][WyzeBridge] WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
wyze-bridge  |  * Running on all addresses (0.0.0.0)
wyze-bridge  |  * Running on http://127.0.0.1:5000
wyze-bridge  |  * Running on http://172.18.0.2:5000
wyze-bridge  | 21:38:08 [INFO][WyzeBridge] Press CTRL+C to quit
wyze-bridge  | 21:38:08 [INFO][WyzeBridge] 192.168.1.50 - - [01/May/2024 21:38:08] "GET /api/dog-cam/power HTTP/1.1" 200 -
wyze-bridge  | 21:38:08 [INFO][WyzeBridge] 192.168.1.50 - - [01/May/2024 21:38:08] "GET /api/kitchen-cam/power HTTP/1.1" 200 -
wyze-bridge  | 21:38:23 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:23] "GET / HTTP/1.1" 302 -
wyze-bridge  | 21:38:23 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:23] "GET /login HTTP/1.1" 200 -
wyze-bridge  | 21:38:23 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:23] "GET /static/site.css HTTP/1.1" 200 -
wyze-bridge  | 21:38:27 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:27] "POST /login HTTP/1.1" 200 -
wyze-bridge  | 21:38:27 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): auth-prod.api.wyze.com:443
wyze-bridge  | 21:38:28 [DEBUG][WyzeBridge] https://auth-prod.api.wyze.com:443 "POST /api/user/login HTTP/1.1" 200 None
wyze-bridge  | 21:38:28 [INFO][WyzeBridge] 💾 Saving 'auth' to local cache...
wyze-bridge  | 21:38:28 [INFO][WyzeBridge] 🔍 Could not find local cache for 'user'
wyze-bridge  | 21:38:28 [INFO][WyzeBridge] ☁️ Fetching 'user' from the Wyze API...
wyze-bridge  | 21:38:28 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 21:38:28 [INFO][WyzeBridge] 192.168.1.50 - - [01/May/2024 21:38:28] "GET /api/dog-cam/power HTTP/1.1" 200 -
wyze-bridge  | 21:38:28 [INFO][WyzeBridge] 192.168.1.50 - - [01/May/2024 21:38:28] "GET /api/kitchen-cam/power HTTP/1.1" 200 -
wyze-bridge  | 21:38:28 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/user/get_user_info HTTP/1.1" 200 280
wyze-bridge  | 21:38:28 [INFO][WyzeBridge] 💾 Saving 'user' to local cache...
wyze-bridge  | 21:38:28 [INFO][WyzeBridge] 🔍 Could not find local cache for 'cameras'
wyze-bridge  | 21:38:28 [INFO][WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
wyze-bridge  | 21:38:28 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 21:38:29 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/home_page/get_object_list HTTP/1.1" 200 2272
wyze-bridge  | 21:38:29 [INFO][WyzeBridge] [API] Fetched [4] cameras
wyze-bridge  | 21:38:29 [DEBUG][WyzeBridge] [API] cameras=['Kitchen Cam', 'Back Lawn Cam', 'Garage Cam', 'dog Cam']
wyze-bridge  | 21:38:29 [INFO][WyzeBridge] 💾 Saving 'cameras' to local cache...
wyze-bridge  | 21:38:29 [INFO][WyzeBridge] [+] Adding Kitchen Cam [WYZEC1-JZ]
wyze-bridge  | 21:38:29 [INFO][WyzeBridge] [+] Adding Back Lawn Cam [WYZE_CAKP2JFUS]
wyze-bridge  | 21:38:29 [INFO][WyzeBridge] ☁️ Pulling "back-lawn-cam" thumbnail to /img/back-lawn-cam.jpg
wyze-bridge  | 21:38:29 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): rest.cache.cell-2-us-west-2-1.prod.a.momentohq.com:443
wyze-bridge  | 21:38:30 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:30] "GET /api/sse_status HTTP/1.1" 200 -
wyze-bridge  | 21:38:30 [DEBUG][WyzeBridge] https://rest.cache.cell-2-us-west-2-1.prod.a.momentohq.com:443 "GET /cache/get/wyze-thumbnail-service-prod/7C78B221E82F131714599459_1.jpg?token=<redacted> HTTP/1.1" 200 33406
wyze-bridge  | 21:38:30 [INFO][WyzeBridge] [+] Adding Garage Cam [WYZE_CAKP2JFUS]
wyze-bridge  | 21:38:30 [INFO][WyzeBridge] ☁️ Pulling "garage-cam" thumbnail to /img/garage-cam.jpg
wyze-bridge  | 21:38:30 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): campluslite-usw2.s3.us-west-2.amazonaws.com:443
wyze-bridge  | 21:38:31 [DEBUG][WyzeBridge] https://campluslite-usw2.s3.us-west-2.amazonaws.com:443 "GET /7C78B2220253/2024-05-01/7C78B2220253011714596668_1714596668921_1_1_0/0208f203ecd5426184bbb7ed9fd680f7_1.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240501T213829Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Credential=<redacted>%2F20240501%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=<redacted> HTTP/1.1" 200 13211
wyze-bridge  | 21:38:31 [INFO][WyzeBridge] [+] Adding dog Cam [WYZEC1-JZ]
wyze-bridge  | 21:38:31 [INFO][WyzeBridge] ☁️ Pulling "dog-cam" thumbnail to /img/dog-cam.jpg
wyze-bridge  | 21:38:31 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): rest.cache.cell-2-us-west-2-1.prod.a.momentohq.com:443
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET / HTTP/1.1" 200 -
wyze-bridge  | 21:38:32 [DEBUG][WyzeBridge] https://rest.cache.cell-2-us-west-2-1.prod.a.momentohq.com:443 "GET /cache/get/wyze-thumbnail-prod/2CAA8EAAD67A021714525261_1.jpg?token=<redacted> HTTP/1.1" 200 36375
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] starting MediaMTX 1.0.0
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 🎬 8 streams enabled
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] API Motion Events Enabled [interval=3.0]
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /static/site.css HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/kitchen-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/back-lawn-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/kitchen-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/garage-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/back-lawn-cam.jpg HTTP/1.1" 200 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/garage-cam.jpg HTTP/1.1" 200 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /static/site.js HTTP/1.1" 200 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/kitchen-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/kitchen-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/back-lawn-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/back-lawn-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/garage-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/garage-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /api/sse_status HTTP/1.1" 200 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/kitchen-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/kitchen-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/back-lawn-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/back-lawn-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/garage-cam.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:32 [INFO][WyzeBridge] 192.168.1.10 - - [01/May/2024 21:38:32] "GET /img/garage-cam-sub.jpg HTTP/1.1" 304 -
wyze-bridge  | 21:38:33 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 21:38:34 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/device/get_event_list HTTP/1.1" 200 138
wyze-bridge  | 21:38:34 [ERROR][WyzeBridge] [API] ERROR - code='1001' msg='User device relationship does not exist.'
wyze-bridge  | 21:38:35 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V3 - Garage Cam on 192.168.1.111
wyze-bridge  | 21:38:35 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V3 - Back Lawn Cam on 192.168.1.62
wyze-bridge  | 21:38:35 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V2 - Kitchen Cam on 192.168.1.61
wyze-bridge  | 21:38:35 [DEBUG][back-lawn-cam] Connect via IOTC_Connect_ByUIDEx
wyze-bridge  | 21:38:35 [DEBUG][kitchen-cam] Connect via IOTC_Connect_ByUIDEx
wyze-bridge  | 21:38:36 [DEBUG][garage-cam] Connect via IOTC_Connect_ByUIDEx
wyze-bridge  | 21:38:37 [INFO][garage-cam] AV Client Start: chan_id=0 expected_chan=0
wyze-bridge  | 21:38:37 [DEBUG][garage-cam] Now listening on channel id 0
wyze-bridge  | 21:38:37 [DEBUG][garage-cam] SEND <K10000ConnectRequest code=10000 resp_code=10001> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10000 txt_len=0> b''
wyze-bridge  | 21:38:37 [INFO][back-lawn-cam] AV Client Start: chan_id=0 expected_chan=0
wyze-bridge  | 21:38:37 [DEBUG][back-lawn-cam] Now listening on channel id 0
wyze-bridge  | 21:38:37 [DEBUG][back-lawn-cam] SEND <K10000ConnectRequest code=10000 resp_code=10001> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10000 txt_len=0> b''
wyze-bridge  | 21:38:37 [DEBUG][garage-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10001 txt_len=17>: b'\x03R\xa5\xed\xf0\xea\xfeK\xccPL\x9f\x92\xb81\x94e'
wyze-bridge  | 21:38:37 [DEBUG][garage-cam] Sending response: <K10008ConnectUserAuth code=10008 resp_code=10009>
wyze-bridge  | 21:38:37 [DEBUG][garage-cam] SEND <K10008ConnectUserAuth code=10008 resp_code=10009> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10008 txt_len=30> b'\xc8R\x92\x12\xf9^\x10f\xaf\xc4\xf0\x0c\xe8\xcc8\xd60603\x01\x00\x074160192'
wyze-bridge  | 21:38:37 [DEBUG][garage-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10009 txt_len=741>: b'{"connectionRes":"1","cameraInfo":{"audioParm":{"sampleRate":"16000"},"videoParm":{"type":"H264","bitRate":"30","resolution":"2","fps":"15","horizontalFlip":"2","verticalFlip":"2","logo":"2","time":"1"},"settingParm":{"stateVision":"2","nightVision":"3","osd":"1","logSd":"1","logUdisk":"1", "telnet":"2","tz":"12"},"basicInfo":{"firmware":"4.36.11.8391","type":"camera","hardware":"0.0.0.0","model":"WYZE_CAKP2JFUS","mac":"7C78B2220253","wifidb":"100"},"channelResquestResult":{"video":"1","audio":"0"},"recordType":{"type":"2"},"sdParm":{"status":"1","capacity":"118880","free":"4228","detail":"0"},"uDiskParm":{"status":"2","capacity":"0","free":"0"},"apartalarmParm":{"type":"0","startX":"25","longX":"50","startY":"25","heightY":"50"}}}'
wyze-bridge  | 21:38:37 [DEBUG][garage-cam] SEND <K10056SetResolvingBit code=10056 resp_code=10057> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10056 txt_len=3> b'\x01\xb4\x00'
wyze-bridge  | 21:38:37 [DEBUG][back-lawn-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10001 txt_len=17>: b'\x03\x0e/t\xa1\x16:\xd1\xb0\xe7\x93\xe0\x81\x85zp\xfd'
wyze-bridge  | 21:38:37 [DEBUG][back-lawn-cam] Sending response: <K10008ConnectUserAuth code=10008 resp_code=10009>
wyze-bridge  | 21:38:37 [DEBUG][back-lawn-cam] SEND <K10008ConnectUserAuth code=10008 resp_code=10009> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10008 txt_len=30> b'z\x7f\x9b}(\xc0\x0b\xe9(b5,U\xa0S\xd10603\x01\x00\x074160192'
wyze-bridge  | 21:38:37 [DEBUG][garage-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10057 txt_len=1>: b'\x01'
wyze-bridge  | 21:38:37 [DEBUG][back-lawn-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10009 txt_len=732>: b'{"connectionRes":"1","cameraInfo":{"audioParm":{"sampleRate":"16000"},"videoParm":{"type":"H264","bitRate":"30","resolution":"2","fps":"20","horizontalFlip":"1","verticalFlip":"1","logo":"2","time":"1"},"settingParm":{"stateVision":"1","nightVision":"3","osd":"1","logSd":"1","logUdisk":"1", "telnet":"2","tz":"12"},"basicInfo":{"firmware":"4.36.11.8391","type":"camera","hardware":"0.0.0.0","model":"WYZE_CAKP2JFUS","mac":"7C78B221E82F","wifidb":"96"},"channelResquestResult":{"video":"1","audio":"0"},"recordType":{"type":"1"},"sdParm":{"status":"2","capacity":"0","free":"0","detail":"0"},"uDiskParm":{"status":"2","capacity":"0","free":"0"},"apartalarmParm":{"type":"1","startX":"0","longX":"100","startY":"0","heightY":"100"}}}'
wyze-bridge  | 21:38:37 [DEBUG][back-lawn-cam] SEND <K10056SetResolvingBit code=10056 resp_code=10057> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10056 txt_len=3> b'\x01\xb4\x00'
wyze-bridge  | 21:38:37 [WARNING][kitchen-cam] [-90] IOTC_ER_DEVICE_OFFLINE
wyze-bridge  | 21:38:37 [DEBUG][back-lawn-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10057 txt_len=1>: b'\x01'
wyze-bridge  | 21:38:37 [INFO][WyzeBridge] 👻 Kitchen Cam is offline.
wyze-bridge  | 21:38:37 [INFO][WyzeBridge] Kitchen Cam will cooldown for 10s.
wyze-bridge  | 21:38:38 [DEBUG][garage-cam] No longer listening on channel id 0
wyze-bridge  | 21:38:38 [DEBUG][garage-cam] [videoParm] {'type': 'H264', 'bitRate': '30', 'resolution': '2', 'fps': '15', 'horizontalFlip': '2', 'verticalFlip': '2', 'logo': '2', 'time': '1'}
wyze-bridge  | 21:38:38 [INFO][garage-cam] 📡 Getting 180kb/s HD stream (H264/15fps) via LAN mode (WiFi: 100%) FW: 4.36.11.8391 🔒 (DTLS) (2/3)
wyze-bridge  | 21:38:38 [WARNING][garage-cam] WARNING: Skipping smaller frame at start of stream (frame_size=1)
wyze-bridge  | 21:38:38 [WARNING][garage-cam] WARNING: Skipping smaller frame at start of stream (frame_size=1)
wyze-bridge  | 21:38:38 [DEBUG][back-lawn-cam] No longer listening on channel id 0
wyze-bridge  | 21:38:38 [DEBUG][back-lawn-cam] [videoParm] {'type': 'H264', 'bitRate': '30', 'resolution': '2', 'fps': '20', 'horizontalFlip': '1', 'verticalFlip': '1', 'logo': '2', 'time': '1'}
wyze-bridge  | 21:38:38 [INFO][back-lawn-cam] 📡 Getting 180kb/s HD stream (H264/20fps) via LAN mode (WiFi: 96%) FW: 4.36.11.8391 🔒 (DTLS) (2/3)
wyze-bridge  | 21:38:38 [WARNING][back-lawn-cam] WARNING: Skipping smaller frame at start of stream (frame_size=1)
wyze-bridge  | 21:38:38 [WARNING][back-lawn-cam] WARNING: Skipping smaller frame at start of stream (frame_size=1)
wyze-bridge  | 21:38:38 [WARNING][back-lawn-cam] WARNING: Skipping smaller frame at start of stream (frame_size=1)
wyze-bridge  | 21:38:38 [INFO][WyzeBridge] ✅ '/back-lawn-cam stream is UP! (3/3)
wyze-bridge  | 21:38:38 [INFO][WyzeBridge] 📖 New client reading from back-lawn-cam
wyze-bridge  | 21:38:38 [INFO][WyzeBridge] ✅ '/garage-cam stream is UP! (3/3)
wyze-bridge  | 21:38:38 [INFO][WyzeBridge] 📖 New client reading from garage-cam
wyze-bridge  | 21:38:45 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V2 - dog Cam on 192.168.1.63
wyze-bridge  | 21:38:45 [DEBUG][dog-cam] Connect via IOTC_Connect_ByUIDEx
wyze-bridge  | 21:38:48 [INFO][WyzeBridge] [CONTROL] ☁️ Get Device Info for dog-cam via Wyze API
wyze-bridge  | 21:38:48 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 21:38:48 [INFO][WyzeBridge] [CONTROL] ☁️ Get Device Info for kitchen-cam via Wyze API
wyze-bridge  | 21:38:48 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 21:38:49 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/device/get_device_Info HTTP/1.1" 200 938
wyze-bridge  | 21:38:49 [INFO][WyzeBridge] 192.168.1.50 - - [01/May/2024 21:38:49] "GET /api/dog-cam/power HTTP/1.1" 200 -
wyze-bridge  | 21:38:49 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/device/get_device_Info HTTP/1.1" 200 916
wyze-bridge  | 21:38:49 [INFO][WyzeBridge] 192.168.1.50 - - [01/May/2024 21:38:49] "GET /api/kitchen-cam/power HTTP/1.1" 200 -
wyze-bridge  | 21:38:52 [WARNING][dog-cam] [-90] IOTC_ER_DEVICE_OFFLINE
wyze-bridge  | 21:38:52 [INFO][WyzeBridge] 👻 dog Cam is offline.
wyze-bridge  | 21:38:52 [INFO][WyzeBridge] dog Cam will cooldown for 10s.
wyze-bridge  | 21:38:53 [DEBUG][garage-cam] [CONTROL] Attempting to GET: param_info
wyze-bridge  | 21:38:53 [DEBUG][garage-cam] Now listening on channel id 0
wyze-bridge  | 21:38:53 [DEBUG][garage-cam] SEND <K10020CheckCameraParams code=10020 resp_code=10021> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10020 txt_len=10> b'\t\x01\x02\x03\x04\x05\x15\x16\x1b2'
wyze-bridge  | 21:38:53 [DEBUG][back-lawn-cam] [CONTROL] Attempting to GET: param_info
wyze-bridge  | 21:38:53 [DEBUG][back-lawn-cam] Now listening on channel id 0
wyze-bridge  | 21:38:53 [DEBUG][back-lawn-cam] SEND <K10020CheckCameraParams code=10020 resp_code=10021> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10020 txt_len=10> b'\t\x01\x02\x03\x04\x05\x15\x16\x1b2'
wyze-bridge  | 21:38:53 [DEBUG][garage-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10021 txt_len=63>: b'{"1":2,"2":3,"3":120,"4":1,"5":20,"21":2,"22":12,"27":2,"50":2}'
wyze-bridge  | 21:38:53 [INFO][garage-cam] Wrong bitrate=120 does not match 180
wyze-bridge  | 21:38:53 [INFO][garage-cam] Setting bitrate=180
wyze-bridge  | 21:38:53 [DEBUG][garage-cam] SEND <K10052SetBitrate code=10052 resp_code=10053> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10052 txt_len=5> b'\xb4\x00\x00\x00\x00'
wyze-bridge  | 21:38:53 [DEBUG][garage-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10053 txt_len=1>: b'\x02'
wyze-bridge  | 21:38:53 [DEBUG][garage-cam] No longer listening on channel id 0
wyze-bridge  | 21:38:53 [DEBUG][garage-cam] [CONTROL] Response: {'command': 'param_info', 'payload': '1,2,3,4,5,21,22,27,50', 'value': {'1': 2, '2': 3, '3': 120, '4': 1, '5': 20, '21': 2, '22': 12, '27': 2, '50': 2}, 'status': 'success', 'response': {'1': 2, '2': 3, '3': 120, '4': 1, '5': 20, '21': 2, '22': 12, '27': 2, '50': 2}}
wyze-bridge  | 21:38:53 [DEBUG][back-lawn-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10021 txt_len=63>: b'{"1":1,"2":3,"3":180,"4":1,"5":20,"21":2,"22":12,"27":2,"50":1}'
wyze-bridge  | 21:38:54 [DEBUG][back-lawn-cam] No longer listening on channel id 0
wyze-bridge  | 21:38:54 [DEBUG][back-lawn-cam] [CONTROL] Response: {'command': 'param_info', 'payload': '1,2,3,4,5,21,22,27,50', 'value': {'1': 1, '2': 3, '3': 180, '4': 1, '5': 20, '21': 2, '22': 12, '27': 2, '50': 1}, 'status': 'success', 'response': {'1': 1, '2': 3, '3': 180, '4': 1, '5': 20, '21': 2, '22': 12, '27': 2, '50': 1}}
mrlt8 commented 2 months ago

Are you able to view the camera's events in the app?

kiwi-cam commented 2 months ago

Sorry, I'm not sure where I should see events in the app. I assume you're referring to the WebUI?

I don't have event recording on or anything - they just trigger api calls to Scrypted.

mrlt8 commented 2 months ago

The events tab in the Wyze app.

kiwi-cam commented 2 months ago

Ah, yes. I see events in Wyze. They are captured and recorded there.

mrlt8 commented 2 months ago

Thanks, I'll have to double check to see if they made any server side changes.

mrlt8 commented 2 months ago

@kiwi-cam could you see if the latest dev branch works?

kiwi-cam commented 2 months ago

Thanks @mrlt8 for looking into this.

Unfortunately, I'm still seeing similar results:

/var/lib/docker-wyze-bridge $ sudo docker compose up
WARN[0000] /var/lib/docker-wyze-bridge/docker-compose.yml: `version` is obsolete 
[+] Running 1/2
 ✔ Network docker-wyze-bridge_default  Created                                                                     0.2s 
 ⠹ Container wyze-bridge               Created                                                                     0.2s 
Attaching to wyze-bridge
wyze-bridge  | 01:00:13 [WARNING][WyzeBridge] WARNING: invalid escape sequence '\:'
wyze-bridge  | 
wyze-bridge  | 🚀 DOCKER-WYZE-BRIDGE v2.8.3 AARCH64 DEV BUILD [2024-05-03t14:28:04.315z] eb2f645
wyze-bridge  | 
wyze-bridge  | 01:00:13 [INFO][WyzeBridge] 🔍 Could not find local cache for 'auth'
wyze-bridge  | 01:00:13 [INFO][WyzeBridge] ☁️ Fetching 'auth' from the Wyze API...
wyze-bridge  |  * Serving Flask app 'frontend'
wyze-bridge  |  * Debug mode: off
wyze-bridge  | 01:00:13 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): auth-prod.api.wyze.com:443
wyze-bridge  | 01:00:13 [INFO][WyzeBridge] WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
wyze-bridge  |  * Running on all addresses (0.0.0.0)
wyze-bridge  |  * Running on http://127.0.0.1:5000
wyze-bridge  |  * Running on http://172.18.0.2:5000
wyze-bridge  | 01:00:13 [INFO][WyzeBridge] Press CTRL+C to quit
wyze-bridge  | 01:00:15 [DEBUG][WyzeBridge] https://auth-prod.api.wyze.com:443 "POST /api/user/login HTTP/1.1" 200 None
wyze-bridge  | 01:00:15 [INFO][WyzeBridge] 💾 Saving 'auth' to local cache...
wyze-bridge  | 01:00:15 [INFO][WyzeBridge] 🔍 Could not find local cache for 'user'
wyze-bridge  | 01:00:15 [INFO][WyzeBridge] ☁️ Fetching 'user' from the Wyze API...
wyze-bridge  | 01:00:15 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 01:00:16 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/user/get_user_info HTTP/1.1" 200 280
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] 💾 Saving 'user' to local cache...
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] 🔍 Could not find local cache for 'cameras'
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
wyze-bridge  | 01:00:16 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 01:00:16 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/home_page/get_object_list HTTP/1.1" 200 2626
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] [API] Fetched [4] cameras
wyze-bridge  | 01:00:16 [DEBUG][WyzeBridge] [API] cameras=['Kitchen Cam', 'Back Lawn Cam', 'Garage Cam', 'dog Cam']
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] 💾 Saving 'cameras' to local cache...
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] [+] Adding Kitchen Cam [WYZEC1-JZ]
wyze-bridge  | 01:00:16 [DEBUG][WyzeBridge] Using existing thumbnail for kitchen-cam
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] [+] Adding Back Lawn Cam [WYZE_CAKP2JFUS]
wyze-bridge  | 01:00:16 [DEBUG][WyzeBridge] Using existing thumbnail for back-lawn-cam
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] [+] Adding Garage Cam [WYZE_CAKP2JFUS]
wyze-bridge  | 01:00:16 [DEBUG][WyzeBridge] Using existing thumbnail for garage-cam
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] [+] Adding dog Cam [WYZEC1-JZ]
wyze-bridge  | 01:00:16 [DEBUG][WyzeBridge] Using existing thumbnail for dog-cam
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] starting MediaMTX 1.1.1
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] 🎬 8 streams enabled
wyze-bridge  | 01:00:16 [INFO][WyzeBridge] API Motion Events Enabled [interval=3.0]
wyze-bridge  | 01:00:17 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V2 - Kitchen Cam on 192.168.1.61
wyze-bridge  | 01:00:17 [WARNING][WyzeBridge] WARNING: This process (pid=1) is multi-threaded, use of fork() may lead to deadlocks in the child.
wyze-bridge  | 01:00:17 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): app-core.cloud.wyze.com:443
wyze-bridge  | 01:00:17 [DEBUG][kitchen-cam] Connect via IOTC_Connect_ByUIDEx
wyze-bridge  | 01:00:18 [DEBUG][WyzeBridge] https://app-core.cloud.wyze.com:443 "POST /app/v4/device/get_event_list HTTP/1.1" 200 138
wyze-bridge  | 01:00:18 [ERROR][WyzeBridge] [EVENTS] WyzeAPIError: code='1001' msg='User device relationship does not exist.' method=POST path=/app/v4/device/get_event_list, cooling down.
wyze-bridge  | 01:00:19 [WARNING][kitchen-cam] [-90] IOTC_ER_DEVICE_OFFLINE
wyze-bridge  | 01:00:19 [INFO][WyzeBridge] 👻 Kitchen Cam is offline.
wyze-bridge  | 01:00:19 [INFO][WyzeBridge] Kitchen Cam will cooldown for 10s.
wyze-bridge  | 01:00:27 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V2 - dog Cam on 192.168.1.63
wyze-bridge  | 01:00:27 [WARNING][WyzeBridge] WARNING: This process (pid=1) is multi-threaded, use of fork() may lead to deadlocks in the child.
wyze-bridge  | 01:00:27 [DEBUG][dog-cam] Connect via IOTC_Connect_ByUIDEx
wyze-bridge  | 01:00:27 [INFO][WyzeBridge] [CONTROL] ☁️ get_device_Info for dog-cam via Wyze API
wyze-bridge  | 01:00:27 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 01:00:27 [INFO][WyzeBridge] [CONTROL] ☁️ get_device_Info for kitchen-cam via Wyze API
wyze-bridge  | 01:00:27 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 01:00:28 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/device/get_device_Info HTTP/1.1" 200 937
wyze-bridge  | 01:00:28 [INFO][WyzeBridge] 192.168.1.50 - - [04/May/2024 01:00:28] "GET /api/dog-cam/power HTTP/1.1" 200 -
wyze-bridge  | 01:00:28 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/device/get_device_Info HTTP/1.1" 200 912
wyze-bridge  | 01:00:28 [INFO][WyzeBridge] 192.168.1.50 - - [04/May/2024 01:00:28] "GET /api/kitchen-cam/power HTTP/1.1" 200 -
wyze-bridge  | 01:00:29 [WARNING][dog-cam] [-90] IOTC_ER_DEVICE_OFFLINE
wyze-bridge  | 01:00:29 [INFO][WyzeBridge] 👻 dog Cam is offline.
wyze-bridge  | 01:00:29 [INFO][WyzeBridge] dog Cam will cooldown for 10s.
wyze-bridge  | 01:00:30 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V3 - Back Lawn Cam on 192.168.1.62
wyze-bridge  | 01:00:30 [WARNING][WyzeBridge] WARNING: This process (pid=1) is multi-threaded, use of fork() may lead to deadlocks in the child.
wyze-bridge  | 01:00:30 [INFO][WyzeBridge] 🎉 Connecting to WyzeCam V3 - Garage Cam on 192.168.1.111
wyze-bridge  | 01:00:30 [WARNING][WyzeBridge] WARNING: This process (pid=1) is multi-threaded, use of fork() may lead to deadlocks in the child.
wyze-bridge  | 01:00:30 [DEBUG][back-lawn-cam] Connect via IOTC_Connect_ByUIDEx
wyze-bridge  | 01:00:30 [DEBUG][garage-cam] Connect via IOTC_Connect_ByUIDEx
wyze-bridge  | 01:00:31 [INFO][back-lawn-cam] AV Client Start: chan_id=0 expected_chan=0
wyze-bridge  | 01:00:31 [DEBUG][back-lawn-cam] Now listening on channel id 0
wyze-bridge  | 01:00:31 [DEBUG][back-lawn-cam] SEND <K10000ConnectRequest code=10000 resp_code=10001> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10000 txt_len=0> b''
wyze-bridge  | 01:00:31 [DEBUG][back-lawn-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10001 txt_len=17>: b'\x03\x1f?\xf8\xfa\xc6d!r\r\n&\xde~\xf9)l'
wyze-bridge  | 01:00:31 [DEBUG][back-lawn-cam] Sending response: <K10008ConnectUserAuth code=10008 resp_code=10009>
wyze-bridge  | 01:00:31 [DEBUG][back-lawn-cam] SEND <K10008ConnectUserAuth code=10008 resp_code=10009> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10008 txt_len=30> b'\x96O\xedS\x06\xbb\xf1\xbc\x1b\xc6\x10|\xaa\x1c\x10\xde81ad\x01\x00\x074160192'
wyze-bridge  | 01:00:31 [INFO][garage-cam] AV Client Start: chan_id=0 expected_chan=0
wyze-bridge  | 01:00:31 [DEBUG][garage-cam] Now listening on channel id 0
wyze-bridge  | 01:00:31 [DEBUG][back-lawn-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10009 txt_len=732>: b'{"connectionRes":"1","cameraInfo":{"audioParm":{"sampleRate":"16000"},"videoParm":{"type":"H264","bitRate":"30","resolution":"2","fps":"20","horizontalFlip":"1","verticalFlip":"1","logo":"2","time":"1"},"settingParm":{"stateVision":"1","nightVision":"3","osd":"1","logSd":"1","logUdisk":"1", "telnet":"2","tz":"12"},"basicInfo":{"firmware":"4.36.11.8391","type":"camera","hardware":"0.0.0.0","model":"WYZE_CAKP2JFUS","mac":"7C78B221E82F","wifidb":"98"},"channelResquestResult":{"video":"1","audio":"0"},"recordType":{"type":"1"},"sdParm":{"status":"2","capacity":"0","free":"0","detail":"0"},"uDiskParm":{"status":"2","capacity":"0","free":"0"},"apartalarmParm":{"type":"1","startX":"0","longX":"100","startY":"0","heightY":"100"}}}'
wyze-bridge  | 01:00:31 [DEBUG][garage-cam] SEND <K10000ConnectRequest code=10000 resp_code=10001> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10000 txt_len=0> b''
wyze-bridge  | 01:00:31 [DEBUG][back-lawn-cam] SEND <K10056SetResolvingBit code=10056 resp_code=10057> <TutkWyzeProtocolHeader prefix=b'HL' protocol=5 code=10056 txt_len=3> b'\x01\xb4\x00'
wyze-bridge  | 01:00:31 [DEBUG][back-lawn-cam] RECV <TutkWyzeProtocolHeader prefix=b'HL' protocol=36 code=10057 txt_len=1>: b'\x01'

....

wyze-bridge  | 01:00:59 [WARNING][dog-cam] [-90] IOTC_ER_DEVICE_OFFLINE
wyze-bridge  | 01:00:59 [INFO][WyzeBridge] 👻 dog Cam is offline.
wyze-bridge  | 01:00:59 [INFO][WyzeBridge] dog Cam will cooldown for 10s.
  Gracefully stopping... (press Ctrl+C again to force)
[+] Stopping 1/1
 ✔ Container wyze-bridge  Stopped                                                                                 10.7s 
canceled
mrlt8 commented 2 months ago

hmm... I can replicate the error if I put a random mac address, so it seems like one of the cameras isn't getting linked to your account?

Can you try disabling the cameras one at a time to figure out which one it is by removing the names of the cams one at a time?

- FILTER_NAMES=kitchen cam, Back Lawn Cam, Garage Cam, dog Cam
kiwi-cam commented 1 month ago

I've tried everything I can think of. I've Filtered out cameras, one at a time, and no combination would work. I've removed all the camera's from my account and reconfigured them and still nothing works. I even tried with just one camera in my account and got the same thing. I've tried from the account the camera's are configured on, and one with them shared.

Nothing has worked for me.

mrlt8 commented 1 month ago

hmm, any chance you're running the bridge on a VPS or through a commercial VPN? I believe wyze has blocked some IP address in the past.

kiwi-cam commented 1 month ago

Nope. I'm running on a Raspberry Pi and curl ipinfo.io/ip shows my ISP static IP.

I do use an Ad Blocking DNS service so I've changed the DNS settings back to the ISP addresses. Still getting the same error.

mrlt8 commented 1 month ago

Could you see if some of the other cloud-based commands like power/device_info give the same error:

http://localhost:5000/api/<cam-name>/device_info
http://localhost:5000/api/<cam-name>/power
http://localhost:5000/api/<cam-name>/power/restart
kiwi-cam commented 1 month ago

Yes, those all work perfectly. I query the power status programmatically on two of them and that has been working flawlessly - it's just motion alerts failing.

pi@ScryptedPi:~ $ curl http://localhost:5000/api/kitchen-cam/power
{"response":{"pid":"P3","ts":1714971851000,"value":"0"},"status":"success","value":"off"}
pi@ScryptedPi:~ $ curl http://localhost:5000/api/dog-cam/power
{"response":{"pid":"P3","ts":1714971850000,"value":"0"},"status":"success","value":"off"}
pi@ScryptedPi:~ $ curl http://localhost:5000/api/garage-cam/power
{"response":{"pid":"P3","ts":1714876736000,"value":"1"},"status":"success","value":"on"}
pi@ScryptedPi:~ $ curl http://localhost:5000/api/back-lawn-cam/power
{"response":{"pid":"P3","ts":1714874805000,"value":"1"},"status":"success","value":"on"}
mrlt8 commented 1 month ago

This is so strange. @rmaes4 are you still experiencing this?

@kiwi-cam can you try the "reset services" option in the wyze app? You can find it by going to each camera's page then the gear on the top right and the "reset services" option should be at the bottom.

rmaes4 commented 1 month ago

This is so strange. @rmaes4 are you still experiencing this?

@kiwi-cam can you try the "reset services" option in the wyze app? You can find it by going to each camera's page then the gear on the top right and the "reset services" option should be at the bottom.

My issue seemed to go away a while ago.

kiwi-cam commented 1 month ago

@kiwi-cam can you try the "reset services" option in the wyze app? You can find it by going to each camera's page then the gear on the top right and the "reset services" option should be at the bottom.

Nice idea... unfortunately same error

wyze-bridge  | 08:39:45 [INFO][WyzeBridge] starting MediaMTX 1.1.1
wyze-bridge  | 08:39:45 [INFO][WyzeBridge] 🎬 8 streams enabled
wyze-bridge  | 08:39:45 [INFO][WyzeBridge] API Motion Events Enabled [interval=3.0]
wyze-bridge  | 08:39:46 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): app-core.cloud.wyze.com:443
wyze-bridge  | 08:39:46 [DEBUG][WyzeBridge] https://app-core.cloud.wyze.com:443 "POST /app/v4/device/get_event_list HTTP/1.1" 200 138
wyze-bridge  | 08:39:46 [ERROR][WyzeBridge] [EVENTS] WyzeAPIError: code='1001' msg='User device relationship does not exist.' method=POST path=/app/v4/device/get_event_list, cooling down.
kiwi-cam commented 1 month ago

Not sure if this helps, but I just looked at my events list on my.wyze.com and this is the request that shows in the developer tools:

curl 'https://api.wyzecam.com/app/v2/device/get_event_list' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-US,en;q=0.9,en-NZ;q=0.8' \
  -H 'content-type: application/json' \
  -H 'dnt: 1' \
  -H 'origin: https://my.wyze.com' \
  -H 'priority: u=1, i' \
  -H 'referer: https://my.wyze.com/' \
  -H 'sec-ch-ua: "Chromium";v="124", "Microsoft Edge";v="124", "Not-A.Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0' \
  --data-raw '{"begin_time":1714996800000,"count":10000,"device_mac_list":[],"end_time":1715044660434,"event_tag_list":[],"event_type":"1","event_value_list":[],"order_by":2,"phone_system_type":2,"app_name":"com.wyze.webapp","app_ver":"com.wyze.webapp___0.1","app_version":"0.1","phone_id":"redacted","sc":"redacted","sv":"redacted","ts":1715072942538,"access_token":"redacted"}'
mrlt8 commented 1 month ago

The previous builds were using the v2 api, but I've updated it to use the v4 api in the latest dev build.

We actually filter just the cameras that are active to prevent extra lookups.

Can you try filtering just a single camera on my.wyze.com to see if you get a similar error as the bridge?

kiwi-cam commented 1 month ago

That seems to work fine on my.wyze.com too:

This is the request:

curl 'https://api.wyzecam.com/app/v2/device/get_event_list' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-US,en;q=0.9,en-NZ;q=0.8' \
  -H 'content-type: application/json' \
  -H 'dnt: 1' \
  -H 'origin: https://my.wyze.com' \
  -H 'priority: u=1, i' \
  -H 'referer: https://my.wyze.com/' \
  -H 'sec-ch-ua: "Chromium";v="124", "Microsoft Edge";v="124", "Not-A.Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0' \
  --data-raw '{"begin_time":1715083200000,"count":10000,"device_mac_list":["7C78B2redacted"],"end_time":1715169540000,"event_tag_list":[],"event_type":"1","event_value_list":[],"order_by":2,"phone_system_type":2,"app_name":"com.wyze.webapp","app_ver":"com.wyze.webapp___0.1","app_version":"0.1","phone_id":"redacted","sc":"redacted","sv":"redacted","ts":1715111835805,"access_token":"redacted"}'
mrlt8 commented 1 month ago

hmm, I added event_value_list and event_tag_list to the request even though it seems to work without those two.

I also added an ENV option EVENT_API which will let you switch back to the v2 API with EVENT_API=2

kiwi-cam commented 1 month ago

I've added EVENT_API=2 which appears to work.... but I'm getting the same error:

wyze-bridge  | 03:50:38 [INFO][WyzeBridge] starting MediaMTX 1.1.1
wyze-bridge  | 03:50:38 [INFO][WyzeBridge] 🎬 8 streams enabled
wyze-bridge  | 03:50:38 [INFO][WyzeBridge] API Motion Events Enabled [interval=1.5]
wyze-bridge  | 03:50:39 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 03:50:40 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/device/get_event_list HTTP/1.1" 200 138
wyze-bridge  | 03:50:40 [ERROR][WyzeBridge] [EVENTS] WyzeAPIError: code='1001' msg='User device relationship does not exist.' method=POST path=/app/v2/device/get_event_list, cooling down.
kiwi-cam commented 1 month ago

I should have some time this evening. I'll try creating a fresh Wyze account and reconfiguring the cameras on it. I'll let you know how that goes.

kiwi-cam commented 1 month ago

So, I've created a new Wyze account, removed one camera from my main account, and configured that camera under the new account. I've generated an API key and updated wyzebridge to use this new account with one camera attached... and I still get the same error.

mrlt8 commented 1 month ago

I've added a DEBUG_API=True config that should spit out the request for both EVENT_API=2 and EVENT_API=4 which might help us debug what's wrong with our requests.

kiwi-cam commented 1 month ago

Thanks @mrlt8 . Here's the information:

wyze-bridge  | 21:36:37 [INFO][WyzeBridge] 🎬 8 streams enabled
wyze-bridge  | 21:36:37 [INFO][WyzeBridge] API Motion Events Enabled [interval=1.5]
wyze-bridge  | 21:36:38 [DEBUG][WyzeBridge] Starting new HTTPS connection (1): api.wyzecam.com:443
wyze-bridge  | 21:36:39 [DEBUG][WyzeBridge] https://api.wyzecam.com:443 "POST /app/v2/device/get_event_list HTTP/1.1" 200 138
wyze-bridge  | headers: {'user-agent': 'Wyze/2.50.6.1 (iPhone; iOS 17.1.1; Scale/3.00)', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'appversion': '2.50.6.1', 'env': 'prod', 'Content-Length': '1486', 'Content-Type': 'application/json'}
wyze-bridge  | body: b'{"count": 20, "order_by": 1, "begin_time": 1715289658000, "end_time": 1715290658000, "nonce": "1715290598572", "device_mac_list": ["2CAA8EAAD56A", "2CAA8EAAD56A", "2CAA8EAAC74F", "2CAA8EAAC74F", "7C78B2220143", "7C78B2220143", "7C78B221E71F", "7C78B221E71F"], "event_value_list": [], "event_tag_list": [], "sc": "9f275790cab....", "sv": "782ced6909....", "app_ver": "com.hualai.WyzeCam___2.50.6.1", "app_version": "2.50.6.1", "app_name": "com.hualai.WyzeCam", "phone_system_type": 1, "ts": 1715290598572, "access_token": "redacted", "phone_id": "2b431d31-...."}'
wyze-bridge  | 21:36:39 [ERROR][WyzeBridge] [EVENTS] WyzeAPIError: code='1001' msg='User device relationship does not exist.' method=POST path=/app/v2/device/get_event_list, cooling down.

The only thing that jumps out to me is that all the device_mac_list items are duplicated. I suspect that me having - SUBSTREAM=True means that instead of the four camera's being sent, it's sending one per stream?

kiwi-cam commented 1 month ago

GOOD NEWS! I've removed - SUBSTREAM=True and I have motion events again!

mrlt8 commented 1 month ago

Yes, I was also able to replicate the issue by enabling the sub stream!

Temporary fix should be in the dev branch! Thanks again for helping to debug this @kiwi-cam!