Visonic Powermax Powerlink protocol description

Forum about Visonic products like Powermax Plus and Powermax Pro

Moderators: Rene, Willem4ever

Re: Powerlink protocol description

Postby Rene » Mon Jan 13, 2014 2:42 pm

Are you sure you add the preamble, checksum and postamble to the commands? And that the checksum is calculated correctly?
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: Powerlink protocol description

Postby lmaurice » Mon Jan 13, 2014 6:37 pm

Yes, I'm sure for the preamble and the postamble. Concerning the checksum, I tried the checksum as calculated in the Post and tried also with +1 and -1.

I'm a little worried about it because the checksum I receive from the Powermax is usually different from the method shown in the Post. (maybe, my calculation is wrong)

For instance, I receive 0x0D 0xAB 0x03 0x00 0x1E 0x00 0x31 0x2E 0x31 0x33 0x00 0x00 0x43 0x2D 0x0A

The sum of the Payload is 0x01 0xD2. The sum of the two bytes is 0xD3 which is < 255.
0xFF - 0xD3 = 2C. But, the checksum I received is 2D. I receive it every 30s and always with this result.

Best regards,
Laurent
lmaurice
Starting Member
Starting Member
 
Posts: 11
Joined: January 2014

Re: Powerlink protocol description

Postby dad » Mon Jan 13, 2014 6:43 pm

Rene wrote:Are you sure you add the preamble, checksum and postamble to the commands? And that the checksum is calculated correctly?


@Rene:

I assume you mean my code. It is a matter of where in the process you break the message down into its component parts. This is very much experimental code and I have still to decide what is done in the main loop and what is done in modules.

Basically the message is parsed in to the following vars in the subroutine:

Using the example:
CalcChksum(0da50004050400001007000043f2)
$chksum = 43f2 then substringed to f2
$chkstring = a50004050400001007000043
@bytes = 165 0 4 5 4 0 0 16 7 0 0 67
$outhex = 010c
@pairs = 01 0c
$chkcalc = f2

So it seems to work for me

Dad
dad
Starting Member
Starting Member
 
Posts: 30
Joined: June 2013

Re: Powerlink protocol description

Postby lmaurice » Mon Jan 13, 2014 9:31 pm

Definitively, the checksum is strange with my PowerMax Pro.

For instance, I receive a Keep alive with payload : 0xA5 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x43 with a Cheksum of 0x16
When I sum the check load, I have EA. FF - EA = 15 different from 16

But, I have an event with a payload 0xA5 0x00 0x04 0x05 0x01 0x00 0x00 0x00 0x05 0x00 0x00 0x43 with a checksum of 0x08
When I sum the check load, I have F7. FF - F7 = 08. There the calculation is OK

I have no idea when to take the calculation and when to add 1.
Has anybody any idea ?

Laurent
lmaurice
Starting Member
Starting Member
 
Posts: 11
Joined: January 2014

Re: Powerlink protocol description

Postby dad » Mon Jan 13, 2014 11:07 pm

lmaurice wrote:Definitively, the checksum is strange with my PowerMax Pro.

For instance, I receive a Keep alive with payload : 0xA5 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x43 with a Cheksum of 0x16
When I sum the check load, I have EA. FF - EA = 15 different from 16

Laurent


Strange I have exactly the same message in my logs, but the checksum is 0x15!

Code: Select all
0da5000200000000000000004315


Dad
dad
Starting Member
Starting Member
 
Posts: 30
Joined: June 2013

Re: Powerlink protocol description

Postby viknet » Mon Jan 13, 2014 11:51 pm

check this thread page 2 message by myself about how to calculate checksum:
viewtopic.php?f=68&t=6581&start=15#p55247

I find the proposed code dodgy in some case (false by 1) and proposed mine :

unsigned short checksum,i;
checksum=0xFFFF; (or 0xFF*x)
for (i=0;i<(Buff->size);i++)
checksum=checksum-Buff->buffer[i];
checksum=checksum%0xFF;
viknet
Member
Member
 
Posts: 65
Joined: January 2012

Re: Powerlink protocol description

Postby Rene » Tue Jan 14, 2014 12:07 am

This is the VB.Net code, which I use in the Homeseer plugin, to calculate the checksum:
Code: Select all
chkSum = 0
For index = 1 To alRecBuf.Count() - 3
  chkSum += alRecBuf.Item(index)
Next
chkSum = chkSum Mod &HFF
If chkSum And &HFF Then
  chkSum = chkSum Xor &HFF
End If
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: Visonic Powermax Powerlink protocol description

Postby Mario from Spain » Tue Jan 14, 2014 9:45 pm

Hello.

I managed to write the VB.NET code to calculate the Powermax checksum.

The code is a little mess but I put it here just in case anyone needs it:

Code: Select all
'===========================================================================================================================
    ' Receives an Hex string and returns a char with the checksum
    '===========================================================================================================================
    Public Function PowermaxChecksum(ByVal MyHexString As Object)

        Dim HexS() As String
        Dim aSrtring As String
        Dim Checksum As UShort = 0
        Dim HighByte As Byte
        Dim LowByte As Byte
        Dim I As Integer
        Dim bytes As Byte()

        ' Sample Message
        ' 0D AB 0A 00 01 00 00 00 00 00 00 00 43 06 0A     
        '  |                                      |  |
        '  |                                      |  Postample
        '  |                                      Checksum
        '  Preamble

        HexS = MyHexString.Split(" ")
        Dim data(HexS.Length) As Byte
        ' 1. Sum all the payload bytes in a word;.
        For I = 0 To HexS.Length - 1
            data(I) = CLng("&h" & HexS(I))
            Checksum = Checksum + CLng("&h" & HexS(I))
        Next

        ' 2. Subtract both high and low byte from FFFF; (ej FFFF-00-FF = FF00)
        bytes = BitConverter.GetBytes(Checksum)
        LowByte = bytes(0)
        HighByte = bytes(1)
        Checksum = &HFFFF - HighByte - LowByte

        ' 3. Low byte contains the checksum.
        bytes = BitConverter.GetBytes(Checksum)
        LowByte = bytes(0)
        Checksum = LowByte

        aSrtring = Conversion.Hex(Checksum)
        If aSrtring.Length = 1 Then
            aSrtring = "0" & aSrtring
        End If

        Return aSrtring
    End Function


@Rene: I just saw your message with the code you use in the HomeSeer plugin. Thank you very much for sharing. :)

Hope it's usefull for somebody.

Mario.
Mario from Spain
Member
Member
 
Posts: 65
Joined: December 2013

Re: Visonic Powermax Powerlink protocol description

Postby Mario from Spain » Tue Jan 14, 2014 10:10 pm

I'm very happy :D ! THANK YOU ALL!

after finding out how to calculate de Powermax checksum and how to deal with the communications in HomeSeer I'm progressing a little more with it...

For now I can from HomeSeer:

- Arm and Disarm in all four modes (Disarm, Arm home, Arm away and Arm home instantly).
- Receive the open/close zones information.
- Get the panel status (Disarm, Exit Delay, Entry Delay, Armed Home, Armed Away, Home Bypass, Away Bypass, Ready, Not Ready, etc)

I'm rigth now trying to add other things as I progress studing the protocol ducumentation (thank you very much, guys, for a great work!)

My VB code is a complete mess and everything is hardcoded for my system but... hey, after four full time days of work it works! :)

Mario.
Mario from Spain
Member
Member
 
Posts: 65
Joined: December 2013

Re: Visonic Powermax Powerlink protocol description

Postby bartbakels » Fri Jan 17, 2014 8:07 pm

Mario just curious are u writing something to work with homeseer 2 or homeseer 3...? Im very interested in a hs3 solution

Regards bart


Verzonden vanaf mijn iPhone met behulp van Tapatalk
Software: HS3, HStouch, Plugwise , BLBackup, BLLatestImage, Zwave, JowiHUE, PHlocation, Netcam, Harmony Plugin, ThinkingCleaner, HSPhone, Eneco Toon Script, Pushover, Visonic Powermax LV Interface

(ON ESXI )on NUC
bartbakels
Advanced Member
Advanced Member
 
Posts: 514
Joined: May 2011

Re: Visonic Powermax Powerlink protocol description

Postby Mario from Spain » Fri Jan 17, 2014 11:42 pm

Hi Bart.

I'm writing it for HS2. I plan to upgrade to Hs3 anytime soon (1-3 months) and will adapt the script. Problem is it's very hard coded for my setup and will need a big adjust (code rewrite) to work in any other setup.
Other than that I will be happy to share the code when it work better (right now it's loosing some commands and loosing "sync" because the communication loop isn't very fine tuned). Also I have to add code in order to process few some more things coming from the Powermax.
Mario from Spain
Member
Member
 
Posts: 65
Joined: December 2013

Re: Visonic Powermax Powerlink protocol description

Postby bartbakels » Sat Jan 18, 2014 12:59 am

Ok keep me posted.. Thanks in advance
Software: HS3, HStouch, Plugwise , BLBackup, BLLatestImage, Zwave, JowiHUE, PHlocation, Netcam, Harmony Plugin, ThinkingCleaner, HSPhone, Eneco Toon Script, Pushover, Visonic Powermax LV Interface

(ON ESXI )on NUC
bartbakels
Advanced Member
Advanced Member
 
Posts: 514
Joined: May 2011

Re: Visonic Powermax Powerlink protocol description

Postby bruce_miranda » Mon May 12, 2014 10:25 pm

Anyone managed to get the rs232 data off a powermax pro that has pl2 installed
bruce_miranda
Starting Member
Starting Member
 
Posts: 33
Joined: April 2014

Re: Visonic Powermax Powerlink protocol description

Postby d0min0 » Sun Jun 08, 2014 8:22 pm

Hi,

I'm connecting a Raspberry Pi via a RS232-USB dongle. I have connected the double interface with cable etc to my USB dongle and I think I have gotten the dongle to work properly with the correct baudrate etc.

However, I'm curious, how do I initiate communcation with my PowerMax Complete unit?

Is there any example code (preferably in Python?) that connects to the unit and gets a status message back etc?

Did I understand it correctly, or is there a third PIN that is supposed to be used for remote connections? Or should I use the user PIN or installation PIN?

Awesome job, but I'm not sure how to proceed with setting up the basic communcation. :-(

Thanks in advance.

// Michael
d0min0
Starting Member
Starting Member
 
Posts: 2
Joined: June 2014

Re: Visonic Powermax Powerlink protocol description

Postby bartbakels » Thu Jun 12, 2014 10:14 am

Mario from Spain wrote:I'm very happy :D ! THANK YOU ALL!

after finding out how to calculate de Powermax checksum and how to deal with the communications in HomeSeer I'm progressing a little more with it...

For now I can from HomeSeer:

- Arm and Disarm in all four modes (Disarm, Arm home, Arm away and Arm home instantly).
- Receive the open/close zones information.
- Get the panel status (Disarm, Exit Delay, Entry Delay, Armed Home, Armed Away, Home Bypass, Away Bypass, Ready, Not Ready, etc)

I'm rigth now trying to add other things as I progress studing the protocol ducumentation (thank you very much, guys, for a great work!)

My VB code is a complete mess and everything is hardcoded for my system but... hey, after four full time days of work it works! :)

Mario.


Mario,

Are you willing to discuss and share your code? Also willing to pay for it. I am trying to interface the visonic alarm in HS3. At this moment i use the HSgateway tools from Jon00 However the arming disarming etc, doe not work very reliable. Next to that i want to get rid of my HS2 installation. You can contact me if needed on bartbakels at ziggo .nl

regards

Bart
Software: HS3, HStouch, Plugwise , BLBackup, BLLatestImage, Zwave, JowiHUE, PHlocation, Netcam, Harmony Plugin, ThinkingCleaner, HSPhone, Eneco Toon Script, Pushover, Visonic Powermax LV Interface

(ON ESXI )on NUC
bartbakels
Advanced Member
Advanced Member
 
Posts: 514
Joined: May 2011

PreviousNext

Return to Visonic Alarm systems

Who is online

Users browsing this forum: No registered users and 1 guest