Add WiFi to your alarm with esp8266

Forum about Visonic products like Powermax Plus and Powermax Pro

Moderators: Rene, Willem4ever

irekz
Starting Member
Starting Member
Posts: 26
Joined: Wed Jun 01, 2016 10:48 pm

Add WiFi to your alarm with esp8266

Post by irekz »

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 11:45 am, edited 1 time in total.
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Add WiFi to your alarm with esp8266

Post by Bwired »

Nice!
User avatar
Phaeton
Advanced Member
Advanced Member
Posts: 573
Joined: Wed May 19, 2010 12:44 pm
Location: Wassenaar
Contact:

Re: Add WiFi to your alarm with esp8266

Post by Phaeton »

Awesomely done!
groeten,
Harry
Mario from Spain
Member
Member
Posts: 66
Joined: Wed Dec 04, 2013 11:06 am

Re: Add WiFi to your alarm with esp8266

Post by Mario from Spain »

That's fantastic!
retiredtech
Starting Member
Starting Member
Posts: 5
Joined: Mon Jul 25, 2016 10:45 pm

Re: Add WiFi to your alarm with esp8266

Post by retiredtech »

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
Botap
Starting Member
Starting Member
Posts: 2
Joined: Thu Mar 31, 2016 2:11 pm

Re: Add WiFi to your alarm with esp8266

Post by Botap »

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
irekz
Starting Member
Starting Member
Posts: 26
Joined: Wed Jun 01, 2016 10:48 pm

Re: Add WiFi to your alarm with esp8266

Post by irekz »

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: Wed Jun 01, 2016 10:48 pm

Re: Add WiFi to your alarm with esp8266

Post by irekz »

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
retiredtech
Starting Member
Starting Member
Posts: 5
Joined: Mon Jul 25, 2016 10:45 pm

Re: Add WiFi to your alarm with esp8266

Post by retiredtech »

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
irekz
Starting Member
Starting Member
Posts: 26
Joined: Wed Jun 01, 2016 10:48 pm

Re: Add WiFi to your alarm with esp8266

Post by irekz »

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
retiredtech
Starting Member
Starting Member
Posts: 5
Joined: Mon Jul 25, 2016 10:45 pm

Re: Add WiFi to your alarm with esp8266

Post by retiredtech »

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
irekz
Starting Member
Starting Member
Posts: 26
Joined: Wed Jun 01, 2016 10:48 pm

Re: Add WiFi to your alarm with esp8266

Post by irekz »

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
retiredtech
Starting Member
Starting Member
Posts: 5
Joined: Mon Jul 25, 2016 10:45 pm

Re: Add WiFi to your alarm with esp8266

Post by retiredtech »

Irek,
I found the RS-232 pin-out for the Powermax+ at: http://www.domoticaforum.eu/viewtopic.p ... =45#p63022.
Richard
ayasystems
Starting Member
Starting Member
Posts: 40
Joined: Wed May 28, 2014 5:05 pm

Re: Add WiFi to your alarm with esp8266

Post by ayasystems »

Great work!!!

I'm using WR703N with viknet powermax code (pmaxd) from some years ago... (last mod done by me here-> http://www.domoticaforum.eu/viewtopic.p ... 373#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!!!!
irekz
Starting Member
Starting Member
Posts: 26
Joined: Wed Jun 01, 2016 10:48 pm

Re: Add WiFi to your alarm with esp8266

Post by irekz »

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
Post Reply

Return to “Visonic Alarm systems”