Unify-Video on Debian

Posted on
Tue Oct 02, 2018 4:41 pm
stevenu offline
Posts: 20
Joined: Nov 21, 2013
Location: SF, California

Unify-Video on Debian

I am a big user with both Indigo and Ubiquity. Your plugin is great. The video servers that I have are all running on separate boxes on Debian. Not on a off the shelf Ubiquity NVR or a virtual box.

Two options seem to be;
--- only if you use Unify Video - NVR
and
--- only if you use VM machine


When I use the first with userid, password, ip address
I keep getting;

ssh response, tags ['welcome', 'unifi', 'edge', 'busybox', 'ubiquiti', 'ubnt'] not found :

My systems are responding with <userid>@<ip_address>'s password:

The script doesn't seem to be able to get past the password; prompt

Any input would be great.

Posted on
Tue Oct 02, 2018 5:45 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Unify-Video on Debian

Before it does all the things It tests the response.

If it does not find a string that is acceptable it rejects it and does not continue.

So >>>after<<< you login. What is a text string it can look for.




Sent from my iPhone using Tapatalk
this is the EXPECT script to login.


Code: Select all
set userID [lindex $argv 0 ]
set password [lindex $argv 1 ]
set ipNumber [lindex $argv 2 ]

set timeout 15
spawn  ssh $userID@$ipNumber
expect {
    "(yes/no)? " {
        send "yes\n"
        sleep 0.1
        expect "assword" { send "$password\n"}
    }
    "assword: " {
        send "$password\n"
    }
}

send "exit\r"
sleep 0.1
expect eof


can you try: open terminal on the indigo mac and
Code: Select all
expect '/Library/Application Support/Perceptive Automation/Indigo 7.2/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/test.exp' userid password ipnumber


and see if it can login.

Posted on
Wed Oct 03, 2018 6:13 pm
stevenu offline
Posts: 20
Joined: Nov 21, 2013
Location: SF, California

Re: Unifi-Video on Debian

The first part I got through after finding out passwords with special characters are not liked. Once I put the password in single quotes, it went through.

Now there is an exit before the prompt is displayed and then a second.
~~~~~~~~~~~~~~~~~~~
mini-me:~ stevenu$ expect '/Library/Application Support/Perceptive Automation/Indigo 7.2/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/test.exp' stevenu ubntindigo 172.16.96.150
spawn ssh stevenu@172.16.96.150
stevenu@172.16.96.150's password:
exit

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Oct 3 16:44:56 2018 from 172.16.96.47
stevenu@magevid1:~$ exit
logout
Connection to 172.16.96.150 closed.
mini-me:~ stevenu$
~~~~~~~~~~~~~~~~~~~~~
mini-me:~ stevenu$ expect '/Library/Application Support/Perceptive Automation/Indigo 7.2/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/test.exp' stevenu ubntindigo 172.16.96.150
spawn ssh stevenu@172.16.96.150
stevenu@172.16.96.150's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Oct 3 16:57:23 2018 from 172.16.96.47
exit
stevenu@magevid1:~$ exit
logout
Connection to 172.16.96.150 closed.
mini-me:~ stevenu$


~~~~~~~~~~~~~~~~~~~~~~~

Through Terminal, once logged in from the Indigo MAC to the Debian NVR I can;
/usr/bin/tail -F /var/lib/unifi-video/logs/motion.log

Video clips;
/var/lib/unifi-video/videos

Event image ?
/var/lib/unifi-video/snapshot

Posted on
Wed Oct 03, 2018 7:43 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Unify-Video on Debian

anything but space should be fine for passwords

it should catch the screen .. it looks for login welcome ...


this is what i get .
Code: Select all
 expect '/Library/Application Support/Perceptive Automation/Indigo 7.2/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/test.exp' uuid pwd 192.168.1.60
spawn ssh karl@192.168.1.60
karl@192.168.1.60's password:
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.15.0-34-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

115 packages can be updated.
5 updates are security updates.

New release '18.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***
Last login: Wed Oct  3 20:21:22 2018 from 192.168.1.50


the plugin looks for strings like "login" "welcome" in the complete text.lower() you see.

so does it work for you now?

Karl

Posted on
Thu Oct 04, 2018 10:14 am
stevenu offline
Posts: 20
Joined: Nov 21, 2013
Location: SF, California

Re: Unify-Video on Debian

<grin>

Debian is now polite as Ubuntu. . . The header message is written by a lawyer I think;

"The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law."

Posted on
Thu Oct 04, 2018 11:08 am
stevenu offline
Posts: 20
Joined: Nov 21, 2013
Location: SF, California

Re: Unify-Video on Debian

Like pealing an onion. . .

I have my password in quotes, The '$' seems to upset something.

Added welcome and login to the top of /etc/motd


" welcome login

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright."

At this point all of the error login messages have stopped and I see the cameras but their state doesn't look good. . .
Attachments
Screen Shot 2018-10-04 at 10.01.04 AM.jpg
Screen Shot 2018-10-04 at 10.01.04 AM.jpg (104.06 KiB) Viewed 2317 times

Posted on
Thu Oct 04, 2018 2:22 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Unify-Video on Debian

yes the $ is used by EXPECT as variable indicator. Don't know how to escape that.

grey off means it is not recording, that is correct

red rec = recording

can you switch on debug for camera in config?



Karl
ps:

I have commands almost ready :
set motion or full-time recording on / off
can do
="recordingSettings": {"postPaddingSecs": 10, "fullTimeRecordEnabled": false, "prePaddingSecs": 10, "motionRecordEnabled": true, "channel": "2"}
='enableStatusLed':False,
="enableSpeaker":False,

channel is 0/1/2 resolution
looking for some other useful settings

Posted on
Thu Oct 04, 2018 3:46 pm
stevenu offline
Posts: 20
Joined: Nov 21, 2013
Location: SF, California

Re: Unify-Video on Debian

Oh. . .

Here is a short run of the debug log for the video. It is a little embarrassing the size of this network. I tried to limit it.
Next step is how to get images and then onto a Control Page. . .
Attachments
UniFi.log
(12.38 KiB) Downloaded 128 times

Posted on
Fri Oct 05, 2018 9:21 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Unify-Video on Debian

this looks as if you are getting events... but always the same

I have worked a bit on this release:https://www.indigodomo.com/pluginstore/73/ v.129
if you could try that one.

Besides adding debian as one of the tags for login to unix box , control of cameras was added.

You now can start stop recording as well as switch on/off LED, IR, speaker mic .. in the menu as well as in action items
missing eg start streaming and some other functions. Not all cameras allow eg IR to be switch on/ off. although the camera takes it it does not switch on/off for some models.
the plugin will create a device for the NVR and store the apiKey in that device. Same for the cameras.
You only need to supply the userid/passwords for the NVR web and UNIX login. There is a refresh option in the menu for these keys and names ... It will automatically refresh every 15 minutes on its own and when you load the plugin.

this release seems to work, but not intensively tested


Karl

Posted on
Sat Oct 06, 2018 9:23 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Unify-Video on Debian

stevenu, please try the new release ... .130

Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests