ep1cman / unifi-protect-backup

Python tool to backup unifi event clips in realtime
MIT License
577 stars 25 forks source link

Cameras no longer detected. #43

Closed Amphiboly closed 1 year ago

Amphiboly commented 1 year ago

Description

Cameras are no longer detected since rolling update from Unifi to 2.5.11 (and through that, Protect 2.1.2). I have five cameras, one of which gets excluded.

What I Did

All was running fine until this morning. I have since uninstalled and (re)installed unifi-protect-backup and pyunifiprotect to ensure that the latest versions are in use. The problem persists.

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: Config: 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: address='192.168.1.102' 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: port=443 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: username='RikKabel' 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: password=REDACTED 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: verify_ssl=False 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: rclone_destination='remote:Unifi' 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: retention='30D' 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: rclone_args='--bwlimit=5M:20M' 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: ignore_cameras=('5ff74f4f0268be03e700045b',) 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: verbose=3 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: detection_types=['motion', 'person', 'vehicle', 'ring'] 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: file_structure_format='{camera_name}/{event.start:%Y-%m-%d}/{event.end:%Y-%m-%dT%H-%M-%S} {detection_type}.mp4' 2022-08-11 22:07:03 [INFO]:unifi_protect_backup.unifi_protect_backup: Starting... 2022-08-11 22:07:03 [INFO]:unifi_protect_backup.unifi_protect_backup: Checking rclone configuration... 2022-08-11 22:07:03 [DEBUG]:unifi_protect_backup.unifi_protect_backup: rclone found: C:\Users\5CD\rclone\rclone.EXE 2022-08-11 22:07:03 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: stdout: remote:

2022-08-11 22:07:03 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: stderr: 2022/08/11 22:07:03 DEBUG : rclone: Version "v1.59.1" starting with parameters ["rclone" "listremotes" "-vv"] 2022/08/11 22:07:03 DEBUG : Using config file from "C:\Users\5CD\AppData\Roaming\rclone\rclone.conf" 2022/08/11 22:07:03 DEBUG : rclone: Version "v1.59.1" finishing with parameters ["rclone" "listremotes" "-vv"]

2022-08-11 22:07:03 [INFO]:unifi_protect_backup.unifi_protect_backup: Connecting to Unifi Protect... 2022-08-11 22:07:03 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:07:03 [INFO]:unifi_protect_backup.unifi_protect_backup: Found cameras: 2022-08-11 22:07:03 [INFO]:unifi_protect_backup.unifi_protect_backup: Setting up purge task... 2022-08-11 22:07:03 [INFO]:unifi_protect_backup.unifi_protect_backup: Listening for events... 2022-08-11 22:08:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:08:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:08:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:08:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:08:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:08:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:09:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:09:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:09:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:09:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:09:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:09:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:10:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:10:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:10:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:10:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:10:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:10:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:11:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:11:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:11:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:11:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:11:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:11:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:11:59 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:11:59 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:11:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:11:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:12:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:12:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:12:59 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:12:59 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:12:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:12:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:13:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:13:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:14:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:14:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:14:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:14:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:14:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:14:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:14:59 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:14:59 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:14:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:14:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:15:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:15:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:16:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:16:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:16:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:16:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:16:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:16:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:17:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:17:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:17:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:17:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:17:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:17:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:18:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:18:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:18:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:18:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:18:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:18:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:18:59 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:18:59 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:18:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:18:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:19:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:19:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:19:59 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:19:59 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:19:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:19:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:20:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:20:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:21:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:21:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:21:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:21:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:21:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:21:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:22:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:22:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:22:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:22:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:22:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:22:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:23:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:23:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:23:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:23:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:23:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:23:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:23:59 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:23:59 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:23:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:23:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:24:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:24:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:25:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:25:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:25:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:25:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:25:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:25:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:25:59 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:25:59 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:25:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:25:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:26:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:26:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:27:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:27:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:27:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:27:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:27:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:27:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:28:00 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:28:00 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:28:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect. 2022-08-11 22:28:00 [WARNING]:unifi_protect_backup.unifi_protect_backup: Attempting reconnect... 2022-08-11 22:28:00 [INFO]:pyunifiprotect.api : Websocket re-connected successfully 2022-08-11 22:28:10 [INFO]:unifi_protect_backup.unifi_protect_backup: Re-established connection to Unifi Protect and to the websocket. 2022-08-11 22:28:59 [EXTRA_DEBUG]:unifi_protect_backup.unifi_protect_backup: Checking the status of the websocket... 2022-08-11 22:28:59 [WARNING]:pyunifiprotect.api : Websocket connection not active, failing back to polling 2022-08-11 22:28:59 [WARNING]:unifi_protect_backup.unifi_protect_backup: Lost connection to Unifi Protect.

-- Rik

ep1cman commented 1 year ago

Have you checked the "assignment" tab on your unifi user? Ubiquiti added it as a way to hide cameras from users a few versions ago

Amphiboly commented 1 year ago

Not sure what you mean by that -- the roles tab has nothing relevant that I can see. In Protect I have four device groups (doorbells, inside, outside, moveable) and have had for a while. The administrator role has view and edit for all of them, and is the ID used by unifi_protect_backup. The notifications log indicates that the protect app was updated 28 July, and the firmware updated at 2AM local yesterday.

ep1cman commented 1 year ago

If you go to the user management page and click a user in the menu that pops up on the right there is an “assignments” tab like so:

8CF09D61-A5A9-4976-9EBC-FEB0E341EA25

Amphiboly commented 1 year ago

I cannot find that menu anywhere. What is the url? (https://\<ip>/protect/????)

ep1cman commented 1 year ago

http://{ip}/users/users then click on the user your are signing into, and a menu appears on the right hand side. In there there should be a “Assignment” tab

Amphiboly commented 1 year ago

Hmmm. On my system, the popup does not have an assignment tab, just overview and settings. This is the case whether I log into a local session or use the portal. I wonder if I have to enable it somewhere. I am researching the issue. Thank you for your patience.

ep1cman commented 1 year ago

I believe it appeared since version v2.0.1 of the protect app. I don’t know any other reason it would not find cameras. I am actually currently on holiday, and will be back on Tuesday. If you haven’t been able to solve it by then we can do a deep dive to try figure it out!

Amphiboly commented 1 year ago

Resolved. I deleted the device groups (probably not necessary) and deleted and recreated the role and user. I logged out of all sessions. Logged in again and it works. I still do not have an assignment tab between overview and settings, but...

ep1cman commented 1 year ago

That’s very curiously. I’ve been experiencing a lot of weirdness like this with unifi protect 2.1, for me I had to disable and re-enable VLANs on my machine despite ping being about to reach the UDM.

Thank you for sharing your solution. If anything else pops up please don’t hesitate to either re-open this issue or open a new one!