Add WiFi to your alarm with esp8266

Forum about Visonic products like Powermax Plus and Powermax Pro

Moderators: Rene, Willem4ever

Add WiFi to your alarm with esp8266

Postby irekz » Tue Jun 14, 2016 9:23 pm

Wrote a C++ library that can communicate with PowerMax alarms (based on excellent code and articles found here).
First use for this library is to add WiFi capability to PM for less than 5£ using Wemos D1 ESP8266 board.

Here are some highlights:
- ESP8622 can be connected to serial interface of PM alarm, powered from 12V rail, and hidden inside (no wires!)
- No other dependencies, no need for a PC or raspberry Pi
- You have access to ESP8622 sketch source code, and can flash updates to the ESP firmware via WiFi (no need for opening the PM)

ESP8622 can work in two modes:
- stand alone: (where device acts like a powerlink, actively communicating with alarm)
In this mode it exposes a telnet and simple web interface, via telnet you can arm/disarm system etc.
- transparent packet relay: in this mode ESP will not interpret packets, will simply pass all traffic from remote app to the alarm.
This mode is used by Windows command line application - that you can build, modify etc.

Code status:
- ready to play with for DEVELOPERS (people who can read, modify code)
- minimal to no security (anyone on wifi network can talk to alarm, it's up to you to implement something more suitable)
- I will be working on improvements to the code and possibly will implement simple authentication etc

More details and source code:
https://github.com/irekzielinski/PowerMaxAlarm

I'm looking forward for you guys to contribute to the project!
Cheers,
Irek

ps. If you have any issues with the code, it might be faster for your to raise those directly on GitHub:
https://github.com/irekzielinski/PowerMaxAlarm/issues
Last edited by irekz on Tue Aug 02, 2016 10:45 am, edited 1 time in total.
irekz
Starting Member
Starting Member
 
Posts: 26
Joined: June 2016

Re: Add WiFi to your alarm with esp8266

Postby Bwired » Thu Jun 16, 2016 8:38 am

Nice!
User avatar
Bwired
Administrator
Administrator
 
Posts: 5299
Joined: March 2006
Location: Netherlands

Re: Add WiFi to your alarm with esp8266

Postby Phaeton » Thu Jun 16, 2016 12:02 pm

Awesomely done!
groeten,
Harry
User avatar
Phaeton
Advanced Member
Advanced Member
 
Posts: 565
Joined: May 2010
Location: Wassenaar

Re: Add WiFi to your alarm with esp8266

Postby Mario from Spain » Thu Jun 16, 2016 12:48 pm

That's fantastic!
Mario from Spain
Member
Member
 
Posts: 53
Joined: December 2013

Re: Add WiFi to your alarm with esp8266

Postby retiredtech » Mon Jul 25, 2016 10:16 pm

Irek,
I recently came across your project for connecting to the Visonic Powermax via WiFi and was immediately interested. I have had a Powermax + operational for 8 years and have been looking into using the Raspberry Pi as an interface. I am more interested in your approach so decided to see if I could get your code installed and running for a test. I have the WeMos esp8266 installed and operational and running other sketches but when I try to verify/compile your code I get all kinds of errors. First, please understand I am not a software coder of either C++ or Python so I am starting at a real disadvantage. The first error is that it cannot find the Pmax.h file which I have put in multiple folders. So I removed that #include to see how far I could get but there are multiple other errors so I gave up. So, either I have done something completely wrong or your code is just not ready to be sent to the esp8266 yet.
Would appreciate some guidance....

Richard
retiredtech
Starting Member
Starting Member
 
Posts: 5
Joined: July 2016

Re: Add WiFi to your alarm with esp8266

Postby Botap » Tue Jul 26, 2016 9:39 am

Hi,

I am trying to make this work on my PowerMax Pro, but I am facing a few issues and I hope you will be able to help me with this:
1. When compiling the sketch I am getting following error:
sketch/pmax.cpp:1650: undefined reference to `os_getLocalTime(unsigned char&, unsigned char&, unsigned char&, unsigned char&, unsigned char&, unsigned char&)'

When I remove the os_getLocalTime from the pmax.cpp file I can compile the sketch and load it to the WeMos board.

After that I can connect succesful to the board via Telnet and/or the windows application and I can see a lot of information by pressing r
But when trying to (a)rm or (d)isarm nothing happens.
Also when trying to read the signal strength for instance I get an access denied error:
!
[5][KeyPressHandling @ 104] Get zone signal strength
[6][serialHandler @ 34] --- new packet 16:08:36 ----
[6][PowerMaxAlarm::handlePacket @ 1739] Command found: 'Acknowledgement 2'
[6][serialHandler @ 34] --- new packet 16:08:36 ----
[6][PowerMaxAlarm::handlePacket @ 1739] Command found: 'Access denied'
[6][PowerMaxAlarm::OnAccessDenied @ 1254] Access denied
[6][serialHandler @ 34] --- new packet 16:08:37 ----
[6][PowerMaxAlarm::handlePacket @ 1739] Command found: 'Acknowledgement 2'

I am not sure if this is due to the fact I had to remove the os_getLocalTime function from the sketch?

Any help will be very much appreciated as this is a very interesting project
Regards
Bart
Botap
Starting Member
Starting Member
 
Posts: 2
Joined: March 2016

Re: Add WiFi to your alarm with esp8266

Postby irekz » Mon Aug 01, 2016 9:30 am

retiredtech wrote:Irek,
The first error is that it cannot find the Pmax.h file which I have put in multiple folders. So I removed that #include to see how far I could get but there are multiple other errors so I gave up. So, either I have done something completely wrong or your code is just not ready to be sent to the esp8266 yet.
Would appreciate some guidance....
Richard


Hi Richard.
Directory structure needs to be the same as in Github:

c:\yourArduinoFolder\Libraries\PMax
c:\yourArduinoFolder\PowerMaxEsp8266

Check this link for more information:
https://www.arduino.cc/en/Guide/Libraries#toc5

I would also expect "c:\yourArduinoFolder\" to be listed in settings as "sketchbook location":
http://www.alanzucconi.com/wp-content/u ... 0/ard2.png

Please let me know if it works for you.
Kind regards,
Irek
irekz
Starting Member
Starting Member
 
Posts: 26
Joined: June 2016

Re: Add WiFi to your alarm with esp8266

Postby irekz » Mon Aug 01, 2016 9:34 am

Botap wrote:Hi,
1. When compiling the sketch I am getting following error:
sketch/pmax.cpp:1650: undefined reference to `os_getLocalTime(unsigned char&, unsigned char&, unsigned char&, unsigned char&, unsigned char&, unsigned char&)'

When I remove the os_getLocalTime from the pmax.cpp file I can compile the sketch and load it to the WeMos board.


This has been fixed on github.


Botap wrote:[5][KeyPressHandling @ 104] Get zone signal strength
[6][serialHandler @ 34] --- new packet 16:08:36 ----
[6][PowerMaxAlarm::handlePacket @ 1739] Command found: 'Acknowledgement 2'
[6][serialHandler @ 34] --- new packet 16:08:36 ----
[6][PowerMaxAlarm::handlePacket @ 1739] Command found: 'Access denied'
[6][PowerMaxAlarm::OnAccessDenied @ 1254] Access denied
[6][serialHandler @ 34] --- new packet 16:08:37 ----
[6][PowerMaxAlarm::handlePacket @ 1739] Command found: 'Acknowledgement 2'


We had number of email exchanges outside this forum.
The original code was developed on PowerMax Complete system that supports auto-enrollment.
With Bart help I have much better understanding of older units and will update code on Github soon to support manual enrollment.

Kind regards,
Irek
irekz
Starting Member
Starting Member
 
Posts: 26
Joined: June 2016

Re: Add WiFi to your alarm with esp8266

Postby retiredtech » Tue Aug 02, 2016 4:38 pm

irekz wrote:
retiredtech wrote:Irek,
The first error is that it cannot find the Pmax.h file which I have put in multiple folders. So I removed that #include to see how far I could get but there are multiple other errors so I gave up. So, either I have done something completely wrong or your code is just not ready to be sent to the esp8266 yet.
Would appreciate some guidance....
Richard


Hi Richard.
Directory structure needs to be the same as in Github:

c:\yourArduinoFolder\Libraries\PMax
c:\yourArduinoFolder\PowerMaxEsp8266

Check this link for more information:
https://www.arduino.cc/en/Guide/Libraries#toc5

I would also expect "c:\yourArduinoFolder\" to be listed in settings as "sketchbook location":
http://www.alanzucconi.com/wp-content/u ... 0/ard2.png

Please let me know if it works for you.
Kind regards,
Irek



Irek,
Yes, your instructions worked perfectly.....thank you!
Richard
retiredtech
Starting Member
Starting Member
 
Posts: 5
Joined: July 2016

Re: Add WiFi to your alarm with esp8266

Postby irekz » Wed Aug 03, 2016 9:03 am

retiredtech wrote:Irek,
Yes, your instructions worked perfectly.....thank you!
Richard


Cool :-)
I described this procedure on GitHub:
https://github.com/irekzielinski/PowerM ... MaxEsp8266

If you have any issues, don't hesitate to contact me or raise it via:
https://github.com/irekzielinski/PowerMaxAlarm/issues

Cheers,
Irek
irekz
Starting Member
Starting Member
 
Posts: 26
Joined: June 2016

Re: Add WiFi to your alarm with esp8266

Postby retiredtech » Fri Aug 05, 2016 7:21 pm

Irek,
My Powermax is the + (plus) series and as a result your diagram showing connection of the esp8266 to the RS232 port is incorrect. My connection has 12 pins on it instead of 10. Before I continue on I need to make sure your code will run on the esp8266 connected to the Powermax+? I will find the correct pins for the Tx, Rx and Gnd on my 12 pin plug so that won't be a problem.

Richard
retiredtech
Starting Member
Starting Member
 
Posts: 5
Joined: July 2016

Re: Add WiFi to your alarm with esp8266

Postby irekz » Tue Aug 09, 2016 9:55 am

retiredtech wrote:Irek,
My Powermax is the + (plus) series and as a result your diagram showing connection of the esp8266 to the RS232 port is incorrect. My connection has 12 pins on it instead of 10. Before I continue on I need to make sure your code will run on the esp8266 connected to the Powermax+? I will find the correct pins for the Tx, Rx and Gnd on my 12 pin plug so that won't be a problem.
Richard


Hi Richard.
Code should work with Powermax+. If you will get the pinout for your alarm - maybe you can draw a diagram - I will add it to guthub.
Thanks,
Irek
irekz
Starting Member
Starting Member
 
Posts: 26
Joined: June 2016

Re: Add WiFi to your alarm with esp8266

Postby retiredtech » Tue Aug 09, 2016 5:24 pm

Irek,
I found the RS-232 pin-out for the Powermax+ at: viewtopic.php?f=68&t=6581&start=45#p63022.
Richard
retiredtech
Starting Member
Starting Member
 
Posts: 5
Joined: July 2016

Re: Add WiFi to your alarm with esp8266

Postby ayasystems » Fri Sep 02, 2016 9:42 am

Great work!!!

I'm using WR703N with viknet powermax code (pmaxd) from some years ago... (last mod done by me here-> viewtopic.php?f=68&t=7152&p=80373#p80373 )

I will try your code with my test (non production powermax)

Witch features are you implemented on web server?

Could you post some screenshoots?

Best regards!!!!
ayasystems
Starting Member
Starting Member
 
Posts: 39
Joined: May 2014

Re: Add WiFi to your alarm with esp8266

Postby irekz » Wed Sep 07, 2016 9:21 am

ayasystems wrote:Witch features are you implemented on web server?
Could you post some screenshoots?


Sorry for the delay in response. I have been on holiday.
Web server allows to query state of the system (it outputs a JSON page).
To control the system - a telnet interface is exposed.

All of this can be easily modified to suit your needs.
Kind regards,
Irek
irekz
Starting Member
Starting Member
 
Posts: 26
Joined: June 2016

Next

Return to Visonic Alarm systems

Who is online

Users browsing this forum: No registered users and 1 guest