question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unifi Protect Dream Machine Pro

See original GitHub issue

Hi,

thanks for the that nice piece of software.

I have some trouble to adopt a camera, because I cant create an adoption token in the Unifi protect settings / dashboard, there is no option to generate or show a token. Bildschirmfoto 2020-09-14 um 11 00 33

If I run the command at the first time: unifi-cam-proxy --host 192.168.XXX.1 --cert client.pem --mac 'AA:BB:CC:00:11:22' --verbose --token '' rtsp -s rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_175k.mov

I get this message: 2020-09-14 11:05:29 unifi-camera-proxy RTSPCam[936] INFO /tmp/tmp93ukHV 2020-09-14 11:05:29 unifi-camera-proxy RTSPCam[936] INFO ffmpeg -y -re -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_175k.mov" -vf fps=1 -update 1 /tmp/tmp93ukHV/screen.jpg 2020-09-14 11:05:29 unifi-camera-proxy Core[936] INFO Creating ws connection to wss://192.168.XXX.1:7442/camera/1.0/ws?token= Traceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 11, in <module> 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

Now I can manually adopt the camera at the Dashboard: Bildschirmfoto 2020-09-14 um 11 06 42 Bildschirmfoto 2020-09-14 um 11 08 10

Now I run the same command a second time unifi-cam-proxy --host 192.168.XXX.1 --cert client.pem --mac 'AA:BB:CC:00:11:22' --verbose --token '' rtsp -s rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_175k.mov

I get this message: 2020-09-14 11:12:00 unifi-camera-proxy RTSPCam[981] INFO /tmp/tmpwKcKgZ 2020-09-14 11:12:00 unifi-camera-proxy RTSPCam[981] INFO ffmpeg -y -re -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_175k.mov" -vf fps=1 -update 1 /tmp/tmpwKcKgZ/screen.jpg 2020-09-14 11:12:00 unifi-camera-proxy Core[981] INFO Creating ws connection to wss://192.168.XXX.1:7442/camera/1.0/ws?token= 2020-09-14 11:12:01 unifi-camera-proxy Core[981] INFO Initiating adoption with token [] and mac [AA:BB:CC:00:11:22] 2020-09-14 11:12:01 unifi-camera-proxy Core[981] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'inResponseTo': 0, 'to': 'UniFiVideo', 'responseExpected': False, 'messageId': 1, 'payload': {'connectionHost': '192.168.XXX.1', 'connectionSecurePort': 7442, 'rebootTimeoutSec': 30, 'name': 'unifi-cam-proxy', 'adoptionCode': '', 'idleTime': 191.96, 'protocolVersion': 67, 'mac': 'AA:BB:CC:00:11:22', 'uptime': 0.04075288772583008, 'fwVersion': 'UVC.S2L.v4.14.14.67.037e886.190630.1017', 'semver': 'v4.4.8', 'ip': '192.168.1.10', 'upgradeTimeoutSec': 150, 'model': 'UVC G3', 'hwrev': 19, 'totalLoad': 0.5474}} 2020-09-14 11:12:01 unifi-camera-proxy Core[981] INFO Processing [ubnt_avclient_hello] message 2020-09-14 11:12:01 unifi-camera-proxy Core[981] DEBUG Message contents: {u'from': u'UniFiVideo', u'functionName': u'ubnt_avclient_hello', u'inResponseTo': 1, u'to': u'ubnt_avclient', u'messageId': 11280, u'payload': {u'controllerName': u'unifi', u'overrideUuid': True, u'protocolVersion': 67}} Traceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 11, in <module> 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 759, in run reconnect = self.process(ws, msg) File "/usr/local/lib/python2.7/dist-packages/unifi/core.py", line 666, in process if m["responseExpected"] == False and m["functionName"] not in [ KeyError: 'responseExpected'

In the message I found a IP that not belongs to me “192.168.1.10”, I found out this is the default camera ip, I dont use this option, because I connect to my cam directly to the rtsp stream like the bunny video.

Please help! What can i Do to get this working?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:57 (18 by maintainers)

github_iconTop GitHub Comments

5reactions
DReffectscommented, Jan 13, 2021

I’ve just stumbled upton this project after realizing that the “NVR” within a UDM Pro is in fact not a NVR but simply a bullshit device to sell more Ubiquiti branded, low-res cameras 😦 Has anyone figured out how to adopt on a UDM Pro?

4reactions
keshavdvcommented, Apr 16, 2021

Ton of refactoring and potential breakages, but the latest version of the branch includes functional motion alerts! You can use automation of your choice to hit the following HTTP endpoints to start and stop motion events which can also trigger push notifications.

$ unifi-cam-proxy --host <NVR IP> --token <token> rtsp -s <source rtsp stream> --http-api 8080
$ curl localhost:8080/start_motion && sleep 10 &&  curl localhost:8080/stop_motion 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dream Machine Pro - Ubiquiti Store
All-in-one, enterprise-grade UniFi OS Console and security gateway designed to host the full UniFi application suite. Connect the Dream Machine Pro with a...
Read more >
UniFi Dream Machine Pro Datasheet - Ubiquiti
The UniFi® Dream Machine Pro is an all-in-one network appliance for a scalable network in an office, retail, or hospitality environment.
Read more >
Unifi Dream Machine Pro (UDM Pro) Review & Setup Guide
To use Unifi Protect on the Dream Machine Pro you will need to install a hard drive. The UDM Pro doesn't come with...
Read more >
UniFi Dream Machine and UniFi Protect Setup Question - Reddit
If you don't want a rack mounted device like the UDM Pro then that is what you will have to do. Unifi cameras...
Read more >
UniFi Dream Machine Pro | The professional solution from ...
UniFi Dream Machine Pro has also been equipped with UniFi Protect software, thanks to which we have an extremely convenient system for monitoring...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found