Control camera IR

Posted on
Sun Nov 04, 2018 12:01 pm
lochnesz offline
Posts: 370
Joined: Oct 01, 2014
Location: Stockholm, Sweden

Re: Control camera IR

It is a Ubiquiti hardware NVR
[code]root@UniFi-Video:~# uname -a
Linux UniFi-Video 3.18.26-ubnt #1 SMP Fri Jan 29 09:21:00 UTC 2016 x86_64 GNU/Linux/code]

I am not following, where do I change to "request"? I looked in the plugin, and probably it is right before my eyes, but I don't see where to make the change.

Thanks!

Posted on
Sun Nov 04, 2018 12:11 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Control camera IR

in config:
Screen Shot 2018-11-04 at 12.09.08.png
Screen Shot 2018-11-04 at 12.09.08.png (20.46 KiB) Viewed 2175 times

and could you try in a terminal window:
Code: Select all
/usr/bin/curl --insecure -c /tmp/nvrCookie --data '{"username": "xxx", "password": "xxx"}' https://192.168.9.35:7443/api/login
with your userid and password for the NVR unix box

and could you do a sys update on the unix box?

karl

Posted on
Sun Nov 04, 2018 12:47 pm
lochnesz offline
Posts: 370
Joined: Oct 01, 2014
Location: Stockholm, Sweden

Re: Control camera IR

I thought that the controller info was for the USG, so I disabled that during these tests. However, the IP address there is for the USG.
I changed to python requests, but it doesn't work, I get this message.

Code: Select all
4 Nov 2018 at 19:42:42
   Action Group                    carport ir off
   uniFiAP                         in Line '1451' has error='[Errno 1] _ssl.c:499: error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message'
   Connection                      in Line '3711' has error='[Errno 1] _ssl.c:499: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol'


I am thinking about removing all config and starting from the beginning with new config. Do I need to configure a USG controller in the plugin if I only want to test Unifi Video? I have a USG, but I was thinking of having a clean config just to get the NVR working first.

Posted on
Sun Nov 04, 2018 12:57 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Control camera IR

that error message seems to be kind of the same problem. SSL on the NVR box is different or on your MAC
Which OSX are you running ?

it should work w/o the controller


Karl

Posted on
Sun Nov 04, 2018 1:01 pm
lochnesz offline
Posts: 370
Joined: Oct 01, 2014
Location: Stockholm, Sweden

Re: Control camera IR

I am on 10.7.5. I will move to a newer Mac soon, I can't run a newer OS on this hardware. Just need to find the time...
So my MacOS release might be the problem?

Posted on
Sun Nov 04, 2018 1:18 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Control camera IR

well it might be both ...

10.7 only supports open SSL v 1.0.x (which is used by the installed python/requests) .. newer web servers require higher level SSL.. thats why I added cURL.


try: curl -V to get the installed cUrl version

If you have a newer MAC / laptop ( eg sierra) try
Code: Select all
/usr/bin/curl --insecure -c /tmp/nvrCookie --data '{"username": "xxx", "password": "xxx"}' https://192.168.9.35:7443/api/login
there . If that works its the MAC if not its the NVR

you might want to reinstall curl (a newer version .. comes with its own SSSL libs) on you mac : https://simonecarletti.com/blog/2016/01/http2-curl-macosx/ but that will install cURL in /usr/local/bin/curl .. but we can add that option to point there

when / if you have installed a newer version of curl try:
Code: Select all
/usr/local/bin/curl--insecure -c /tmp/nvrCookie --data '{"username": "xxx", "password": "xxx"}' https://192.168.9.35:7443/api/login

Posted on
Sun Nov 04, 2018 3:00 pm
lochnesz offline
Posts: 370
Joined: Oct 01, 2014
Location: Stockholm, Sweden

Re: Control camera IR

You are correct, I only get the error with the old MacOS. I tried to install a new version of curl but ran into an error when the dependency cunit was about to download.

Code: Select all
==> Installing curl dependency: cunit
==> Downloading https://downloads.sourceforge.net/project/cunit/CUnit/2.1-3/CUnit-2.1-3.tar.bz2

curl: (35) Unknown SSL protocol error in connection to downloads.sourceforge.net:443
Error: Failed to download resource "cunit"
Download failed: https://downloads.sourceforge.net/project/cunit/CUnit/2.1-3/CUnit-2.1-3.tar.bz2

I am not sure what to do about it.

I think I will make the Indigo move to my new Mac instead, now I know that it will probably work fine with UniFiAP one I have made the move.

Thanks for all your support!

Posted on
Sun Nov 04, 2018 3:19 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Control camera IR

so you even can not download (w ssl) any new software !!! .. yes I guess then its time to go to new hw/opsys

Posted on
Sun Nov 04, 2018 5:37 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Control camera IR

last thing you could try is to copy the curl executable from your laptop to /usr/bin/curl on your indigo mac (make a copy first) ..
then try it again

if it is self-contained it might work .. if it calls on other libs likely not


Karl

Posted on
Wed Nov 07, 2018 1:08 pm
lochnesz offline
Posts: 370
Joined: Oct 01, 2014
Location: Stockholm, Sweden

Re: Control camera IR

I installed it on my newer Mac, and I can now control the IR on my cameras :D
I do get some error messages on plugin start, what can be causing these errors?
Code: Select all
Starting plugin "uniFiAP 7.25.143" (pid 9394)
   uniFiAP                         setting parameters for indigo version: >>7<<
   Started plugin "uniFiAP 7.25.143"
   uniFiAP                         initializing    ... variables
  deleted...
   uniFiAP                         initialized ... looping
Last edited by lochnesz on Wed Nov 14, 2018 4:20 pm, edited 1 time in total.

Posted on
Wed Nov 07, 2018 5:16 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Control camera IR

have you set the site name? .. default is "default" ....


switch on debug for (6) I believe , you then should see the complete connect string (then do print/ get info ... first item thats the same command that is executed at the beginning )

Karl
Attachments
Screen Shot 2018-11-07 at 17.15.50.png
Screen Shot 2018-11-07 at 17.15.50.png (14.95 KiB) Viewed 2079 times
Screen Shot 2018-11-07 at 17.13.56.png
Screen Shot 2018-11-07 at 17.13.56.png (18.15 KiB) Viewed 2079 times

Posted on
Sun Nov 11, 2018 8:05 am
lochnesz offline
Posts: 370
Joined: Oct 01, 2014
Location: Stockholm, Sweden

Re: Control camera IR

The site matches with NVR and Indigo config.

What do you mean by
first item thats the same command that is executed at the beginning


What option should I chose?

Another thing that I noticed is that two cameras that I have removed from the Unifi NVR shows up as cameras in Indigo. Is that correct?
Attachments
Screenshot 2018-11-11 at 15.01.06.png
Screenshot 2018-11-11 at 15.01.06.png (231.39 KiB) Viewed 2018 times

Posted on
Sun Nov 11, 2018 8:15 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Control camera IR

Click on to top / first button “get ....

Deleting cameras on the nvr web page does not delete cameras from its internal dB. So when indigo gets the dB dump the deleted cameras are still there.

I have moved an old camera to a junk folder.

Have not figured out how to jd deleted caneras.

Karl.


Sent from my iPhone using Tapatalk

Posted on
Sun Nov 11, 2018 8:34 am
lochnesz offline
Posts: 370
Joined: Oct 01, 2014
Location: Stockholm, Sweden

Re: Control camera IR

Ah, I see. I am sending you the output as a PM.

The thing is that everything works as far as I can see, it is just that the error message appears quite frequently in the log. Maybe something isn't working that I haven't noticed?

Thanks!

Posted on
Sun Nov 11, 2018 10:42 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Control camera IR

you have 3 IDs defined on the NVR, one has a apiKey disabled. -see >>>> <<<<<

Code: Select all
[
This one has access disabled and very little other things enabled
{u'enablePush': True, u'enableEmail': True, u'userGroupId': u'xx', u'disabled': False, u'sysDisconnectPushAlert': True, >>>>u'enableApiAccess': False, <<<<<u'enableLocalAccess': True, u'adoptionKey': u'TypdrChV', u'_id': u'xx', u'sysDisconnectEmailAlert': True, u'motionAlertSchedules': {}, u'accountId': u'xx'},


these are ok , but do you need 2?
 {u'sysDisconnectPushAlert': True, u'mobileKey': xx', u'apiKey': xx', u'enableEmail': True, u'userGroupId': u'xx', u'subscribedCameraConnection': [u'xx', u'xx', u'xx'], u'disabled': False, u'enablePush': True, u'enableApiAccess': True, u'enableLocalAccess': True, u'motionAlertSchedules': {}, u'_id': u'xx', u'sysDisconnectEmailAlert': True, u'adoptionKey': xx', u'accountId': u'xx'},
 {u'sysDisconnectPushAlert': True, u'apiKey': u'xx', u'enableEmail': False, u'userGroupId': u'xx', u'disabled': False, u'enablePush': True, u'enableApiAccess': True, u'enableLocalAccess': True, u'motionAlertSchedules': {}, u'_id': u'xx', u'sysDisconnectEmailAlert': True, u'adoptionKey': xx', u'accountId': u'xx'}]


I am adding an " if not enableApiAccess:" to skip these IDs
I was trying to catch apiKey not defined.

look at it as a warning for now, not an error, will suppress if not debug video enabled in next release


Karl

Who is online

Users browsing this forum: No registered users and 6 guests