Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera streams and snapshots no longer work after 2.3.5 with any Wyze cameras #902

Open
ZacTyAdams opened this issue Jul 7, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@ZacTyAdams
Copy link

ZacTyAdams commented Jul 7, 2023

Bridge is able to query api for list of cameras, but when connecting for a snapshot or stream, the log shows:
IOTC_ER_TIMEOUT

[WyzeBridge] ⏰ Timed out connecting to Living Room Cam.
[WyzeBridge] ⏰ Timed out connecting to Backyard Camera.

Have tested against versions 2.3.5 -> 2.3.8

The cameras do have a connection to Wyze servers and are viewable from the mobile app. Streams and snapshots stopped working roughly around 6/30/23 and no other errors show in the logs outside of the timeout error.

@mrlt8
Copy link
Owner

mrlt8 commented Jul 7, 2023

Do you have the camera data cached? Can you run the container with FRESH_DATA or clear the data from the webUI using the /restart/all endpoint?

@ZacTyAdams
Copy link
Author

ZacTyAdams commented Jul 7, 2023 via email

@ZacTyAdams
Copy link
Author

ZacTyAdams commented Jul 17, 2023

Just an update, I noticed this error in the logs when trying a restart and clear cache:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/frontend.py", line 227, in restart_bridge
    wb.run(fresh_data=True)
  File "/app/wyze_bridge.py", line 36, in run
    self.streams.monitor_streams(self.rtsp.health_check)
  File "/app/wyzebridge/stream.py", line 98, in monitor_streams
    self.thread.start()
  File "/usr/local/lib/python3.11/threading.py", line 952, in start
    raise RuntimeError("threads can only be started once")
RuntimeError: threads can only be started once```

@mrlt8
Copy link
Owner

mrlt8 commented Jul 18, 2023

Can you post the version of the bridge you're using when getting that error?

@ZacTyAdams
Copy link
Author

This is tested against 2.3.5+ with the error message there being from 2.3.10.

@mrlt8
Copy link
Owner

mrlt8 commented Jul 19, 2023

Thanks @ZacTyAdams! The threading issue should be fixed in the next release.

mrlt8 added a commit that referenced this issue Jul 19, 2023
@ZacTyAdams
Copy link
Author

Perfect thank you @mrlt8, I'll test again with the next release and the cameras on a new router as well.

mrlt8 added a commit that referenced this issue Jul 20, 2023
* cache build

* Catch and disable MQTT on name resolution error

* Doorbell quick response

* Set camera time zone #916

* Set timezone on camera #916

* OSD toggle for logo/timestamp

* Add K10006 auth #742

* Fix /time_zone/get and return offset #916

* convert TZ offset to hours #916

* custom video filter #919

* Resend discovery message on HA online #907 #920

* Revert K10006 for WYZEDB3 #742

* Add more MQTT entities #921 #922

* Return json response/value for commands #835

* Fix threading issue on restart #902

* Fix SET cruise_points over MQTT

* SET cruise_point #835

* split into multiple jobs

* changelog
@DrDavy
Copy link

DrDavy commented Jul 20, 2023

I updated to 2.3.11 since I was also having the same issue but now the container does not start with "RuntimeError: can't start new thread"

Full snip of output is below

wyze-bridge | 🚀 DOCKER-WYZE-BRIDGE v2.3.11
wyze-bridge |
wyze-bridge | Traceback (most recent call last):
wyze-bridge | File "/usr/local/bin/flask", line 8, in
wyze-bridge | sys.exit(main())
wyze-bridge | ^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 1063, in main
wyze-bridge | cli.main()
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
wyze-bridge | rv = self.invoke(ctx)
wyze-bridge | ^^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
wyze-bridge | return _process_result(sub_ctx.command.invoke(sub_ctx))
wyze-bridge | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
wyze-bridge | return ctx.invoke(self.callback, **ctx.params)
wyze-bridge | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
wyze-bridge | return __callback(*args, **kwargs)
wyze-bridge | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/click/decorators.py", line 92, in new_func
wyze-bridge | return ctx.invoke(f, obj, *args, **kwargs)
wyze-bridge | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
wyze-bridge | return __callback(*args, **kwargs)
wyze-bridge | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 911, in run_command
wyze-bridge | raise e from None
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 897, in run_command
wyze-bridge | app = info.load_app()
wyze-bridge | ^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 308, in load_app
wyze-bridge | app = locate_app(import_name, name)
wyze-bridge | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 235, in locate_app
wyze-bridge | return find_best_app(module)
wyze-bridge | ^^^^^^^^^^^^^^^^^^^^^
wyze-bridge | File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 63, in find_best_app
wyze-bridge | app = app_factory()
wyze-bridge | ^^^^^^^^^^^^^
wyze-bridge | File "/app/frontend.py", line 38, in create_app
wyze-bridge | wb.start()
wyze-bridge | File "/usr/local/lib/python3.11/threading.py", line 957, in start
wyze-bridge | _start_new_thread(self._bootstrap, ())
wyze-bridge | RuntimeError: can't start new thread

@ZacTyAdams
Copy link
Author

Yeah, no change here. I've changed routers in the home and removed then readded the camera to my Wyze app but still getting that timeout issue.

[WyzeBridge] [+] Adding Living Room Cam [HL_PAN2]
[WyzeBridge] [+] Adding Backyard Camera [HL_PAN2]
[WyzeBridge] starting MediaMTX 0.23.8
[WyzeBridge] 🎬 3 streams enabled
[WyzeBridge] 🎉 Connecting to WyzeCam Pan - Wyze Cam Pan on 192.168.1.23
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V2 - Living Room Cam on 192.168.1.104
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V2 - Backyard Camera on 192.168.1.200
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET / HTTP/1.1" 200 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /static/site.css HTTP/1.1" 304 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /static/loading.svg HTTP/1.1" 200 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /img/living-room-cam.jpg HTTP/1.1" 304 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /img/backyard-camera.jpg HTTP/1.1" 304 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /static/site.js HTTP/1.1" 304 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /img/living-room-cam.jpg HTTP/1.1" 200 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /img/backyard-camera.jpg HTTP/1.1" 200 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /api/sse_status HTTP/1.1" 200 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /img/living-room-cam.jpg HTTP/1.1" 304 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:01] "GET /img/backyard-camera.jpg HTTP/1.1" 304 -
[WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
[WyzeBridge] 💾 Saving 'cameras' to local cache...
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:13] "GET /img/wyze-cam-pan.jpg HTTP/1.1" 307 -
[WyzeBridge] ⏰ Timed out connecting to Wyze Cam Pan.
[WyzeBridge] ⏰ Timed out connecting to Living Room Cam.
[WyzeBridge] ⏰ Timed out connecting to Backyard Camera.
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:28] "GET /img/wyze-cam-pan.jpg HTTP/1.1" 307 -
[WyzeBridge] 🎉 Connecting to WyzeCam Pan - Wyze Cam Pan on 192.168.1.23
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V2 - Living Room Cam on 192.168.1.104
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V2 - Backyard Camera on 192.168.1.200
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:31] "GET /img/loading.svg HTTP/1.1" 307 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:31] "GET /img/loading.svg HTTP/1.1" 307 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:43] "GET /snapshot/living-room-cam.jpg?1689871591703= HTTP/1.1" 307 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:43] "GET /snapshot/backyard-camera.jpg?1689871591705= HTTP/1.1" 307 -
[WyzeBridge] Stopping 3 streams
[WyzeBridge] Stopping MediaMTX...
ice ERROR: 2023/07/20 11:46:47 Failed to read UDP packet: read udp [::]:8189: use of closed network connection
[WyzeBridge] Stream monitoring stopped
[WyzeBridge] ☁️ Fetching 'auth' from the Wyze API...
[WyzeBridge] ♻️ Clearing local cache...
[WyzeBridge] 🔍 Could not find local cache for 'cameras'
[WyzeBridge] 🔍 Could not find local cache for 'cameras'
[WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
[WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
[WyzeBridge] 🔍 Could not find local cache for 'auth'
[WyzeBridge] 🔍 Could not find local cache for 'auth'
[WyzeBridge] ☁️ Fetching 'auth' from the Wyze API...
[WyzeBridge] ☁️ Fetching 'auth' from the Wyze API...
[WyzeBridge] 🎉 Connecting to WyzeCam Pan - Wyze Cam Pan on 192.168.1.23
[WyzeBridge] 🔍 Could not find local cache for 'cameras'
[WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
[WyzeBridge] 🔍 Could not find local cache for 'auth'
[WyzeBridge] ☁️ Fetching 'auth' from the Wyze API...
[WyzeBridge] 💾 Saving 'auth' to local cache...
[WyzeBridge] 🔍 Could not find local cache for 'user'
[WyzeBridge] ☁️ Fetching 'user' from the Wyze API...
[WyzeBridge] 💾 Saving 'auth' to local cache...
[WyzeBridge] 💾 Saving 'auth' to local cache...
[WyzeBridge] 💾 Saving 'auth' to local cache...
[WyzeBridge] 💾 Saving 'user' to local cache...
[WyzeBridge] 🔍 Could not find local cache for 'cameras'
[WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
[WyzeBridge] 💾 Saving 'cameras' to local cache...
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:59] "GET /snapshot/living-room-cam.jpg?1689871591703= HTTP/1.1" 307 -
[WyzeBridge] 💾 Saving 'cameras' to local cache...
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:59] "GET /img/wyze-cam-pan.jpg HTTP/1.1" 307 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:59] "GET /img/wyze-cam-pan.jpg HTTP/1.1" 307 -
[WyzeBridge] 💾 Saving 'cameras' to local cache...
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:46:59] "GET /snapshot/backyard-camera.jpg?1689871591705= HTTP/1.1" 307 -
[WyzeBridge] 💾 Saving 'cameras' to local cache...
[WyzeBridge] [+] Adding Office Cam [WYZECP1_JEF]
[WyzeBridge] [+] Adding Living Room Cam [HL_PAN2]
[WyzeBridge] [+] Adding Backyard Camera [HL_PAN2]
[WyzeBridge] starting MediaMTX 0.23.8
[WyzeBridge] 🎬 4 streams enabled
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V2 - Living Room Cam on 192.168.1.104
[WyzeBridge] 🎉 Connecting to WyzeCam Pan V2 - Backyard Camera on 192.168.1.200
[WyzeBridge] 🎉 Connecting to WyzeCam Pan - Office Cam on 192.168.1.23
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:47:01] "GET /img/loading.svg HTTP/1.1" 307 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:47:01] "GET /img/loading.svg HTTP/1.1" 307 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:47:16] "GET /snapshot/backyard-camera.jpg?1689871621706= HTTP/1.1" 307 -
[WyzeBridge] 172.30.32.2 - - [20/Jul/2023 11:47:16] "GET /snapshot/living-room-cam.jpg?1689871621703= HTTP/1.1" 307 -
[WyzeBridge] ⏰ Timed out connecting to Wyze Cam Pan.
[office-cam] [-13] IOTC_ER_TIMEOUT
[living-room-cam] [-13] IOTC_ER_TIMEOUT
[backyard-camera] [-13] IOTC_ER_TIMEOUT

@DrDavy
Copy link

DrDavy commented Jul 20, 2023

@ZacTyAdams I think we may have different issues with similar symptoms, my container wont even stay up :)
I have an older docker engine it seems anyways so I will probably try to update it and see if I get further
EDIT
My issue was fixed with a reinstall of Docker (Also update but I was using a version from Debian 10 :| )

@ZacTyAdams
Copy link
Author

@DrDavy Yeah this issue from the beginning seems to be something with the Wyze API. The restart and clear cache was one of the roadblocks though.

@mrlt8 mrlt8 added the bug Something isn't working label Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants