Powerlink serial pinout, linux daemon and web interface

Forum about Visonic products like Powermax Plus and Powermax Pro

Moderators: Rene, Willem4ever

ayasystems
Starting Member
Starting Member
Posts: 40
Joined: Wed May 28, 2014 5:05 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by ayasystems »

Hello Vikent.

I bought the RS232 adapter and doing reverse engineering took the pinout of this area (CELL/PC)

Image
http://img819.imageshack.us/img819/4619/7zgr.png
viknet
Member
Member
Posts: 65
Joined: Thu Jan 26, 2012 1:48 am

Re: Powerlink serial pinout, linux daemon and web interface

Post by viknet »

I am directly driving the 703N from the battery using pinout on the PC/IP port (3,75V ), this way I don't need the 12V to 5V adapter and the 703N run of battery if needed
ayasystems
Starting Member
Starting Member
Posts: 40
Joined: Wed May 28, 2014 5:05 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by ayasystems »

I don't know if pendrive works with 3.3v viknet
gb1980
Member
Member
Posts: 52
Joined: Mon Dec 31, 2007 5:56 pm
Location: Netherlands

Re: Powerlink serial pinout, linux daemon and web interface

Post by gb1980 »

Hi,
I've connected the raspberry pi with the UART directly to the powermax RX, TX and GND.
When I run screen screen /dev/ttyAMA0 9600 and enter on the powermax menu the install of the powerlink I don't see any characters comming in on the screen. I'm not sure if anyone else does see something when the initialisation starts.

So next thing I've downloaded the pmaxd and xpl-lib files I've found on this thread.
I've compiled the files from the dropbox link which looks fine:
Finally:
/src/pmaxd/src# make
cc -c pmaxd.c
cc pmaxd.o -o pmaxd -lxPL -lconfig
cc -c xplsendjson.c
cc xplsendjson.o -o xplsendjson.cgi -lxPL
cc -c jsongetxplstate.c
cc jsongetxplstate.o -o jsongetxplstate.cgi -lxPL
cc -c test.c
cc test.o -o test -lxPL -lconfig
cc -c testpmaxd.c
cc testpmaxd.o -o testpmaxd -lxPL -lconfig
------- it stops here.

I edit the config file pmaxd.conf.
changed the usercode to match the installation code (not sure if it is needed?)
device = ["/dev/ttyAMA0"];
left the zonenames untouched

so I try to run: ./pmaxd -f -vvvvv

and the result is:
(null):0 - file I/O error
I've solved this by copying the pmaxd.conf file to /etc (just writing this for others to learn), maybe a filecheck in the programm and a bit more information about the error as output could help some.
Now ./pmaxd -f -vvvvv works.


I'm stuck at a few things:

1 Do I need to see with screen /dev/ttyAMA0 9600 some characters on screen to verify the serial connection is working?
I'm not sure about the serial of the powermax, or how to test it.
The serial of the pi works as I've connected tx and rx and I can see my own echo.

2 I've read about the compilation of pmaxd on the raspberry pi and changed the gettop line 106 to:
while (((c = getopt (argc, argv, "hb:f:s:jvcCr")) != -1) && (c != 255))
Do I need to do something else? I've read about compiling in GCC with -fsigned-char, but I'm not sure what to do with it.
I've just run "make" and presto (I think).

3 I run pmaxd -f -vvvvv
NOTICE: [Wed Jul 16 09:44:44 2014 initLog:0044]Logging initialized
NOTICE: [Wed Jul 16 09:44:44 2014 initLog:0045]Verbose level: 5
NOTICE: [Wed Jul 16 09:44:44 2014 main:0346]Program started by User 0
NOTICE: [Wed Jul 16 09:44:44 2014 main:0384]Starting......
I have 8 zone:

Now I enter the powermax installation menu, install. plink, select: OK learning, and I get a long beep.
This doesn't sound right, normally when something is fine, it gives a few short beeps I think.

4 When the pmaxd program runs, I still can connect with screen to /dev/ttyAMA0.
It looks like the program doesn't connect to the serial?
ayasystems
Starting Member
Starting Member
Posts: 40
Joined: Wed May 28, 2014 5:05 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by ayasystems »

Hi

You need compile with this option "gcc -fsigned-char"

So you must modify makeFile and add -fsigned-char option to compile it.

Please review previously post written by my

Regards
gb1980
Member
Member
Posts: 52
Joined: Mon Dec 31, 2007 5:56 pm
Location: Netherlands

Re: Powerlink serial pinout, linux daemon and web interface

Post by gb1980 »

Thank you for the fast reply ayasystems.
I've used your new MakeFile from domoticaforum.eu/viewtopic.php?f=68& ... 430#p70430.
You get the compile message Makefile:8: *** missing separator. Stop.
In the editor, replace the spaced indents that with tabs and this is also solved (I'm learning along the way :) )

Now I have:
# pmaxd -f -vvvvv
NOTICE: [Wed Jul 16 10:56:52 2014 initLog:0044]Logging initialized
NOTICE: [Wed Jul 16 10:56:52 2014 initLog:0045]Verbose level: 5
NOTICE: [Wed Jul 16 10:56:52 2014 main:0346]Program started by User 0
NOTICE: [Wed Jul 16 10:56:52 2014 main:0384]Starting......
I have 8 zone:

How should I proceed?
Do I now have to install the plink via the menu on the powermax controller?
When I do this, I don't get any reaction on screen.
And I can still access my serial /dev/ttyAMA0 via screen, so I suppose no process/program is using the serial.

should I change the usercode=0x1234; in the configfile to the installation code?
gb1980
Member
Member
Posts: 52
Joined: Mon Dec 31, 2007 5:56 pm
Location: Netherlands

Re: Powerlink serial pinout, linux daemon and web interface

Post by gb1980 »

I've hooked up a logic analyzer and do see some bits are send from the pi when I start the pmaxd program.
But the horrible thing I notice.... When I measure the output of the visonic powermax tx, I don't measure anything when I want to learn the plink.
Could it be my serial of the powermax never worked, or.. I broke it?

Not sure if I may post it here, but I've made a call to the company Becu that delivered the powermax pro arround 2004 / 2005.
They could help me out with perhaps a broken controller that maybe does have a working serial port. That's what I call service!
ayasystems
Starting Member
Starting Member
Posts: 40
Joined: Wed May 28, 2014 5:05 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by ayasystems »

Are you enable Plink in powemax pannel?

I think you need disable link between console and ttyAMA0. I think is better to start do it with a serial usb <-> ttl interface.

At the end I buy a WR703N with this router works very fine..I could not make it work with PI...



Sorry for my english.
gb1980
Member
Member
Posts: 52
Joined: Mon Dec 31, 2007 5:56 pm
Location: Netherlands

Re: Powerlink serial pinout, linux daemon and web interface

Post by gb1980 »

Yes, I've tried several possibilities:
- I've tried also a prolific usb -> TTL converter
- started pmaxd, after a few seconds enabled plink via powermax pannel.
- enabled plink via powermax pannel, and within 1 second started pmaxd
But nothing......
I've also ordered a WR703N yesterday, to learn about the capabilities of the device and use it for the powermax.
Damn, I hate it when I don't have a measurement baseline. I'm going to measure te serial port again(and againg, and again), and else I have to wait until next week.
ayasystems
Starting Member
Starting Member
Posts: 40
Joined: Wed May 28, 2014 5:05 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by ayasystems »

where are you zones name in debug log? I can't see it....

If you dont have serial connect zone name is show.
Execute pmaxd -fvvvvvvvvvvvvvvvvvvvvvv and copy and paste log here
gb1980
Member
Member
Posts: 52
Joined: Mon Dec 31, 2007 5:56 pm
Location: Netherlands

Re: Powerlink serial pinout, linux daemon and web interface

Post by gb1980 »

Debug logging:

# pmaxd -fvvvvvvvvvvvvvvvvvvvvvv
NOTICE: [Wed Jul 16 16:04:03 2014 initLog:0044]Logging initialized
NOTICE: [Wed Jul 16 16:04:03 2014 initLog:0045]Verbose level: 22
NOTICE: [Wed Jul 16 16:04:03 2014 main:0346]Program started by User 0
INFO: [Wed Jul 16 16:04:03 2014 main:0348]setting SID
NOTICE: [Wed Jul 16 16:04:03 2014 main:0384]Starting......
INFO: [Wed Jul 16 16:04:03 2014 initSerialPort:0055]there are 1 device in your config file
INFO: [Wed Jul 16 16:04:03 2014 initSerialPort:0068]opening /dev/ttyAMA0
I have 8 zone:
DEBUG: [Wed Jul 16 16:04:03 2014 sendBuffer:0157]Sending the following buffer to serial TTY
DEBUG: [Wed Jul 16 16:04:03 2014 logBuffer:0140]BufferSize: 12
DEBUG: [Wed Jul 16 16:04:03 2014 logBuffer:0141]Buffer: A2 00 00 00 00 00 00 00 00 00 00 43
DEBUG: [Wed Jul 16 16:04:03 2014 calculChecksum:0150]checksum: 001A
DEBUG: [Wed Jul 16 16:04:03 2014 sendBuffer:0166]result of serial write:: 15
DEBUG: [Wed Jul 16 16:04:03 2014 main:0391]Sarting main loop....

# cat /etc/pmaxd.conf
# authenticator
usercode=0x1234;
device = ["/dev/ttyAMA0"]; // Use more than 2
zonename = ["R.D.C.", "Etage", "Salon", "Salle a manger", "cuisine", "volet garage", "porte garage", "detecteur incendie"]; // Use more than 2
ayasystems
Starting Member
Starting Member
Posts: 40
Joined: Wed May 28, 2014 5:05 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by ayasystems »

Is your usercode 1234 ?? Please set it (decimal format)

try to send command to pannel pressing key in keyboard

a- Arm
d- disarm
g- get log

The command is case sensitive.
gb1980
Member
Member
Posts: 52
Joined: Mon Dec 31, 2007 5:56 pm
Location: Netherlands

Re: Powerlink serial pinout, linux daemon and web interface

Post by gb1980 »

Just to give something back to the devvers out here.
I'm building a native android application to control the alarm and receive messages via "Google Cloud Messaging for Android".
For an other project I've got it all working, just need to rebuild it to make use of it for the powermax.

I'm not planning to set-up a public GCM server, just for developers like yourselves, with your own GCM api-key.
I only need to connect the alarm to the network via a raspberry, or other linux capable device to get going.....
gb1980
Member
Member
Posts: 52
Joined: Mon Dec 31, 2007 5:56 pm
Location: Netherlands

Re: Powerlink serial pinout, linux daemon and web interface

Post by gb1980 »

Is your usercode 1234 ?? Please set it (decimal format)
I've tried it with both 1234 and my own installation code. None of them work.
When do I have to send a, d, g?
Is it in the debug of running pmaxd?
mlstolk
Starting Member
Starting Member
Posts: 7
Joined: Mon Nov 02, 2009 2:07 pm
Location: Netherlands

Re: Powerlink serial pinout, linux daemon and web interface

Post by mlstolk »

I've a question regarding the interfacing between a Powermax Complete and a Raspberry Pi. I wrote a python script which successfully enrolls to the UART interface of the Powermax and it allows me to read out the relevant status information. So far so good.

However, I would like to set-up a json-server and would like to use the pmaxd as published in this thread. After compilation (including the signed char and parameter interpretation fixes), pmaxd starts in foreground mode, but is unable to present any valid information. Even after retrying enrollment with the 't'-option, there is still not a single correctly interpreted reply. I've increased the timeout in the /etc/pmaxd.conf, also without any success.
Even after trying to send the enrollment message via my own program (in between the interfacing of pmaxd), pmaxd will not hook on to the message stream correctly.
Hereby I provide a short listing of the verbose log, hopefully someone can point me to a possible cause of this problem. Thank you!

Code: Select all

NOTICE: [Sun Sep 21 21:34:03 2014 initLog:0058]Logging initialized
NOTICE: [Sun Sep 21 21:34:03 2014 initLog:0059]Verbose level: 15
NOTICE: [Sun Sep 21 21:34:03 2014 main:0412]Program started by User 1000
INFO: [Sun Sep 21 21:34:03 2014 main:0414]setting SID
NOTICE: [Sun Sep 21 21:34:03 2014 main:0446]Starting......
INFO: [Sun Sep 21 21:34:03 2014 initSerialPort:0069]there are 2 device in your config file
INFO: [Sun Sep 21 21:34:03 2014 initSerialPort:0082]opening /dev/ttyAMA0
I have 8 zone:
NOTICE: [Sun Sep 21 21:34:03 2014 PmaxInit:0162]zone: 0, name: R.D.C.
NOTICE: [Sun Sep 21 21:34:03 2014 PmaxInit:0162]zone: 1, name: Etage
NOTICE: [Sun Sep 21 21:34:03 2014 PmaxInit:0162]zone: 2, name: Salon
NOTICE: [Sun Sep 21 21:34:03 2014 PmaxInit:0162]zone: 3, name: Salle a manger
NOTICE: [Sun Sep 21 21:34:03 2014 PmaxInit:0162]zone: 4, name: cuisine
NOTICE: [Sun Sep 21 21:34:03 2014 PmaxInit:0162]zone: 5, name: porte garage
NOTICE: [Sun Sep 21 21:34:03 2014 PmaxInit:0162]zone: 6, name: volet garage
NOTICE: [Sun Sep 21 21:34:03 2014 PmaxInit:0162]zone: 7, name: detecteur incendie
DEBUG: [Sun Sep 21 21:34:03 2014 sendBuffer:0171]Sending the following buffer to serial TTY
DEBUG: [Sun Sep 21 21:34:03 2014 logBuffer:0154]BufferSize: 12
DEBUG: [Sun Sep 21 21:34:03 2014 logBuffer:0155]Buffer: A2 00 00 00 00 00 00 00 00 00 00 43
DEBUG: [Sun Sep 21 21:34:03 2014 calculChecksum:0164]checksum: 001A
DEBUG: [Sun Sep 21 21:34:03 2014 sendBuffer:0180]result of serial write::15
DEBUG: [Sun Sep 21 21:34:05 2014 sendBuffer:0171]Sending the following buffer to serial TTY
DEBUG: [Sun Sep 21 21:34:05 2014 logBuffer:0154]BufferSize: 12
DEBUG: [Sun Sep 21 21:34:05 2014 logBuffer:0155]Buffer: A2 00 00 00 00 00 00 00 00 00 00 43
DEBUG: [Sun Sep 21 21:34:05 2014 calculChecksum:0164]checksum: 001A
DEBUG: [Sun Sep 21 21:34:05 2014 sendBuffer:0180]result of serial write::15
DEBUG: [Sun Sep 21 21:34:05 2014 main:0453]Sarting main loop....
DEBUG: [Sun Sep 21 21:34:05 2014 packetManager:0336]Timeout while waiting packet: assumig packet is complete......
DEBUG: [Sun Sep 21 21:34:05 2014 calculChecksum:0164]checksum: 004A
ERR: [Sun Sep 21 21:34:05 2014 deFormatBuffer:0200]checksum NOK calculated:004A in packet:0000
ERR: [Sun Sep 21 21:34:05 2014 packetManager:0356]Packet not correctly formated
DEBUG: [Sun Sep 21 21:34:05 2014 logBuffer:0154]BufferSize: 57
ERR: [Sun Sep 21 21:34:05 2014 logBuffer:0155]Buffer: 01 0D 08 00 00 18 01 0D 08 00 00 18 01 0D 08 00 00 18 01 0D 08 00 00 18 01 0D 08 0$
DEBUG: [Sun Sep 21 21:34:05 2014 packetManager:0363]End of packet treatment
DEBUG: [Sun Sep 21 21:34:05 2014 packetManager:0336]Timeout while waiting packet: assumig packet is complete......
DEBUG: [Sun Sep 21 21:34:05 2014 calculChecksum:0164]checksum: 00E9
ERR: [Sun Sep 21 21:34:05 2014 deFormatBuffer:0200]checksum NOK calculated:00E9 in packet:0000
ERR: [Sun Sep 21 21:34:05 2014 packetManager:0356]Packet not correctly formated
DEBUG: [Sun Sep 21 21:34:05 2014 logBuffer:0154]BufferSize: 3
ERR: [Sun Sep 21 21:34:05 2014 logBuffer:0155]Buffer: 01 0D 08
DEBUG: [Sun Sep 21 21:34:05 2014 packetManager:0363]End of packet treatment
DEBUG: [Sun Sep 21 21:34:05 2014 packetManager:0336]Timeout while waiting packet: assumig packet is complete......
DEBUG: [Sun Sep 21 21:34:05 2014 calculChecksum:0164]checksum: 00E9
ERR: [Sun Sep 21 21:34:05 2014 deFormatBuffer:0200]checksum NOK calculated:00E9 in packet:0000
ERR: [Sun Sep 21 21:34:05 2014 packetManager:0356]Packet not correctly formated
DEBUG: [Sun Sep 21 21:34:05 2014 logBuffer:0154]BufferSize: 3
ERR: [Sun Sep 21 21:34:05 2014 logBuffer:0155]Buffer: 01 0D 08
DEBUG: [Sun Sep 21 21:34:05 2014 packetManager:0363]End of packet treatment
DEBUG: [Sun Sep 21 21:34:06 2014 packetManager:0336]Timeout while waiting packet: assumig packet is complete......
DEBUG: [Sun Sep 21 21:34:06 2014 calculChecksum:0164]checksum: 00E9
ERR: [Sun Sep 21 21:34:06 2014 deFormatBuffer:0200]checksum NOK calculated:00E9 in packet:0000
ERR: [Sun Sep 21 21:34:06 2014 packetManager:0356]Packet not correctly formated
DEBUG: [Sun Sep 21 21:34:06 2014 logBuffer:0154]BufferSize: 3
ERR: [Sun Sep 21 21:34:06 2014 logBuffer:0155]Buffer: 01 0D 08
DEBUG: [Sun Sep 21 21:34:06 2014 packetManager:0363]End of packet treatment
NOTICE: [Sun Sep 21 21:34:06 2014 KeyPressHandling:0282]try re-enroll
DEBUG: [Sun Sep 21 21:34:06 2014 sendBuffer:0171]Sending the following buffer to serial TTY
DEBUG: [Sun Sep 21 21:34:06 2014 logBuffer:0154]BufferSize: 12
DEBUG: [Sun Sep 21 21:34:06 2014 logBuffer:0155]Buffer: A2 00 00 00 00 00 00 00 00 00 00 43
DEBUG: [Sun Sep 21 21:34:06 2014 calculChecksum:0164]checksum: 001A
DEBUG: [Sun Sep 21 21:34:06 2014 sendBuffer:0180]result of serial write::15
DEBUG: [Sun Sep 21 21:34:06 2014 packetManager:0336]Timeout while waiting packet: assumig packet is complete......
DEBUG: [Sun Sep 21 21:34:06 2014 calculChecksum:0164]checksum: 00E9
ERR: [Sun Sep 21 21:34:06 2014 deFormatBuffer:0200]checksum NOK calculated:00E9 in packet:0000
ERR: [Sun Sep 21 21:34:06 2014 packetManager:0356]Packet not correctly formated
DEBUG: [Sun Sep 21 21:34:06 2014 logBuffer:0154]BufferSize: 3
ERR: [Sun Sep 21 21:34:06 2014 logBuffer:0155]Buffer: 01 0D 08
etc.
Post Reply

Return to “Visonic Alarm systems”