Powerlink serial pinout, linux daemon and web interface

Forum about Visonic products like Powermax Plus and Powermax Pro

Moderators: Rene, Willem4ever

maximillian
Starting Member
Starting Member
Posts: 8
Joined: Sun Dec 14, 2014 5:25 am

Re: Powerlink serial pinout, linux daemon and web interface

Post by maximillian »

I added the second device, rebooted (just to be in a known state), then retried above and it didn't seem to fix it.

Is there a command that can allow me to read (receive) to see if that connection is correct? Basically something like xPLReceive?

kingofnuls, you can get WRT703N's from Ebay shipped from China. You have to deal with the Chinese characters during installation but there's guides on what to click to change to English. Or pay a little more and you can get openwrt pre-installed.

I also used a 12V to 5V buck converter like this to power my board, and wired the RS-232 lines directly:
http://www.ebay.com/itm/5V-USB-Converte ... 485deba37c

I'll take a pic soon but it's similar to ayasystems's method. No USB hub required.
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 »

did you get the last binaries from:
https://github.com/viknet365/pmaxd/tree/master/bin ?

you should have a timeout section in pmaxd.conf, try changing the timeout until you don't get "packet not correctly formated" errors
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 »

by the way to all of you using WRT703N:
1) YOU DON'T need serial converter 3.3 to 5V, connect directly the serial from any usb to serial to the pmax and it will work (as long as you don't connect VCC, Rx Tx and Gnd only)
2) wrt703N can be powered form 3.7V so why using a converter when you can use a wire from the PC/IP port ? (see § power consumption from openwrt http://wiki.openwrt.org/toh/tp-link/tl-wr703n )

kingofnuls, go ahead, it will probably work, beware you might need to recompile (not easy on openWRT)
maximillian
Starting Member
Starting Member
Posts: 8
Joined: Sun Dec 14, 2014 5:25 am

Re: Powerlink serial pinout, linux daemon and web interface

Post by maximillian »

Hey viknet,

I downloaded and installed the latest binaries. I think you are correct, something was missing.

My Conf file:

Code: Select all

    # authenticator
    usercode=0xXXXX;
    device = ["/dev/ttyATH0","/dev/ttyATH0"]; // Use more than 2
    zonename = ["Front door", "Back door", "Garage door", "Back door", "Child r
oom"]; // Use more than 2
    restartscript = "/etc/restart.sh";
    packet_timeout = 2000;
Output of: pmaxd -fvvvvvvv

Code: Select all

 NOTICE: [Sun Feb 15 03:42:36 2015 initLog:0058]Logging initialized
 NOTICE: [Sun Feb 15 03:42:36 2015 initLog:0059]Verbose level: 7
 NOTICE: [Sun Feb 15 03:42:36 2015 main:0412]Program started by User 0
 INFO: [Sun Feb 15 03:42:36 2015 main:0414]setting SID
 NOTICE: [Sun Feb 15 03:42:36 2015 main:0446]Starting......
 INFO: [Sun Feb 15 03:42:36 2015 initSerialPort:0069]there are 2 device in your config file
 INFO: [Sun Feb 15 03:42:36 2015 initSerialPort:0082]opening /dev/ttyATH0
I have 5 zone:
 DEBUG: [Sun Feb 15 03:42:36 2015 sendBuffer:0171]Sending the following buffer to serial TTY
 DEBUG: [Sun Feb 15 03:42:36 2015 logBuffer:0154]BufferSize: 12
 DEBUG: [Sun Feb 15 03:42:36 2015 logBuffer:0155]Buffer: A2 00 00 00 00 00 00 00 00 00 00 43
 DEBUG: [Sun Feb 15 03:42:36 2015 calculChecksum:0164]checksum: 001A
 DEBUG: [Sun Feb 15 03:42:36 2015 sendBuffer:0180]result of serial write:: 15
 DEBUG: [Sun Feb 15 03:42:36 2015 sendBuffer:0171]Sending the following buffer to serial TTY
 DEBUG: [Sun Feb 15 03:42:36 2015 logBuffer:0154]BufferSize: 12
 DEBUG: [Sun Feb 15 03:42:36 2015 logBuffer:0155]Buffer: AB 06 00 00 00 00 00 00 00 00 00 43
 DEBUG: [Sun Feb 15 03:42:36 2015 calculChecksum:0164]checksum: 000B
 DEBUG: [Sun Feb 15 03:42:36 2015 sendBuffer:0180]result of serial write:: 15
 DEBUG: [Sun Feb 15 03:42:36 2015 main:0453]Sarting main loop....
Executing xPLSend commands still works. But executing "/www/cgi-bin/jsongetxplstate.cgi" gives the same output.

I would like to ask again, any way to check if serial commands are able to go both ways. I can clearly send commands to the panel but I am not too confident that I can receive, thus read status of the panel.

I really appreciate your help. I would like to send some coin your way. Is there a donate section I can use?

Thanks.
nkildal
Starting Member
Starting Member
Posts: 10
Joined: Tue Feb 17, 2015 7:29 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by nkildal »

Hi

First of all - thank you to everyone working to reverse engineer the Powermax serial protocols - and especially viknet for creating the pmaxd code :-)
I own a Visonic Powermax+ which I have connected to a Raspberry Pi (running Raspbian) via a USB TTL 3.3V interface.
I have compiled the pmaxd binary, and seem to be communicating with the Powermax - but I get weird responses from it - perhaps someone has an idea what is going on ?

My /etc/pmaxd.conf file looks like this:

Code: Select all

# authenticator
usercode=0x6215;
device = ["/dev/ttyUSB0"];
zonename = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "Stue", "Gang", "Kontor", "Fordør", "Bagdør"];
restartscript = "/etc/restart.sh";
packet_timeout = 5000;
Starting pmaxd:

Code: Select all

powermax:/usr/local/sbin/powermax/pmaxd-master# ./pmaxd -fvvvvvvvvvv
 NOTICE: [Tue Feb 17 18:24:59 2015 initLog:0058]Logging initialized
 NOTICE: [Tue Feb 17 18:24:59 2015 initLog:0059]Verbose level: 10
 NOTICE: [Tue Feb 17 18:24:59 2015 main:0411]Program started by User 0
 INFO: [Tue Feb 17 18:24:59 2015 main:0413]setting SID
 NOTICE: [Tue Feb 17 18:24:59 2015 main:0445]Starting......
 INFO: [Tue Feb 17 18:24:59 2015 initSerialPort:0069]there are 1 device in your config file
 INFO: [Tue Feb 17 18:24:59 2015 initSerialPort:0082]opening /dev/ttyUSB0
I have 15 zone:
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 0, name: 0
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 1, name: 1
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 2, name: 2
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 3, name: 3
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 4, name: 4
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 5, name: 5
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 6, name: 6
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 7, name: 7
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 8, name: 8
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 9, name: 9
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 10, name: Stue
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 11, name: Gang
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 12, name: Kontor
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 13, name: Fordør
 NOTICE: [Tue Feb 17 18:24:59 2015 PmaxInit:0162]zone: 14, name: Bagdør
 DEBUG: [Tue Feb 17 18:24:59 2015 sendBuffer:0170]Sending the following buffer to serial TTY
 DEBUG: [Tue Feb 17 18:24:59 2015 logBuffer:0153]BufferSize: 12
 DEBUG: [Tue Feb 17 18:24:59 2015 logBuffer:0154]Buffer: A2 00 00 00 00 00 00 00 00 00 00 43
 DEBUG: [Tue Feb 17 18:24:59 2015 calculChecksum:0163]checksum: 001A
 DEBUG: [Tue Feb 17 18:24:59 2015 sendBuffer:0179]result of serial write:: 15
 DEBUG: [Tue Feb 17 18:24:59 2015 sendBuffer:0170]Sending the following buffer to serial TTY
 DEBUG: [Tue Feb 17 18:24:59 2015 logBuffer:0153]BufferSize: 12
 DEBUG: [Tue Feb 17 18:24:59 2015 logBuffer:0154]Buffer: AB 06 00 00 00 00 00 00 00 00 00 43
 DEBUG: [Tue Feb 17 18:24:59 2015 calculChecksum:0163]checksum: 000B
 DEBUG: [Tue Feb 17 18:24:59 2015 sendBuffer:0179]result of serial write:: 15
 DEBUG: [Tue Feb 17 18:24:59 2015 main:0452]Sarting main loop....
And then this when I try to pair a Powerlink module on the Powermax+ panel:

Code: Select all

DEBUG: [Tue Feb 17 18:25:34 2015 packetManager:0335]Timeout while waiting packet: assumig packet is complete......
 DEBUG: [Tue Feb 17 18:25:34 2015 calculChecksum:0163]checksum: 00D5
 ERR: [Tue Feb 17 18:25:34 2015 deFormatBuffer:0199]checksum NOK calculated:00D5 in packet:0019
 ERR: [Tue Feb 17 18:25:34 2015 packetManager:0355]Packet not correctly formated
 DEBUG: [Tue Feb 17 18:25:34 2015 logBuffer:0153]BufferSize: 12
 ERR: [Tue Feb 17 18:25:34 2015 logBuffer:0154]Buffer: 0B 13 08 01 00 00 00 00 00 00 00 03
 DEBUG: [Tue Feb 17 18:25:34 2015 packetManager:0362]End of packet treatment
 DEBUG: [Tue Feb 17 18:25:38 2015 packetManager:0335]Timeout while waiting packet: assumig packet is complete......
 DEBUG: [Tue Feb 17 18:25:38 2015 calculChecksum:0163]checksum: 00D5
 ERR: [Tue Feb 17 18:25:38 2015 deFormatBuffer:0199]checksum NOK calculated:00D5 in packet:0019
 ERR: [Tue Feb 17 18:25:38 2015 packetManager:0355]Packet not correctly formated
 DEBUG: [Tue Feb 17 18:25:38 2015 logBuffer:0153]BufferSize: 12
 ERR: [Tue Feb 17 18:25:38 2015 logBuffer:0154]Buffer: 0B 13 08 01 00 00 00 00 00 00 00 03
 DEBUG: [Tue Feb 17 18:25:38 2015 packetManager:0362]End of packet treatment
I have tried various timeout values without any success - a value of around 5000 ms seems to be getting replies of the correct length (12) of the replies, but the replies themselves does not make any sense:

Code: Select all

0B 13 08 01 00 00 00 00 00 00 00 03
Anyone has a clue to what is going on ?

Regards
Nicolai
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 »

the log should show you incoming data such as

Code: Select all

DEBUG: [Sat Feb  7 04:56:57 2015 packetManager:0272]Timeout while waiting packet: assumig packet is complete......
DEBUG: [Sat Feb  7 04:56:57 2015 calculChecksum:0150]checksum: 0088
DEBUG: [Sat Feb  7 04:56:57 2015 deFormatBuffer:0182]checksum OK
DEBUG: [Sat Feb  7 04:56:57 2015 packetManager:0274]Packet received
DEBUG: [Sat Feb  7 04:56:57 2015 logBuffer:0140]BufferSize: 12
DEBUG: [Sat Feb  7 04:56:57 2015 logBuffer:0141]Buffer: A5 0D 01 00 00 00 00 00 00 00 80 43
INFO: [Sat Feb  7 04:56:57 2015 packetManager:0286]Packet not recognized
(extract from your log ) you definitly need to see such packet. if checksum is not OK, try changing the timeout, if you see nothing check your fingers (and your wiring precisely)
nkildal
Starting Member
Starting Member
Posts: 10
Joined: Tue Feb 17, 2015 7:29 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by nkildal »

Hi

Thank you for your reply - much appreciated :-)

I forgot to mention that I tested connectivity by connecting the USB TTL interface to my PC instead of the Raspberry, and was then able to use Visonics own application to communicate with the Powermax+ panel (upload/download and modify all configuration).
So the wiring should be fine.

The timeouts:
I have tried various values ranging from 100ms though to 100000ms - but usually 1000ms to 5000ms.
Only when I am using values around the 5000ms range I get packets of length 12 - my problems are the individual hex values seem off.

Do you know if there could be some architectural difference (little/big endian?) difference that makes some of the calculations go wrong along the way ?
Has anyone else been successful in running pmaxd on a Raspberry Pi ?

Regards
Nicolai
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 »

send me the log when you see your 12 byte length packet with timeout = 5000
nkildal
Starting Member
Starting Member
Posts: 10
Joined: Tue Feb 17, 2015 7:29 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by nkildal »

Hi again

Sorry for the delayed reply:
I have tried 3 various timeout values - 5000, 2000 and 20000 ms - and have attached the log file showing debug output from each.

Regards
Nicolai
Attachments
pmaxd.raspberrypi.log.zip
pmaxd log file from raspberrypi with various timeout values
(1.75 KiB) Downloaded 659 times
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 »

tweaking require a bit more work...... :-)
you clearly see 5000 is your best bet....
try going from 4000 to 6000 with 100 intervals and see if things improve (checksum are OK and packet buffer is bigger but not too big)
nkildal
Starting Member
Starting Member
Posts: 10
Joined: Tue Feb 17, 2015 7:29 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by nkildal »

Hi

Ok - I just went through all timeout values from 4000 to 6000 ms in 100 ms steps :-)
I seem to be getting the exact same decoding of the replies no matter which timeout value I choose :-(

Code: Select all

 ERR: [Wed Feb 25 08:07:41 2015 deFormatBuffer:0199]checksum NOK calculated:00D5 in packet:0019
 ERR: [Wed Feb 25 08:07:41 2015 packetManager:0355]Packet not correctly formated
 DEBUG: [Wed Feb 25 08:07:41 2015 logBuffer:0153]BufferSize: 12
 ERR: [Wed Feb 25 08:07:41 2015 logBuffer:0154]Buffer: 0B 13 08 01 00 00 00 00 00 00 00 03
I have attached a log showing all replies...

Regards
Nicolai
Attachments
pmaxd.raspberrypi2.log.zip
Powermax debug - 4000ms to 6000ms
(1.07 KiB) Downloaded 641 times
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 »

sorry to tell you that but are you sure you connected it to the right port (PC/IP) and not another one (the serial port for example) that works with the PC software.
can you send us a picture of your setup ?
nkildal
Starting Member
Starting Member
Posts: 10
Joined: Tue Feb 17, 2015 7:29 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by nkildal »

Hi

I'll snap some pictures later.
I am using the only exposed port on the Powermax+, which is a 14-pin header (2x7 pin) - where you can plug in the original visonic serial interface.
There should also exist an internal port (2x5 pin I believe) but I must confess, that I have not yet tried hooking up to that one...

Regards
Nicolai
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 »

please check 1st page of the post you will clearly see the only header working : the PC/IP port a plug 2x5 header with precise pinout other header won't work
nkildal
Starting Member
Starting Member
Posts: 10
Joined: Tue Feb 17, 2015 7:29 pm

Re: Powerlink serial pinout, linux daemon and web interface

Post by nkildal »

D'Oh! - stupid me - somewhere along the way I must have mistakenly thought the RX/TX pins on the 2x7 pin header would be identical to the ones in the hidden 2x5 header (PC/IP).
Sorry for having taken your time - I'll open op the alarm panel and try communicating with the PC/IP port first thing tomorrow then :-)

Well - if I make it work - I'll perhaps take a look at making your code run on an ESP8266.
It is tiny enough to solder directly onto a 2x5 connector ands just plug it in.
At 3$/piece I think it would be great if these devices could run your software :-)

Thanks, Nicolai
Post Reply

Return to “Visonic Alarm systems”