keshavdv / unifi-cam-proxy

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

MAC Address Command does not work #50

Closed bobbyjohns closed 3 years ago

bobbyjohns commented 3 years ago

Hi,

So I'm having an issue getting mulitple cameras to run and I think the root of the issue is around the MAC address command. When I use a single camera without the MAC address it runs fine but, as soon as I use the MAC it fails. I dropped the error as normal.

Working unifi-cam-proxy -H 10.0.7.1 -i 10.0.7.147 -c client.pem -t RaO0ZP38JIt6g4jzFbZGYYS2lmtHkq9N rtsp -s 'rtsp://user:pass@10.0.7.147:554/cam/realmonitor?channel=1&subtype=0&unicast=true'

Not-working (without verbose) unifi-cam-proxy -H 10.0.7.1 --mac 'AA:BB:CC:00:11:22' -i 10.0.7.147 -c client.pem -t RaO0ZP38JIt6g4jzFbZGYYS2lmtHk q9N rtsp -s 'rtsp://user:pass@10.0.7.147:554/cam/realmonitor?channel=1&subtype=0&unicast=true' 2021-07-04 16:16:17 raspberrypi RTSPCam[23546] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://user:pass@10.0.7.147:554/cam/realmonitor?channel=1&subtype=0&unicast=true" -vf fps=1 -update 1 /tmp/tmptlohsc5n/screen.jpg 2021-07-04 16:16:17 raspberrypi Core[23546] INFO Creating ws connection to wss://10.0.7.1:7442/camera/1.0/ws?token=RaO0ZP38JIt6g4jzFbZGYYS2lmtHkq9N Traceback (most recent call last): File "/home/pi/.local/bin/unifi-cam-proxy", line 10, in sys.exit(main()) File "/home/pi/.local/lib/python3.7/site-packages/unifi/main.py", line 104, in main loop.run_until_complete(c.run()) File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete return future.result() File "/home/pi/.local/lib/python3.7/site-packages/unifi/core.py", line 67, in run await connect() File "/home/pi/.local/lib/python3.7/site-packages/backoff/_async.py", line 66, in retry ret = await target(*args, **kwargs) File "/home/pi/.local/lib/python3.7/site-packages/unifi/core.py", line 47, in connect subprotocols=["secure_transfer"], File "/home/pi/.local/lib/python3.7/site-packages/websockets/legacy/client.py", line 634, in __await_impl__ extra_headers=protocol.extra_headers, File "/home/pi/.local/lib/python3.7/site-packages/websockets/legacy/client.py", line 388, in handshake raise InvalidStatusCode(status_code) websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 403

bobbyjohns commented 3 years ago

Solved. in order to update the mac address you need to make sure to adopt with that different mac address. once I readopted it worked fine