keshavdv / unifi-cam-proxy

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

Dream Machine, Lorex camera and Raspberry PI #12

Closed jeffmctear closed 3 years ago

jeffmctear commented 3 years ago

Hello,

This mite be a screech and I'm not really a good programmer.

Need little help.

so I install with sudo pip install unifi-cam-proxy

the dream machine doesn't have an easy place to find the auth token. I pulled the support file off the camera and found in the file

"adopted": true, "authToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "cfgver": 1,

my config

sudo unifi-cam-proxy --host 192.168.5.1 --mac 00:40:7F:8B:E2:AF --cert client.pem --token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx rtsp -s rtsp://admin:xxxxxxx@192.168.30.10:554/cam/realmonitor?channel=1&subtype=0

my response back

[2] 2721 [1] Exit 1 unifi-cam-proxy --host 192.168.5.1 --mac 00:40:7F:8B:E2:AF --cert client.pem --token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx rtsp -s rtsp://admin:xxxxxxxx@192.168.30.10:554/cam/realmonitor?channel=1 pi@raspberrypi:~ $ 2021-03-01 22:21:39 raspberrypi RTSPCam[2722] INFO /tmp/tmp8hYEVR 2021-03-01 22:21:39 raspberrypi RTSPCam[2722] INFO ffmpeg -y -re -rtsp_transport tcp -i "rtsp://admin:xxxxxxx@192.168.30.10:554/cam/realmonitor?channel=1" -vf fps=1 -update 1 /tmp/tmp8hYEVR/screen.jpg 2021-03-01 22:21:39 raspberrypi Core[2722] INFO Creating ws connection to wss://192.168.5.1:7442/camera/1.0/ws?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Traceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 10, in sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/unifi/main.py", line 58, in main c.run() File "/usr/local/lib/python2.7/dist-packages/unifi/core.py", line 745, in run ws = websocket.create_connection(uri, sslopt=ssl_opts, header=headers) File "/usr/local/lib/python2.7/dist-packages/websocket/_core.py", line 515, in create_connection websock.connect(url, *options) File "/usr/local/lib/python2.7/dist-packages/websocket/_core.py", line 226, in connect self.handshake_response = handshake(self.sock, addrs, **options) File "/usr/local/lib/python2.7/dist-packages/websocket/_handshake.py", line 80, in handshake status, resp = _get_resp_headers(sock) File "/usr/local/lib/python2.7/dist-packages/websocket/_handshake.py", line 165, in _get_resp_headers raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers) websocket._exceptions.WebSocketBadStatusException: Handshake status 403 Forbidden

not to sure if I'm doing something wrong or script no designed for this hardware.

keshavdv commented 3 years ago

Unfortunately as mentioned in #6, this doesn't support Unifi Protect (UDMP/UNVR) yet.