keshavdv / unifi-cam-proxy

Enable non-Ubiquiti cameras to work with Unifi NVR
MIT License
1.72k stars 236 forks source link

Lorex Camera Panic during motion events #70

Closed excel0n closed 2 years ago

excel0n commented 3 years ago

I've got 7 total Lorex Cameras, Different models (most are the same though) and this one keeps freaking out on motion and shutting down its instance.

2021-08-24 21:55:06 ub-server DahuaCam[3775505] INFO Processing [GetSystemStats] message 2021-08-24 21:55:06 ub-server DahuaCam[3775505] INFO Trigger motion end for index 0 2021-08-24 21:55:06 ub-server DahuaCam[3775505] INFO Triggering motion stop (idx: 0) 2021-08-24 21:55:06 ub-server DahuaCam[3775505] INFO Processing [ChangeSoundLedSettings] message 2021-08-24 21:55:06 ub-server DahuaCam[3775505] INFO Processing [GetRequest] message 2021-08-24 21:55:06 ub-server DahuaCam[3775505] INFO Cleaning up instance Traceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/unifi/main.py", line 109, in main loop.run_until_complete(c.run()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/local/lib/python3.8/dist-packages/unifi/core.py", line 72, in run await connect() File "/usr/local/lib/python3.8/dist-packages/backoff/_async.py", line 66, in retry ret = await target(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/unifi/core.py", line 66, in connect await asyncio.gather(self.cam._run(ws), self.cam.run()) File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 77, in _run force_reconnect = await self.process(msg) File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 848, in process res = await self.process_snapshot_request(m) File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 745, in process_snapshot_request if os.path.isfile(path): File "/usr/lib/python3.8/genericpath.py", line 30, in isfile st = os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

keshavdv commented 3 years ago

Can you share full output with --verbose enabled that includes the "Triggering motion start" debug line? I suspect that the copy here is failing silently. What platform are you running the proxy on?

excel0n commented 3 years ago

I fired up one camera tonight, with the —verbose flag. I’m running it on Ubuntu 20.04. Is there a better version for it? It’s in a VM right now. Thinking of moving it to a PI if i can get it to be reliable.

keshavdv commented 3 years ago

I pushed some related fixes to the main branch. Can you try running these changes using the keshavdv/unifi-cam-proxy:dev Docker image or pip install git+ssh://git@github.com/keshavdv/unifi-cam-proxy.git and seeing if you still see the error? Ubuntu 20.04 should be fine.

excel0n commented 3 years ago

2021-08-27 20:53:54 ub-server DahuaCam[4181604] INFO Trigger motion start for index 0 2021-08-27 20:54:08 ub-server DahuaCam[4181604] INFO Trigger motion end for index 0 2021-08-27 20:54:08 ub-server DahuaCam[4181604] INFO Triggering motion stop (idx: 80) 2021-08-27 20:54:08 ub-server DahuaCam[4181604] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'EventAnalytics', 'inResponseTo': 0, 'messageId': 6214, 'payload': {'clockBestMonotonic': 57978, 'clockBestWall': 1630097634588, 'clockMonotonic': 57978, 'clockStream': 57978, 'clockStreamRate': 1000, 'clockWall': 1630097648011, 'edgeType': 'stop', 'eventId': 80, 'eventType': 'motion', 'levels': {'0': 49}, 'motionHeatmap': 'heatmap.png', 'motionSnapshot': 'motionsnap.jpg'}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-08-27 20:54:08 ub-server DahuaCam[4181604] INFO Trigger motion end for index 0 2021-08-27 20:57:41 ub-server DahuaCam[4181604] INFO Trigger motion start for index 0 2021-08-27 20:57:41 ub-server DahuaCam[4181604] INFO Triggering motion start (idx: 81) 2021-08-27 20:57:41 ub-server DahuaCam[4181604] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'EventAnalytics', 'inResponseTo': 0, 'messageId': 6215, 'payload': {'clockBestMonotonic': 0, 'clockBestWall': 0, 'clockMonotonic': 58191, 'clockStream': 58191, 'clockStreamRate': 1000, 'clockWall': 1630097861167, 'edgeType': 'start', 'eventId': 81, 'eventType': 'motion', 'levels': {'0': 47}, 'motionHeatmap': '', 'motionSnapshot': ''}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-08-27 20:57:41 ub-server DahuaCam[4181604] INFO Trigger motion start for index 0 2021-08-27 20:57:41 ub-server DahuaCam[4181604] INFO Triggering motion start (idx: 81) 2021-08-27 20:57:41 ub-server DahuaCam[4181604] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'EventAnalytics', 'inResponseTo': 0, 'messageId': 6216, 'payload': {'clockBestMonotonic': 0, 'clockBestWall': 0, 'clockMonotonic': 58191, 'clockStream': 58191, 'clockStreamRate': 1000, 'clockWall': 1630097861168, 'edgeType': 'start', 'eventId': 81, 'eventType': 'motion', 'levels': {'0': 47}, 'motionHeatmap': '', 'motionSnapshot': ''}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-08-27 20:57:41 ub-server DahuaCam[4181604] INFO Cleaning up instance 2021-08-27 20:57:41 ub-server DahuaCam[4181604] INFO Stopping stream video2 Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/websockets/legacy/protocol.py", line 761, in transfer_data await asyncio.shield(self._put_message_waiter) asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/unifi/main.py", line 109, in main loop.run_until_complete(c.run()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/local/lib/python3.8/dist-packages/unifi/core.py", line 72, in run await connect() File "/usr/local/lib/python3.8/dist-packages/backoff/_async.py", line 66, in retry ret = await target(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/unifi/core.py", line 66, in connect await asyncio.gather(self.cam._run(ws), self.cam.run()) File "/usr/local/lib/python3.8/dist-packages/unifi/cams/dahua.py", line 112, in run await self.trigger_motion_start() File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 137, in trigger_motion_start await self.send( File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 799, in send await ws.send(json.dumps(msg).encode()) File "/usr/local/lib/python3.8/dist-packages/websockets/legacy/protocol.py", line 471, in send await self.ensure_open() File "/usr/local/lib/python3.8/dist-packages/websockets/legacy/protocol.py", line 726, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason 2021-08-27 20:57:41 ub-server DahuaCam[4181604] INFO Stopping stream video2

This is from prior to trying the updated image. Will do upgrade and retry :D Thank you!!

keshavdv commented 3 years ago

Have you been able to reproduce this on the latest version?

excel0n commented 3 years ago

Keshav,

I apologize, but I have been unable to figure out how to pull/set it up with docker.

On Sun, Sep 5, 2021 at 2:19 PM Keshav Varma @.***> wrote:

Have you been able to reproduce this on the latest version?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/keshavdv/unifi-cam-proxy/issues/70#issuecomment-913229351, or unsubscribe https://github.com/notifications/unsubscribe-auth/APAYS4OWYJOMAHGLSK6AWCLUAPNHRANCNFSM5CXXL7EA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Shaun @.***

keshavdv commented 3 years ago

If you're using a native installation, you can install the latest development code with pip install git+ssh://git@github.com/keshavdv/unifi-cam-proxy.git.

excel0n commented 3 years ago

Keshavdv, So sorry for the delay. Had to rebuild my VM, and re-do my SSH Keys.

Here's the latest pull... This camera stopped working after about 3min...

2021-09-26 10:37:24 ub-server DahuaCam[374666] INFO Processing [ChangeSoundLedSettings] message 2021-09-26 10:37:26 ub-server DahuaCam[374666] INFO Processing [GetRequest] message 2021-09-26 10:37:31 ub-server DahuaCam[374666] INFO Processing [GetRequest] message 2021-09-26 10:37:34 ub-server DahuaCam[374666] INFO Processing [GetSystemStats] message 2021-09-26 10:37:34 ub-server DahuaCam[374666] INFO Processing [NetworkStatus] message 2021-09-26 10:37:39 ub-server DahuaCam[374666] INFO Processing [GetRequest] message 2021-09-26 10:37:40 ub-server DahuaCam[374666] INFO Trigger motion end for index 0 2021-09-26 10:37:40 ub-server DahuaCam[374666] INFO Triggering motion stop (idx: 0) 2021-09-26 10:37:40 ub-server DahuaCam[374666] INFO Trigger motion end for index 0 2021-09-26 10:37:43 ub-server DahuaCam[374666] INFO Trigger motion start for index 0 2021-09-26 10:37:43 ub-server DahuaCam[374666] INFO Triggering motion start (idx: 1) 2021-09-26 10:37:43 ub-server DahuaCam[374666] INFO Trigger motion start for index 0 2021-09-26 10:37:51 ub-server DahuaCam[374666] INFO Trigger motion end for index 0 2021-09-26 10:37:51 ub-server DahuaCam[374666] INFO Triggering motion stop (idx: 1) 2021-09-26 10:37:51 ub-server DahuaCam[374666] INFO Trigger motion end for index 0 2021-09-26 10:38:22 ub-server DahuaCam[374666] INFO Trigger motion start for index 0 2021-09-26 10:38:22 ub-server DahuaCam[374666] INFO Triggering motion start (idx: 2) 2021-09-26 10:38:22 ub-server DahuaCam[374666] INFO Trigger motion start for index 0 2021-09-26 10:38:30 ub-server DahuaCam[374666] INFO Trigger motion end for index 0 2021-09-26 10:38:30 ub-server DahuaCam[374666] INFO Triggering motion stop (idx: 2) 2021-09-26 10:38:30 ub-server DahuaCam[374666] INFO Trigger motion end for index 0 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Trigger motion start for index 0 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Triggering motion start (idx: 3) 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Trigger motion start for index 0 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Triggering motion start (idx: 3) 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Cleaning up instance 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Stopping stream video1 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Stopping stream video2 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Stopping stream video3 Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/websockets/legacy/protocol.py", line 761, in transfer_data await asyncio.shield(self._put_message_waiter) asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/unifi/main.py", line 109, in main loop.run_until_complete(c.run()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/local/lib/python3.8/dist-packages/unifi/core.py", line 72, in run await connect() File "/usr/local/lib/python3.8/dist-packages/backoff/_async.py", line 66, in retry ret = await target(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/unifi/core.py", line 66, in connect await asyncio.gather(self.cam._run(ws), self.cam.run()) File "/usr/local/lib/python3.8/dist-packages/unifi/cams/dahua.py", line 112, in run await self.trigger_motion_start() File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 137, in trigger_motion_start await self.send( File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 799, in send await ws.send(json.dumps(msg).encode()) File "/usr/local/lib/python3.8/dist-packages/websockets/legacy/protocol.py", line 471, in send await self.ensure_open() File "/usr/local/lib/python3.8/dist-packages/websockets/legacy/protocol.py", line 726, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Stopping stream video1 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Stopping stream video2 2021-09-26 10:40:34 ub-server DahuaCam[374666] INFO Stopping stream video3

excel0n commented 3 years ago

Forgot to have Verbose mode on... This one is MUCH Larger...

2021-09-26 10:51:45 ub-server DahuaCam[377315] INFO Processing [ChangeSmartMotionSettings] message 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ChangeSmartMotionSettings', 'messageId': 648352, 'inResponseTo': 0, 'payload': {'enable': True, 'eventMaxDurationMSec': 300000, 'bgmodel': 'default', 'lingerEventStartMSec': 1000, 'lingerEventStopMSec': 3000, 'zones': {'1': {'coord': [0, 0, 1000, 0, 1000, 1000, 0, 1000], 'level': 50}}}} 2021-09-26 10:51:45 ub-server DahuaCam[377315] INFO Processing [EnableLogging] message 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'EnableLogging', 'messageId': 648353, 'inResponseTo': 0, 'payload': {'uri': 'wss://192.168.1.86/camera/1.0/ws'}} 2021-09-26 10:51:45 ub-server DahuaCam[377315] INFO Processing [ChangeDeviceSettings] message 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'ChangeDeviceSettings', 'messageId': 648354, 'inResponseTo': 0, 'payload': {'name': 'FRONT DOOR'}} 2021-09-26 10:51:45 ub-server DahuaCam[377315] INFO Processing [ChangeDeviceSettings] message 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'ChangeDeviceSettings', 'messageId': 648355, 'inResponseTo': 0, 'payload': {'analyticsMode': 'anonymous'}} 2021-09-26 10:51:45 ub-server DahuaCam[377315] INFO Processing [SmartMotionTest] message 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'SmartMotionTest', 'messageId': 648356, 'inResponseTo': 0, 'payload': {'lingerTestStopSec': 0}} 2021-09-26 10:51:45 ub-server DahuaCam[377315] INFO Processing [ChangeVideoSettings] message 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ChangeVideoSettings', 'messageId': 648357, 'inResponseTo': 0, 'payload': {}} 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ChangeVideoSettings', 'inResponseTo': 648357, 'messageId': 15, 'payload': {'audio': {'bitRate': 32000, 'channels': 1, 'description': 'audio track', 'enableTemporalNoiseShaping': False, 'enabled': True, 'mode': 0, 'quality': 0, 'sampleRate': 11025, 'type': 'aac', 'volume': 100}, 'firmwarePath': '/lib/firmware/', 'video': {'enableHrd': False, 'hdrMode': 0, 'lowDelay': False, 'videoMode': 'default', 'mjpg': {'avSerializer': {'destinations': ['file:///tmp/snap.jpeg', 'file:///tmp/snap_av.jpg'], 'parameters': {'audioId': 1000, 'enableTimestampsOverlapAvoidance': False, 'suppressAudio': True, 'suppressVideo': False, 'videoId': 1001}, 'type': 'mjpg'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 500000, 'bitRateVbrMin': None, 'description': 'JPEG pictures', 'enabled': True, 'fps': 5, 'height': 720, 'isCbr': False, 'maxFps': 5, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': None, 'name': 'mjpg', 'quality': 80, 'sourceId': 3, 'streamId': 8, 'streamOrdinal': 3, 'type': 'mjpg', 'validBitrateRangeMax': 6000000, 'validBitrateRangeMin': 32000, 'width': 1280}, 'video1': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 1400000, 'bitRateVbrMax': 2800000, 'bitRateVbrMin': 48000, 'description': 'Hi quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 720, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video1', 'sourceId': 0, 'streamId': 1, 'streamOrdinal': 0, 'type': 'h264', 'validBitrateRangeMax': 2800000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 1280}, 'video2': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 1200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 1200000, 'description': 'Medium quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 400, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video2', 'sourceId': 1, 'streamId': 2, 'streamOrdinal': 1, 'type': 'h264', 'validBitrateRangeMax': 1500000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 720}, 'video3': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 300000, 'bitRateVbrMax': 200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 200000, 'description': 'Low quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 360, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video3', 'sourceId': 2, 'streamId': 4, 'streamOrdinal': 2, 'type': 'h264', 'validBitrateRangeMax': 750000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 640}, 'vinFps': 30}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:51:45 ub-server DahuaCam[377315] INFO Processing [UpdateUsernamePassword] message 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'UpdateUsernamePassword', 'messageId': 648358, 'inResponseTo': 0, 'payload': {'username': 'ubnt', 'hashedPassword': '$6$MWieJwWwiwtXQF2l$zESypMb1HM2qoraZfsEoxG62HCOyGTX9zBWa2H2lZ6a3YqWDT/FLMMEMEs4mW8DTORX5ZMX0B0LmdhbdOi/hd.'}} 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'UpdateUsernamePassword', 'inResponseTo': 648358, 'messageId': 16, 'payload': {}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:51:45 ub-server DahuaCam[377315] INFO Processing [ChangeVideoSettings] message 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ChangeVideoSettings', 'messageId': 648359, 'inResponseTo': 0, 'payload': {'audio': {'bitRate': 64000, 'volume': 100}}} 2021-09-26 10:51:45 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ChangeVideoSettings', 'inResponseTo': 648359, 'messageId': 17, 'payload': {'audio': {'bitRate': 32000, 'channels': 1, 'description': 'audio track', 'enableTemporalNoiseShaping': False, 'enabled': True, 'mode': 0, 'quality': 0, 'sampleRate': 11025, 'type': 'aac', 'volume': 100}, 'firmwarePath': '/lib/firmware/', 'video': {'enableHrd': False, 'hdrMode': 0, 'lowDelay': False, 'videoMode': 'default', 'mjpg': {'avSerializer': {'destinations': ['file:///tmp/snap.jpeg', 'file:///tmp/snap_av.jpg'], 'parameters': {'audioId': 1000, 'enableTimestampsOverlapAvoidance': False, 'suppressAudio': True, 'suppressVideo': False, 'videoId': 1001}, 'type': 'mjpg'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 500000, 'bitRateVbrMin': None, 'description': 'JPEG pictures', 'enabled': True, 'fps': 5, 'height': 720, 'isCbr': False, 'maxFps': 5, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': None, 'name': 'mjpg', 'quality': 80, 'sourceId': 3, 'streamId': 8, 'streamOrdinal': 3, 'type': 'mjpg', 'validBitrateRangeMax': 6000000, 'validBitrateRangeMin': 32000, 'width': 1280}, 'video1': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 1400000, 'bitRateVbrMax': 2800000, 'bitRateVbrMin': 48000, 'description': 'Hi quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 720, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video1', 'sourceId': 0, 'streamId': 1, 'streamOrdinal': 0, 'type': 'h264', 'validBitrateRangeMax': 2800000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 1280}, 'video2': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 1200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 1200000, 'description': 'Medium quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 400, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video2', 'sourceId': 1, 'streamId': 2, 'streamOrdinal': 1, 'type': 'h264', 'validBitrateRangeMax': 1500000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 720}, 'video3': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 300000, 'bitRateVbrMax': 200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 200000, 'description': 'Low quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 360, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video3', 'sourceId': 2, 'streamId': 4, 'streamOrdinal': 2, 'type': 'h264', 'validBitrateRangeMax': 750000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 640}, 'vinFps': 30}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:51:46 ub-server DahuaCam[377315] INFO Processing [GetSystemStats] message 2021-09-26 10:51:46 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetSystemStats', 'messageId': 648367, 'inResponseTo': 0, 'payload': {}} 2021-09-26 10:51:46 ub-server DahuaCam[377315] INFO Processing [NetworkStatus] message 2021-09-26 10:51:46 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'NetworkStatus', 'messageId': 648375, 'inResponseTo': 0, 'payload': {}} 2021-09-26 10:51:46 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'NetworkStatus', 'inResponseTo': 648375, 'messageId': 18, 'payload': {'connectionState': 2, 'connectionStateDescription': 'CONNECTED', 'defaultInterface': 'eth0', 'dhcpLeasetime': 86400, 'dnsServer': '8.8.8.8 4.2.2.2', 'gateway': '192.168.103.1', 'ipAddress': '192.168.55.13', 'linkDuplex': 1, 'linkSpeedMbps': 100, 'mode': 'dhcp', 'networkMask': '255.255.255.0'}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:51:50 ub-server DahuaCam[377315] INFO Processing [GetRequest] message 2021-09-26 10:51:50 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetRequest', 'messageId': 648377, 'inResponseTo': 0, 'payload': {'what': 'snapshot', 'uri': 'https://192.168.1.86:7444/internal/camera-upload/ACwwrAzqPz2nD7lRasENKGCFfkHg0WwQ', 'timeoutMs': 30000}} 2021-09-26 10:51:52 ub-server DahuaCam[377315] INFO Trigger motion start for index 0 2021-09-26 10:51:52 ub-server DahuaCam[377315] INFO Triggering motion start (idx: 0) 2021-09-26 10:51:52 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'EventAnalytics', 'inResponseTo': 0, 'messageId': 19, 'payload': {'clockBestMonotonic': 0, 'clockBestWall': 0, 'clockMonotonic': 16, 'clockStream': 16, 'clockStreamRate': 1000, 'clockWall': 1632678712194, 'edgeType': 'start', 'eventId': 0, 'eventType': 'motion', 'levels': {'0': 47}, 'motionHeatmap': '', 'motionSnapshot': ''}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:51:52 ub-server DahuaCam[377315] INFO Trigger motion start for index 0 2021-09-26 10:51:52 ub-server DahuaCam[377315] DEBUG Uploaded snapshot from /tmp/tmp87r3oluf/screen.jpg 2021-09-26 10:51:52 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'GetRequest', 'inResponseTo': 648377, 'messageId': 20, 'payload': {}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:51:53 ub-server DahuaCam[377315] INFO Processing [ChangeSoundLedSettings] message 2021-09-26 10:51:53 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ChangeSoundLedSettings', 'messageId': 648381, 'inResponseTo': 0, 'payload': {'ledFaceEnabled': 1, 'ledFaceAlwaysOnWhenManaged': 1, 'speakerEnabled': 1, 'systemSoundsEnabled': 0, 'speakerVolume': 80, 'glow': {'mode': 'off'}, 'userLedBlinkPeriodMs': 0, 'userLedOnNoff': 1, 'userLedColorFg': 'blue'}} 2021-09-26 10:51:53 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ChangeSoundLedSettings', 'inResponseTo': 648381, 'messageId': 21, 'payload': {'ledFaceAlwaysOnWhenManaged': 1, 'ledFaceEnabled': 1, 'speakerEnabled': 1, 'speakerVolume': 100, 'systemSoundsEnabled': 1, 'userLedBlinkPeriodMs': 0, 'userLedColorFg': 'blue', 'userLedOnNoff': 1}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:51:56 ub-server DahuaCam[377315] INFO Processing [GetRequest] message 2021-09-26 10:51:56 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetRequest', 'messageId': 648382, 'inResponseTo': 0, 'payload': {'what': 'snapshot', 'uri': 'https://192.168.1.86:7444/internal/camera-upload/cFRgvn0jqnKLbf8sZglCojM1uMcWkVI8', 'timeoutMs': 30000}} 2021-09-26 10:51:57 ub-server DahuaCam[377315] DEBUG Uploaded snapshot from /tmp/tmp87r3oluf/screen.jpg 2021-09-26 10:51:57 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'GetRequest', 'inResponseTo': 648382, 'messageId': 22, 'payload': {}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:51:57 ub-server DahuaCam[377315] INFO Processing [GetSystemStats] message 2021-09-26 10:51:57 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetSystemStats', 'messageId': 648389, 'inResponseTo': 0, 'payload': {}} 2021-09-26 10:51:57 ub-server DahuaCam[377315] INFO Processing [NetworkStatus] message 2021-09-26 10:51:57 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'NetworkStatus', 'messageId': 648396, 'inResponseTo': 0, 'payload': {}} 2021-09-26 10:51:57 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'NetworkStatus', 'inResponseTo': 648396, 'messageId': 23, 'payload': {'connectionState': 2, 'connectionStateDescription': 'CONNECTED', 'defaultInterface': 'eth0', 'dhcpLeasetime': 86400, 'dnsServer': '8.8.8.8 4.2.2.2', 'gateway': '192.168.103.1', 'ipAddress': '192.168.55.13', 'linkDuplex': 1, 'linkSpeedMbps': 100, 'mode': 'dhcp', 'networkMask': '255.255.255.0'}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:52:02 ub-server DahuaCam[377315] INFO Processing [GetRequest] message 2021-09-26 10:52:02 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetRequest', 'messageId': 648414, 'inResponseTo': 0, 'payload': {'what': 'snapshot', 'uri': 'https://192.168.1.86:7444/internal/camera-upload/TP5o9eVENgr4qlEUuiwW2575arcD9Un4', 'timeoutMs': 30000}} 2021-09-26 10:52:04 ub-server DahuaCam[377315] DEBUG Uploaded snapshot from /tmp/tmp87r3oluf/screen.jpg 2021-09-26 10:52:04 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'GetRequest', 'inResponseTo': 648414, 'messageId': 24, 'payload': {}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:52:05 ub-server DahuaCam[377315] INFO Trigger motion end for index 0 2021-09-26 10:52:05 ub-server DahuaCam[377315] INFO Triggering motion stop (idx: 0) 2021-09-26 10:52:05 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'EventAnalytics', 'inResponseTo': 0, 'messageId': 25, 'payload': {'clockBestMonotonic': 28, 'clockBestWall': 1632678712194, 'clockMonotonic': 28, 'clockStream': 28, 'clockStreamRate': 1000, 'clockWall': 1632678725032, 'edgeType': 'stop', 'eventId': 0, 'eventType': 'motion', 'levels': {'0': 49}, 'motionHeatmap': 'heatmap.png', 'motionSnapshot': 'motionsnap.jpg'}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:52:05 ub-server DahuaCam[377315] INFO Processing [ChangeSoundLedSettings] message 2021-09-26 10:52:05 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ChangeSoundLedSettings', 'messageId': 648415, 'inResponseTo': 0, 'payload': {'ledFaceEnabled': 1, 'ledFaceAlwaysOnWhenManaged': 1, 'speakerEnabled': 1, 'systemSoundsEnabled': 0, 'speakerVolume': 80, 'glow': {'mode': 'off'}, 'userLedBlinkPeriodMs': 0, 'userLedOnNoff': 1, 'userLedColorFg': 'blue'}} 2021-09-26 10:52:05 ub-server DahuaCam[377315] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ChangeSoundLedSettings', 'inResponseTo': 648415, 'messageId': 26, 'payload': {'ledFaceAlwaysOnWhenManaged': 1, 'ledFaceEnabled': 1, 'speakerEnabled': 1, 'speakerVolume': 100, 'systemSoundsEnabled': 1, 'userLedBlinkPeriodMs': 0, 'userLedColorFg': 'blue', 'userLedOnNoff': 1}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-09-26 10:52:05 ub-server DahuaCam[377315] INFO Processing [GetRequest] message 2021-09-26 10:52:05 ub-server DahuaCam[377315] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetRequest', 'messageId': 648416, 'inResponseTo': 0, 'payload': {'what': 'motionSnapshot', 'filename': 'motionsnap.jpg', 'uri': 'https://192.168.1.86:7444/internal/camera-upload/iZ8N3fV44OrKJ12GTUNA0gKqZw9GMj0t', 'timeoutMs': 30000}} 2021-09-26 10:52:05 ub-server DahuaCam[377315] INFO Cleaning up instance Traceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/unifi/main.py", line 109, in main loop.run_until_complete(c.run()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/local/lib/python3.8/dist-packages/unifi/core.py", line 72, in run await connect() File "/usr/local/lib/python3.8/dist-packages/backoff/_async.py", line 66, in retry ret = await target(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/unifi/core.py", line 66, in connect await asyncio.gather(self.cam._run(ws), self.cam.run()) File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 77, in _run force_reconnect = await self.process(msg) File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 848, in process res = await self.process_snapshot_request(m) File "/usr/local/lib/python3.8/dist-packages/unifi/cams/base.py", line 745, in process_snapshot_request if os.path.isfile(path): File "/usr/lib/python3.8/genericpath.py", line 30, in isfile st = os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.