LinuxMCE Forums

General => Users => Topic started by: domotiqa.com on September 25, 2007, 01:51:44 pm

Title: Security mode not working properly !
Post by: domotiqa.com on September 25, 2007, 01:51:44 pm
as described in this thread:
http://forum.linuxmce.org/index.php?topic=2542.0

I setup my security camera (controled by the motion detector), that is working.
Then I setup the "active sensor" in admin website.
I set it up as bellow:
* monitor mode unchecked
* disarmed mode: N "unchecked", action "do nothing"
* armed-away: N "checked", action "Security"
* armed-at home: N "checked", action "Announcement"
* sleeping: N "checked", action "Snap picture"

rest as armed away


My problem is that I change the mode and:
1/ no info about the current mode in the top bar
2/ the mode is changed (see in statut of the admin website), but video still record on motion, picture as well, like if there is no difference between mode!! and before, I had the security breach that appears when motion detected, but now I don't have the alert any more, and if I reset the parameters (monitor mode  unchecked, all N checked and all in "security", it come back) !!

It's very painfull. If someone could help I'll be gratefull.
Title: Re: Security mode not working properly !
Post by: bulek on September 25, 2007, 02:46:33 pm
Regarding

/2. Motion deosn't know what state is LMCE in. Currently this is not implemented. Feel free to contribute...

Regards.

Bulek.
Title: Re: Security mode not working properly !
Post by: domotiqa.com on September 25, 2007, 04:09:37 pm
hy and thanks for the answer ::) there is 2 days I try to figure outwhy'not working !!

Do you have any key starting to work on it !!
I will need this fonctionnalities !!!!
You said it's not implemented, so why on the first linuxmce.com webpage you can read:
Quote
Security: Uses your existing home alarm, surveillance cameras, lights, phones and tv's to notify you on your mobile phone of any security alerts with the option of reseting the alarm or broadcasting your voice in the house over the tv's

Thanks for replying, and given any help. I can work on it!
Title: Re: Security mode not working properly !
Post by: domotiqa.com on September 25, 2007, 04:45:19 pm
o, I'm sorry, I re-read your post:

Quote
Integration with motion is not fully done. Actually only config files are auto generated from settings in admin page and then more or less motion works on its own. Communication happens only on few occasions :
- when LMCE needs snapshots it sends signal to motion and than motion_wrapper reads latest snapshots and send it back (view camera scenarios for instance)
- when motion is detected, then proper DCE messages are sent. In ThreadX.conf you have :


Code: [Select]
# sending pluto tripped on/off events on motion start/end
on_event_start /usr/pluto/bin/MessageSend 127.0.0.1 51 -1001 2 9 25 1
on_event_end /usr/pluto/bin/MessageSend 127.0.0.1 51 -1001 2 9 25 0

and that cause sensor tripped on and tripped off events that are sent to LMCE. Currently even motion http interface is not supported - I did all the work I could at that time, but now have no time to enhance it. But everone is welcome to rool sleeves up, I'll help as much as I can with internals and how to do it...

BTW, I think that you have current house status displayed on main page of Orbiter...

So I would like to have the work you did and some how to in order not to loose to much time !!! Then I would help coding !!

however, why on main linuxmce page, there is
Quote
Security: Uses your existing home alarm, surveillance cameras, lights, phones and tv's to notify you on your mobile phone of any security alerts with the option of reseting the alarm or broadcasting your voice in the house over the tv's
Title: Re: Security mode not working properly !
Post by: domotiqa.com on September 26, 2007, 04:15:47 pm
So when using motion interface, this part don't work anymore ?

http://plutohome.com/wiki/index.php/Security_breach
Title: Re: Security mode not working properly !
Post by: domotiqa.com on September 26, 2007, 06:29:43 pm
To view the motion video on each orrbiter, just make a symlink as bellow:

Code: [Select]
$ cd /home/public/data/videos
$ sudo mkdir security
$ sudo ln -s /home/cameras/camera_number/movies/ /home/public/data/videos/security/name_of_camera

Only one problem, all files are mixing each other, so you have to sort by filename
Title: Re: Security mode not working properly !
Post by: bulek on September 26, 2007, 08:28:58 pm
So when using motion interface, this part don't work anymore ?

http://plutohome.com/wiki/index.php/Security_breach
It probably will. You just have to distinct two possibilities to use IP camera under LMCE :
1. is to add it as GSD device, where LMCE will directly communicate with it. Take a look at template, LMCE gets snapshot directly from web page of camera....But no motion wrappper involved in this combo
2. to add it as ip camera as child device of motion wrapper (then it will be treated same as all other analog cameras - with motion detection, recording etc....). You actually add it as analog camera but then change Configuration field as written on Wiki somewhere, so motion will know it's ip camera.

Number 1. is plug'n'play so majority of users probably get confused with it.

Maybe you can try to change few Wiki entries about this matter. it obviously is confusing...

HTH,

regards,

Bulek.
Title: Re: Security mode not working properly !
Post by: domotiqa.com on September 26, 2007, 09:09:33 pm
I, i'm in the second option, as explained.
However, that http://plutohome.com/wiki/index.php/Security_breach
doesn't work any more for me !!
Alert are still there in the alert log/statut of admin website, but no security breach movie, and no alert on orbiter !!

You said the link between mode in lmce and motion is not implemented, what do you mean, actually, jpeg are stored on each motion. Movie also are recorded.
I'd like to know what is not implemented (with camera controlled by motion):
1/ security breach on motion then video (I guess it is implemented)
2/ alert on orbiter (i guess yes)
3/ alert on orbiter depending of the "active sensor"  setup in admin website (I guess not)
4/ alert with link of the video (filename of motion) ( I guess not)

thanks because I thing I broke my lmce install
Title: Re: Security mode not working properly !
Post by: domotiqa.com on September 28, 2007, 02:21:26 pm
I decided to re-install every thing in order to restart clean !

here is the "virtual" statut of modules:
can't figure out where, will look for it !!!

but I'm not sure it's true (security part)!!

What about the idea of making a "motion software sensor" as gsd for each camera.
For example, I add new motion interface and new camera as analog camera controlled by motion.
Then I add a "motion software sensor" and I make a link between sensor and camera, in order to make mode easily working!
I will use the http://www.lavrsen.dk/twiki/bin/view/Motion/MotionHttpAPI to dialog with the fake sensor "motion software sensor"

I will digg it !
Title: Re: Security mode not working properly !
Post by: domotiqa.com on September 28, 2007, 02:25:08 pm
I was just thinging that the state of the camera controlled by the motion wrapper is already known by lmce (just a look in the alert log show it). Maybe if we separate this part of the wrapper and associate it with a fake sensor, no developpment needed. Because lmce know how to deal with sensor associated with camera !!
Title: Re: Security mode not working properly !
Post by: domotiqa.com on September 28, 2007, 02:52:07 pm
it's interresting to read:
http://wiki.linuxmce.org/index.php/Arm_or_disarm_the_alarm_using_the_Orbiters

imagine the motion config file that send message not to the camera but to the virtual sensor !! Then the state for each mode would work, and we can link camera controlled by motion and the sensor. So when a sensor is triggered, then the camera appears too !!
Title: Re: Security mode not working properly !
Post by: domotiqa.com on October 03, 2007, 11:11:41 am
Ok, here is what I found out.

The camera settings in active sensor recognised are only change made to unarmed mode ! When the mode behaviour is security, we've got an alert. When it's on nothing, we've got nothing. The video is always recorded by the motion software.

So I tried to create a security device: motion detector. I had a look of its ID 39.
The ID of the camera (controled by motion) is 32. I add the 39 sensor to this security camera 32. In active sensor, I setup to nothing all action for the camera for every mode. For the sensor 39, I setup unarmed: nothing no alert, and all other mode are to security mode with alert.

When we have a look in the threadX.conf (/etc/motion), we can see that message are send to the ID 32 (camera).
Code: [Select]
# sending pluto tripped on/off events on motion start/end
on_event_start /usr/pluto/bin/MessageSend 127.0.0.1 32 -1001 2 9 25 1
on_event_end /usr/pluto/bin/MessageSend 127.0.0.1 32 -1001 2 9 25 0

SO I tried to change 32 to 39. The aim is to sendMessage to the sensor that it has to triggered to motion detection.

Yet it's not working. I don't know about message send to dce, so I guess I have to change parameters !!
Title: Re: Security mode not working properly !
Post by: domotiqa.com on October 03, 2007, 11:58:36 am
command in deltail should be :
on_event_start /usr/pluto/bin/MessageSend 127.0.0.1 32 -1001 2 9 25 1

server 127.0.0.1
from 32 (camera)
to -1001 don't know, -1000 is dcerouter however -1001 ??
Event 2
9 the event id
set param 25 to value 1
Title: Re: Security mode not working properly !
Post by: domotiqa.com on October 03, 2007, 12:29:11 pm
I tried to create an event on motion detector called Sensor Tripped, number 9

and modify the threadX.conf file
on_event_start /usr/pluto/bin/MessageSend 127.0.0.1 32 39 9 1
on_event_stop /usr/pluto/bin/MessageSend 127.0.0.1 32 39 9 0

no result yet
Title: Re: Security mode not working properly !
Post by: Zaerc on October 03, 2007, 12:35:49 pm
You can find some info on MessageSend in the wiki: http://wiki.linuxmce.org/index.php/MessageSend
Title: Re: Security mode not working properly !
Post by: domotiqa.com on October 03, 2007, 12:39:48 pm
I was looking on it, thanks I modified my message above !
Title: Re: Security mode not working properly !
Post by: domotiqa.com on October 03, 2007, 12:51:15 pm
the virtual device -1001 (DEVICEID_EVENTMANAGER)

I guess it's in order to setup event not attach to device !!

http://wiki.linuxmce.org/index.php/Plain_Text_DCE_Messages
Title: Re: Security mode not working properly !
Post by: domotiqa.com on October 03, 2007, 02:40:33 pm
it's working !!!

I putted in the Configuration field of the camera attached to the sensor

netcam_url  http://ip/pathToVideo
# sending pluto tripped on/off events on motion start/end
on_event_start /usr/pluto/bin/MessageSend 127.0.0.1 nĀ°Sensor -1000 2 9 25 1
on_event_end /usr/pluto/bin/MessageSend 127.0.0.1 nĀ°Sensor -1000 2 9 25 0
Title: Re: Security mode not working properly !
Post by: domotiqa.com on October 03, 2007, 02:42:12 pm
 ;D ;D ;D and the picture in alert log work also (but the image is a little bit not sync)  8)

great, however it's a tricks !!
Title: Re: Security mode not working properly !
Post by: bulek on October 04, 2007, 09:46:23 am
Hi,

maybe I'm not following this, but this should all work if camera ID is used in threadx.conf. Did you have to change to sensor ID to get it working ?

if that's true then it's a bug and mantis report should be filed... I had this working under Pluto 0.44 with no problem. Cameras by themselves triggered proper security events. Have no clue why this has changed...

Regards,

Bulek.
Title: Re: Security mode not working properly !
Post by: domotiqa.com on October 04, 2007, 01:06:21 pm
yes the Id is the wright one !
In fact it was working with the unarmed mode, but not with the other one !!

If someone make it work in a different way, I'd like to know how !
Title: Re: Security mode not working properly !
Post by: d0t on March 18, 2008, 09:21:05 pm
Hey domotiqa.com,

Thank you for posting your solution.  I spent many hours trying to find a fix - the use of active sensors for security in LMCE 710b4 still seems broken.  The various states do not work as expected using both the DVD and CD installation methods, when trying to use motion with my panasonic ip camera.  After I manually added a new motion detection sensor following your instructions, I managed to get things working as needed. 

Cheers!
.
Title: Re: Security mode not working properly !
Post by: domotiqa.com on March 20, 2008, 10:38:54 am
pleased to be helpfull !
cu
Title: Re: Security mode not working properly !
Post by: Cj_MaN on March 27, 2008, 09:42:44 am
In order to send security events directly to the motion camera, and to get a picture from it, you'll have to relate the motion camera to itself in the Device_Device_Related table.
By ex:
 Le's say that your MotionCameraID is 77, you'll have to add this as FK_Device and FK_Device_Related in the Device_Device_Related table.

>mysql -u root
>use pluto_main
>INSERT INTO Device_Device_Related (FK_Device, FK_Device_Related) VALUES ($MotionCameraID, $MotionCameraID);

In your case you'll have to substitute the $MotionCameraID variable with you MotionCameraID = Device ID - from Web Admin
Title: Re: Security mode not working properly !
Post by: domotiqa.com on March 27, 2008, 02:11:14 pm
thank's for your feedback !
finnaly, we'll make everything work ;-)