Page 8 of 16
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Fri Apr 04, 2014 6:42 pm
by clement
Hi,
I'm trying to improve my script in order to send me a Push notification and an email (with PushingBox.com) as soon as there is an intrusion.
Currently I have a script on an other server that checks every 30s the URL
http://myrouter/cgi-bin/jsongetxplstate.cgi
Here is an example of the output :
Code: Select all
{
"status":"disarmed",
"pmaxstatus":"disarmed",
"readytoarm":"",
"sensor":[
{
"zone":"Hall entree",
"type":"interior",
"alert":"false",
"armed":"false",
"tamper":"false",
"low-battery":"false"
},
{
"zone":"Cuisine",
"type":"interior",
"alert":"false",
"armed":"false",
"tamper":"false",
"low-battery":"false"
}
]
}
My script parse the "
status" value. Possible values are "
disarmed" and "
armed". On intrusion, the value is still "
armed".
I also test the values of "
pmaxstatus". Possible values are "
disarmed", "
arming-away" and "
armed-away".
But nothing that can indicate an intrusion.
Any idea? How have you handle this?
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Sat Apr 05, 2014 4:48 pm
by Fred_B
Hello,
You make a terrific job that I tried to perform for my powermax pro.
I received all needed to.
I do my best (not to all understand but to "just" use your job) but...
I need some help.
My configuration :
PL2303 usb to rs232 stick
WR703N router
USB (2 Go) for memory
I have installed as explained by ggero (page

but I can't do "/etc/init.d/xPL_Hub enable"
because "xPL_Hub" doesn't exist in "/etc/init.d".
The other services "pmaxd" and "lighttpd" seem to be running. They are marked 'running'
in Web Luci interface.
I tested my pl2303 stick : no problem.
I tried to ask my wr703N :
for "pmaxd -f":
I have 8 zone:
NB : It is right but I need to force by Ctrl c to stop this process !
for "/www/cgi-bin/jsongetxplstate.cgi":
Content-Type:text/html;charset=iso-8859-1
{ "status":"","pmaxstatus":"","readytoarm":"","sensor":[]}
What is the problem ?
Fred
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Mon Apr 07, 2014 11:43 pm
by Phaeton
Does anybody have an example how to arm THE alarm with a command from a webpage other than the supplied webpage? For example with an xpl script?
How do you guys see if alarm has been triggered on the cgi? I'd like to use this for my domoticasystem hs3.
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Tue Apr 08, 2014 9:37 am
by viknet
sorry not to have replied before, please PM me if you see no answer.
@clement: intrusion are not detected, xpl does not seem to suggest how to handle intrusion message and I don't know if the protocol description is precise enough to handle detection
@Fred_B: 1) you can run xpl_hub by yourself (type "xpl_hub &" for example) and see if it improve.
if you don't want to type it each time you restart, create a file inside /etc/init.d/ to start it and enable it with the command line given by ggero
@phaeton,
of course you can arm with xpl,
- with xplsend from a terminal
- with an android phone there are some utility
- with a wget call to the right web page you can easily enable the alarm
something like: wget
http://myalarm/cgi-bin/xplsendjson.cgi ?xplpacket=[{"name":"command","value":"arm-away"}]
(not tested)
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Tue Apr 08, 2014 8:18 pm
by dad
@Clement: You might want to look at the xpl security schema for formats for messages:
Schema - SECURITY - XPLProject
HTH
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Wed Apr 09, 2014 11:04 am
by clement
You're right, it would be better to listen XPL messages than requesting an URL every 30s...
@viknet, thank you, this is bad, I have to found an other way to get real time intrusion alert...
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Thu Apr 10, 2014 11:25 am
by viknet
@clement: if it is xpl compatible, why are'nt you trying to modify pmaxd ? it isn't that hard just find how to get the information from the powermax and if a certain event arrive, trigger an alarm in xpl format
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Thu Apr 10, 2014 2:55 pm
by Phaeton
it i if you don't understand the code
I just tried to read the source, but it was a little over my head.
That's a shame cause I like this solution.
Clement, can you code? Because, like you, I really like to see if the alarm is being triggered.
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Thu Apr 10, 2014 3:39 pm
by clement
Not really sure how and where to start.
I also took a look at the code, not so simple...
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Thu Apr 10, 2014 6:17 pm
by Phaeton
that's a shame. Viknet, a very impolite question. Is it a lot of work for you to add this? I can make a donation, but unfortionately cannot add this.
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Fri Apr 11, 2014 11:28 am
by viknet
money is not an issue.....
time is :=)
it's not a lot of work I already put code on github if anybody want to have a look, things need to be changed are in this file:
https://github.com/viknet365/pmaxd/blob ... constant.h
around line 390 I think
the question is how to handle message and how to report them answering these question are tricky:
the pmaxd daemon keep a cached copy of the powermax state: it know its status (armed or not) and the status of each sensor (open close for door, triggered for IR)
what we could do is add a "column" with a state "ALARMED:yes/no" and fill this column: if sensor change and status is armed then sensor.alarmed=yes
the problem is then: for how long do you keep this info (it seems normal to reset it on re-arm for example) but otherwise ?
what happen when by-passing a zone (that is not handled at all by pmaxd by the way)
what to do after pmaxd get this info ? send an
xpl message ? who is gonna get it ? set an xpl flag for when the webui is getting info which one, xpl seems to
handle it
Please tell me your requirement, find some beta tester and we could start working otherwise I won't spend time on it sorry....
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Wed May 28, 2014 5:07 pm
by ayasystems
May possible compile it for a raspbeery pi?
(sorry for my poor english)
Best regards
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Thu May 29, 2014 4:27 pm
by ayasystems
I can,t compile it with mi raspberry
pi@raspbmc:~/powermax/pmaxd$ gcc test pmaxd.c
In file included from pmaxd.c:23:0:
pmaxd-xpl.c:2:17: fatal error: xPL.h: No such file or directory
compilation terminated.
I need xPL project too? Do you know how can continue?
Best regards
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Mon Jun 02, 2014 3:29 pm
by viknet
see
http://www.xpl4java.org/xPL4Linux/
for the xpl version,
if you can't compile it you can also try source here and there: (only some makefile tweak)
https://github.com/hwstar/xPLLib-hwstar
https://github.com/viknet365/xPLLib-hwstar
good luck
Re: Powerlink serial pinout, linux daemon and web interface
Posted: Thu Jun 05, 2014 12:58 pm
by ayasystems
I will try it
I'll tell you the results.
Best regards!