Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Aritech Alarm Internet Dialler

123578

Comments

  • Registered Users Posts: 227 ✭✭bibibobo


    Hi, I saw your project also. Very interesting and similar tools used. I have a Raspberry pi 2 running mosquitto and node-red for various MQTT, Sonoff S20 wifi sockets, gasboiler controller, doorbell disabling, temperature, pressure monitoring etc etc. It has been very reliable for over a year now. This guys blog and script is great for getting started ... I'll leave the link here for other techy types to follow if they want. https://tech.scargill.net/a-christmas-script/.

    I briefly looked at using pushbullets for another project but gave up very quickly. I would love to try it. Any chance of pm'ing your flow code for analysis?

    Am very interested in how you connected the ESP01 to the smoke alarm though I'm not sure my alarm panel (HKC SW8/12) has a fire alarm input. Still I could just publish to MQTT and manipulate in node-red direct.

    D


  • Registered Users, Registered Users 2 Posts: 205 ✭✭Bazsutto


    bibibobo wrote: »
    Pics of my HKC alarm version which I thought about implementing for nearly a year. The design changed a few times in my head and I have eventually arrived at this design. I was going to add a GSM dialler e.g. SIM900A/SIM800L but I have abandoned that for now. Working very well for nearly a month now.

    Electronics used:
    Wemos D1 mini ESP8266 €2.18 on aliexpress
    DC-DC convertor €0.60
    Quad optoisolator (PC847 or four PC817) €0.40
    2k resistors (<€0.05)
    Miscellaneous connectors, wire, board <€2

    Features:
    1. Publishes change in output status to MQTT. GPIO inputs are debounced at 50ms.
    2. Publishes to MQTT at various intervals; RSSI signal strength, status of all panel outputs, clientid on boot (from mac address)
    3. Interfaces to Node-red server to send emails via gmail node and SMS txts via Twilio node on change in panel outputs or alarm activations.
    4. Reconnects on loss of wifi or link to MQTT server.
    5. Allows OTA updates for easy development changes from the desk.

    Anybody interested in the arduino code can pm me.

    Nice project. My arduino is hardwired to my network. I purchased a Wemos a good while back and haven't got round to messing around with it to get familiar with. I have the Sim800L as part of my system. As you outlined, a separate PSU is required to power. I used a 2A 5V AC/DC step-down converter ($4 on banggood). Only drawback is it only runs on mains so not active during power cut . Running reliably for over a year now (more reliable than email notifications).

    Gary's post this time last year got me thinking about alarming the shed. As I didn't have a wireless access point for my system I just modified a 12V RF transmitter purchased on banggood for $7 and used a second arduino in shed. Powered it with alarm battery and solar panel. Worked great in summer, but had to upgrade battery to car one for these dark days of winter.

    I would like to try the Wemos and node-red for this in the future.


  • Registered Users Posts: 50 ✭✭GryKyo


    I will come back to you with flows for Node-RED, I have to look and see if I export my flows do I export my paths, passwords etc for API's, Emails etc... security.

    For the moment, a picture speaks a thousand words. Here is an image of the parts in the smoke alarm.

    Smoke_Alarm_Parts.jpg

    It uses an ESP-01 verson of the ESP8266 chip which you can see in the image with a USB to serial adaptor. Hint: If you are buying a programmer, get one with a switch to pull GPIO to GND at power up. This puts the chip in to flashing mode so a program can be uploaded.

    The other PCB in the frame with the ESP-01 is a tiny little DC to DC buck converter. It has solder pads on the rear which allow you to select a fixed voltage (all the popular dc voltages from 0-12 including 3.3V). As supplied it is on the pot adjuster but only needs a track cut and blob of solder to fix voltage.

    Most of the smoke alarms use a standard control IC which generally has a GPIO pin. If your smoke alarm doesn't have an output to daisy-chain to other alarms as sounders then you can probe the circuit and find the pin. In my alarm found at the check out of Woodies there is a pin with no connection which jumps to 9Volts when the alarm sounds. I use this with a small resistor, about 330ohm if I remeber right to pull the "enable" pin of the buck converter high. This turns on the 3.3V supply to the ESP-01 module which then runs a simple sketch.

    As long as the alarm is sounding and the power is supplied to the ESP-01 it connects to the WiFi (I use a static IP as it is considerably faster and more reliable to connect). Once it establishes WiFi it pushes a message to my phone via Pushbullet and MQTT to Node-RED. I can use this to trigger the fire alarm circuit on the house alarm; the hope being if there was a fire when we weren't home somebody's attention might be drawn to the house. The fire alarm sounds on/ff with intervals of about 10 seconds so sounds a bit odd.

    I can send the sketch by PM if anybody wants to see how it works. It uses the WiFiManager library so will setup a "hot spot" and webserver and host a config web page to allow a user to input new WiFi creds.


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    I too have been looking at the ESP platform... and have have some good success with porting the Aritech Keypad Emulator code over to the ESP32 Chip.

    I'm using this little $9 open source board (D-duino-32) which has a tiny display built in... but any ESP32 should work.

    Benefits of this over the Arduino, is as well as built in WiFi - is lots more space to implement better web pages and https connections.
    It also has bluetooth built in which could have interesting possibilities...

    Progress so far - Its connecting well to the Aritech 4 wire keypad bus and is updating the the keypads display to its little screen... :)

    6ppwys.jpg

    And by emulating a CD9038 Keypad this time - you will get a few more zones to use in the system
    that can be triggered by things connected to the the ESP32... :D

    “Roll it back”



  • Registered Users Posts: 50 ✭✭GryKyo


    ozmo wrote: »
    I too have been looking at the ESP platform... and have have some good success with porting the Aritech Keypad Emulator code over to the ESP32 Chip.

    I'm using this little $9 open source board (D-duino-32) which has a tiny display built in... but any ESP32 should work...

    Cool!
    I have a couple of those boards too, branded Wemos LoLin ESP32... but don't own an Aritech! That said I'm keen to follow your progress.

    Lots of stuff to explore yet, Bluetooth as you say but lots of I/O, multi analogs, touch, separate CPU's, really deep sleep etc but that's taking this thread on a tangent!


  • Registered Users Posts: 2 makkie2002


    Nice work Ozmo!

    I also have some ESP32 lying around. It would be instructive to get some more information on how you did this (including the source code :) ).

    ozmo wrote: »
    I too have been looking at the ESP platform... and have have some good success with porting the Aritech Keypad Emulator code over to the ESP32 Chip.

    I'm using this little $9 open source board (D-duino-32) which has a tiny display built in... but any ESP32 should work.

    Benefits of this over the Arduino, is as well as built in WiFi - is lots more space to implement better web pages and https connections.
    It also has bluetooth built in which could have interesting possibilities...

    Progress so far - Its connecting well to the Aritech 4 wire keypad bus and is updating the the keypads display to its little screen... :)



    And by emulating a CD9038 Keypad this time - you will get a few more zones to use in the system
    that can be triggered by things connected to the the ESP32... :D


  • Registered Users Posts: 116 ✭✭freddy99


    Does anyone have the arduino system working reliably with an Aritech 350?
    When I trialed it, it gave keypad fault issues every couple of weeks which could not be reset remotely. I’d love to have this running, or even a raspberry Pi equivalent.
    Thanks.


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    makkie2002 wrote: »
    Nice work Ozmo!

    I also have some ESP32 lying around. It would be instructive to get some more information on how you did this (including the source code :) ).

    Took a break over christmas and didnt manage to continue back on it - I can send on my progress to anyone who wants to have a look - I had the wifi and all the aritech side of the comms done - it now needs the webserver side to be ported to the esp32 wifi libraries - wifi libraries work differently to the lan libraries - the advantage of the esp32 is that you dont need an ethernet card and you have lots more space for better html - plus should be able to do https.
    freddy99 wrote: »
    Does anyone have the arduino system working reliably with an Aritech 350?
    When I trialed it, it gave keypad fault issues every couple of weeks which could not be reset remotely. I’d love to have this running, or even a raspberry Pi equivalent.
    Thanks.

    This is one aritech I don't have a sample board for... but if I see anything that could cause it when porting the above Ill let you know.

    “Roll it back”



  • Registered Users Posts: 2 makkie2002


    ozmo wrote: »
    Took a break over christmas and didnt manage to continue back on it - I can send on my progress to anyone who wants to have a look - I had the wifi and all the aritech side of the comms done - it now needs the webserver side to be ported to the esp32 wifi libraries - wifi libraries work differently to the lan libraries - the advantage of the esp32 is that you dont need an ethernet card and you have lots more space for better html - plus should be able to do https.

    I want to have look !
    I assume the hardware side requires always some electronics to get to the correct voltage levels (esp32 = 3.3V)?


  • Advertisement
  • Registered Users Posts: 2 conor_murphy


    I've been looking at using a ESP32 to provide an interface to a HKC SW8/12.

    The plan is for the ESP32 to provide a COAP interface and use a Pi running OpenHAB to provide the user interface.

    Ozmo, is there much work involved in porting the code you had for the HKC SW8/12 over to the ESP32?

    Thanks,
    Conor


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    I've been looking at using a ESP32 to provide an interface to a HKC SW8/12. ... is there much work involved?

    Here is the Link to ESP32 ported code - the Aritech side works - and displays the Aritech RKP Display on the ESP's i2C LCD.

    https://github.com/OzmoOzmo/CastleAritechArduinoESP32

    It's there except for the Webserver side needs to be written (WebSocket::EtherPoll() in the file WebSocket.cpp).. That's the bit you want to provide yourself anyway - I'll post up the schematic later tonight - so let me know how you get on with it
    :)


    Edit: I put up the schematics and a photo of the Arduino wiring at the above url - you can also see the Aritech RKP displaying on the ESP's display screen. Only a couple resistors had to be changed.

    “Roll it back”



  • Registered Users Posts: 1 firefly2018


    hi Ozmo i only saw this thread , im looking to do this on my hkc , any chance i can get a look at hkc docs Thanks


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    any chance i can get a look at hkc docs Thanks

    These are as full a write-up altogether as I've got - if anything is unclear let me know.

    Aritech:
    http://www.instructables.com/id/House-Alarm-Internet-Dialer-With-Arduino-Reverse-E/

    HKC:
    http://www.instructables.com/id/Internet-Enable-a-HKC-Home-Alarm/

    Generic:
    http://www.instructables.com/id/Remote-Access-Your-Home-Alarm/

    “Roll it back”



  • Registered Users Posts: 32 mrkayak


    ozmo wrote: »
    Here is the Link to ESP32 ported code - the Aritech side works - and displays the Aritech RKP Display on the ESP's i2C LCD.

    https://github.com/OzmoOzmo/CastleAritechArduinoESP32

    It's there except for the Webserver side needs to be written (WebSocket::EtherPoll() in the file WebSocket.cpp).. That's the bit you want to provide yourself anyway - I'll post up the schematic later tonight - so let me know how you get on with it
    :)


    Edit: I put up the schematics and a photo of the Arduino wiring at the above url - you can also see the Aritech RKP displaying on the ESP's display screen. Only a couple resistors had to be changed.



    Hi Ozmo,

    From your 2 circuit diagrams, is that all you need to connect ESP32 to 4-wires ABCD Aritech Panel?
    Is it possible to directly power the ESP32 from the +12V on the panel ... eg with a voltage divider
    circuit, or is additional DC-DC converter necessary?
    For another project I'm powering a Pi-ZeroW from the Aritech Keypad, but I'm using a 12V-5V USB converter (like a cigarette lighter adaptor)

    I made your RKP with Arduino Uno a few years ago, and it worked great..!
    (I added a feature to detect 433MHz smoke alarm too)

    This time, I would like to just use ESP32 to provide a REST API to the Alarm (eg with aRest.io),
    so that I can Arm/Disarm, etc from my home-brew Home Automation system.
    I want to be able to set the alarm automatically with "Hey Google, we're going out now (or going to bed now)"

    Thanks.
    Best regards,
    Niall.


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    mrkayak wrote: »
    ..is that all you need to connect ESP32 to 4-wires ABCD Aritech Panel?
    Is it possible to directly power the ESP32 from the +12V on the panel ... eg with a voltage divider
    circuit, or is additional DC-DC converter necessary?

    You can power the Esp32 from the +12V on the A bus wire- I would use a dc-dc converter to get a nice stable 3.3v rather than a voltage divider as it needs to be very accurate - half a volt fluctuation and the esp could crash - a little more could maybe even fry it. Some ESP32 users put in a 100uF cap also across the 0 and 3.3v power to the ESP32 to give it power when it needs it.
    mrkayak wrote: »
    ...I would like to just use ESP32 to provide a REST API to the Alarm (eg with aRest.io), so that I can Arm/Disarm, etc from my home-brew Home Automation system.
    I want to be able to set the alarm automatically with "Hey Google, we're going out now (or going to bed now)"

    That would be really amazing - let us know how you get on with it!

    I was considering some home automation - and I was considering what this guys suggests - an ESP32 and Amazon Echo - as it means you are not (as) relient on the cloud (just amazons services) - and no monthly subs to pay -> https://www.youtube.com/watch?v=wMpWQ4znTqQ


    Very random use of Home Automation :D - but I like the use of the ESP32 Library to bypass the requirement for a paid-for iot website that might not always be there..

    “Roll it back”



  • Advertisement
  • Registered Users Posts: 32 mrkayak


    maurice1 wrote: »
    Well done Ozzo, looks good.
    I did something similar 2 years ago with aritech 10 zone panel cs450 and has been working fine since
    I Connected the 16 input/outputs through resistors into the  leonardo arduino inputs, Think they were 1k
    eg:
    int input0 = 0;  //D0 GREE Armed/UnArmed
    int input1 = 1;  //D1 YELL Alarm
    int input2 = 2;  //D2 BLUE P.A.
    int input3 = 3;  //D3 ORNG FIRE
    int input4 = 5;  //D5 RED  Internal Siren
    int input5 = 7;  //D7 BLCK Ext Bell
    int input6 = 10; //D10 WHT Doorbell
    int input7 = 11 ; //D11 BRN OR testswitch for input0
    int Led1  =  13;
    int analog0 = A0; //A0 W/O Entry/exit
    int analog1 = A1; //A1 O/W Hall+lounge
    int analog2 = A2; //A2 W/B Cloak+Laundry
    int analog3 = A3; //A3 B/W Patio+Kit
    int analog4 = A4; //A4 W/G Bed123+enS
    int analog5 = A5; //A5 G/W Bed4+Bath
    int analog6 = A8; //D6 W/B PIR Hall+Kit
    int analog7 = A9; //D8 B/W PIR Patio

    When their values changed providing input 0 was low (armed) it sent an email from smtp.upcmail.ie to me@eircom.net.
    This seemed to work fine for a week or 2 but then forgot to send them.

    I then made it that everytime the hall door opened I got an email so that kept it awake.

    I also bought 100 texts from txtlocal.co.uk for about £5,
    so when outside bell goes on I get a text, showing which sensors are open at the time.
    I also get an email showing every sensors state.

    I prefer your system of just 6 wires, but my system only requires a resistor on the input.

    I ran the ethernet to the panel, as wifi is only another thing to go wrong

    For ease I got a piece of veroboard and mounted the pins on it backwards with a resistor on the inputs and the wiring on it. I nomorenails it to the alarm box with the pins sticking out so it is stationary and the ethernet shield just pushes onto it and the leonardo just pushes onto it.

    Butchered a 1A usb car cigarette adaptor fed from 12v battery to power it up and grounded the negative.

    I coded it so that led13 flashes like a strobe to show that it is alive and when sending an email it goes on for a second or 2. This made it easier to test.

    In engineering mode / output test and i make output 0 low, I can go around the house and test the whole alarm, via eircom emails
    Ozmo:  Would it be possible, do you think, to run your RKP code on an ESP32 to provide the web-interface for the keypad *and* wire up some of the inputs to the ESP32 and use aRest.io to expose these with a RESTful API...?  I think I'll try that approach anyway because I want to have programmatic access to the inputs without having to connect manually with a browser.  Thanks.


  • Registered Users Posts: 32 mrkayak


    ozmo wrote: »
    mrkayak wrote: »
    ..is that all you need to connect ESP32 to 4-wires ABCD Aritech Panel?  
    Is it possible to directly power the ESP32 from the +12V on the panel ... eg with a voltage divider
    circuit, or is additional DC-DC converter necessary?

    You can power the Esp32 from the +12V on the A bus wire- I would use a dc-dc converter to get a nice stable 3.3v rather than a voltage divider as it needs to be very accurate - half a volt fluctuation and the esp could crash - a little more could maybe even fry it. Some ESP32 users put in a 100uF cap also across the 0 and 3.3v power to the ESP32 to give it power when it needs it.
    mrkayak wrote: »
    ...I would like to just use ESP32 to provide a REST API to the Alarm (eg with aRest.io), so that I can Arm/Disarm, etc from my home-brew Home Automation system.
    I want to be able to set the alarm automatically with "Hey Google, we're going out now (or going to bed now)"

    That would be really amazing - let us know how you get on with it!

    I was considering some home automation - and I was considering what this guys suggests - an ESP32 and Amazon Echo - as it means you are not (as) relient on the cloud (just amazons services) - and no monthly subs to pay -> https://www.youtube.com/watch?v=wMpWQ4znTqQ


    Very random use of Home Automation  :D - but I like the use of the ESP32 Library to bypass the requirement for a paid-for iot website that might not always be there..
    Hi Ozmo,  for Home Automation, I use Raspberry Pi 3 with Google Assistant SDK.  For control of devices, I use IFTTT. It's all free of charge, and there's no subscription.  For example, "Hey Google, turn on the lights" will call a user-defined 'web hook' in IFTTT.  The web hook is just a URL to my php script (on an Apache website) running on my Rasp Pi.  And then in the php script, I can do any IOT thing that I want: lights, heating, music, etc, etc.   
    I have an ESP32 controlling my immersion (a 30A relay controlling the boiler switch, and one DS18b20 thermometer taped to the side of the tank).  If I say "Hey Google, is there any hot water?", then my PHP script will check the temp of the water using a RESTful API call to the ESP32, and if it's not hot enough, then it will fire the relay to turn on the boiler.  It also creates a linux 'at' command (like cron) to turn off the boiler in 15 minutes.
    My goal is to do the same thing for the alarm .. that's why I'm looking to setup a RESTful API interface instead of the browser UI.
    Thanks.
    Best regards,
    Niall.


  • Registered Users Posts: 9 atlyginimas


    mrkayak wrote: »
    Hi Ozmo,  for Home Automation, I use Raspberry Pi 3 with Google Assistant SDK.  For control of devices, I use IFTTT. It's all free of charge, and there's no subscription.  For example, "Hey Google, turn on the lights" will call a user-defined 'web hook' in IFTTT.  The web hook is just a URL to my php script (on an Apache website) running on my Rasp Pi.  And then in the php script, I can do any IOT thing that I want: lights, heating, music, etc, etc.   
    I have an ESP32 controlling my immersion (a 30A relay controlling the boiler switch, and one DS18b20 thermometer taped to the side of the tank).  If I say "Hey Google, is there any hot water?", then my PHP script will check the temp of the water using a RESTful API call to the ESP32, and if it's not hot enough, then it will fire the relay to turn on the boiler.  It also creates a linux 'at' command (like cron) to turn off the boiler in 15 minutes.
    My goal is to do the same thing for the alarm .. that's why I'm looking to setup a RESTful API interface instead of the browser UI.
    Thanks.
    Best regards,
    Niall.

    Hi,
    You did that?


  • Registered Users Posts: 5 hassemulle


    Im trying to connect my PC directly to the keypad (not the panel). So far I dont even manage to get the lights going on or anything on the display. It just plays dead.... but it has power.

    I am wondering if there is some description of the serial protocol?

    Anyone knows how to trigger it to turn on?

    Hope to get some help here.


  • Moderators, Home & Garden Moderators, Technology & Internet Moderators Posts: 24,789 Mod ✭✭✭✭KoolKid


    12 vdc to A & B
    C & D are TX RX AFAIK


  • Advertisement
  • Registered Users Posts: 5 hassemulle


    KoolKid wrote: »
    12 vdc to A & B
    C & D are TX RX AFAIK

    I know, but that does not turn on the lights or put anything on the display... I am also wondering about baudrate and other serial parameters. Im trying to reverse engineer the ozmo code on git towards a protocol description. So far not even the lights on the keypad turn on....


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    hassemulle wrote: »
    I know, but that does not turn on the lights or put anything on the display... I am also wondering about baudrate and other serial parameters. Im trying to reverse engineer the ozmo code on git towards a protocol description. So far not even the lights on the keypad turn on....

    Hi - the best place to see the protocol is indeed in the RKP.cpp file of the project - There are a lot of comments there that should help.

    At the top of that file you will see the baud rate - its a really odd one - i think its because its a factor of the crystal used in the keypad.
    #define nSerialBaudKP_RX 1953

    The project emulates the keypad - your project emulates the panel - so yeah - some translation will be required...

    The way it works is the Panel is the Master - it sends out a message (up to about 40 bytes) - there is a header, a command, some text to display, and a checksum. The header contains the message to turn on the display light, leds or sounder etc. The Command byte says eg. to display a message. The Message then follows. The checksum is sum of all the bytes sent as a simple check the message is complete.
    The exact code for building the display message (including flashing characters etc) and the calculation of the checksum is all in the RKP.cpp file.
    There is a counter in the header - that increments each message - in the rkp response it sends this back so the panel knows the rkp got the message ok -
    The RKP response is a very small packet and contains any key that was pressed and any tamper.

    The panel resends the message until the rkp replies it got it ok - if the RKP does not receive a message in a second or so - it will hard reset.


    Hope that helps - let me know how you connect it electrically to the pc - what voltage level etc.

    “Roll it back”



  • Registered Users Posts: 5 hassemulle


    ozmo wrote: »
    Hi - the best place to see the protocol is indeed in the RKP.cpp file of the project - There are a lot of comments there that should help.

    At the top of that file you will see the baud rate - its a really odd one - i think its because its a factor of the crystal used in the keypad.
    #define nSerialBaudKP_RX 1953

    The project emulates the keypad - your project emulates the panel - so yeah - some translation will be required...

    The way it works is the Panel is the Master - it sends out a message (up to about 40 bytes) - there is a header, a command, some text to display, and a checksum. The header contains the message to turn on the display light, leds or sounder etc. The Command byte says eg. to display a message. The Message then follows. The checksum is sum of all the bytes sent as a simple check the message is complete.
    The exact code for building the display message (including flashing characters etc) and the calculation of the checksum is all in the RKP.cpp file.
    There is a counter in the header - that increments each message - in the rkp response it sends this back so the panel knows the rkp got the message ok -
    The RKP response is a very small packet and contains any key that was pressed and any tamper.

    The panel resends the message until the rkp replies it got it ok - if the RKP does not receive a message in a second or so - it will hard reset.


    Hope that helps - let me know how you connect it electrically to the pc - what voltage level etc.

    Great! Thats a real helpfull response!

    It would help me a lot if you have some raw data dumps available. So that I have some byte array examples of messages that are comming from the panel (and back from the keypad). Replaying something that works is probably a pretty good first step.

    I have a Prolific USB-RS232 cable that I use.

    So the baud is 1953 bps?
    Other settings are N81?
    I see something about 9 databits in the rkp file. 9 databits on a PC.... highly complicated. Anything wordt mentioning on that?

    In a later stage I plan to replace my panel with a RPi. That way I can add function like controlling my music collection on the panel, showing which songs are playing etc. and also play gard dog sounds when the alarm is turned on. And much much more.


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    hassemulle wrote: »
    Great! Thats a real helpfull response!
    Replaying something that works is probably a pretty good first step.

    Remember the counter has to increment each time so the keypad sees its a new message and not a retransmit - and the checksum will change - so just replaying will probably not work...
    hassemulle wrote: »
    I have a Prolific USB-RS232 cable that I use.

    hassemulle wrote: »
    I see something about 9 databits in the rkp file. 9 databits on a PC.... highly complicated.

    The aritech is 8N1 bit at that unusual rate 1953 (got by using a scope) - the 9bit protocol is the HKC panel at 1658 baud - it watches out for the first bit being 1 and that signals its the first byte at the start of a message- 9bit is very unusual all right - but its a good solution to get the keypad in sync with the panel.

    Remember the voltage is very high so you will need bring it down to a voltage suitable for your usb device - I was able to hook up a USB to TTL Rs232 adapter to the PC and monitor the messages on the wire using a terminal program - using two resistors as a resistor divider to bring down the voltage to 5v. The HTC has the option to encrypt this data but is defaulted off.
    hassemulle wrote: »
    In a later stage I plan to replace my panel with a RPi.... .
    Sounds good!
    The original HKC and Aritech panels though had lots of protection for the cheap wire that was used to wire the house - the voltage is High (12 to 14v) to counteract voltage loses and if you look closely at the connectors on the panel there are zig zag spark gaps to help get rid of voltage spikes that protect the panel. Could be ok without them - but long runs of eg. untwisted alarm cable too close to mains etc could cause random rPi crashes without those protections.

    “Roll it back”



  • Registered Users Posts: 5 hassemulle


    ozmo wrote: »
    Remember the counter has to increment each time so the keypad sees its a new message and not a retransmit - and the checksum will change - so just replaying will probably not work...

    Well, that part I did not find in your code. So I hooked up everything to my CD7201 and tried to get the bytes from the panel to the keypad in my terminal program:

    see: www. md5 .nl / pics / ErrorFrames.JPG (new user, cannot post links yet... copy and remove spaces pls)

    But I didn't get any data that looked like good data. I expected some ASCII to show up.

    Then I checked the baudrate:

    see: www. md5 .nl / pics / SerialTrace2.JPG (new user, cannot post links yet... copy and remove spaces pls)

    Which give a bit time of 533us -> 1876 bps. Which I tried as well without success.

    I have closely examined your code and reverse engineered the meaning of all the bits and bytes. I tried sending that to my (seperate) keypad but except for some humming noices, nothing happened so far. I Even tried randomizing some bytes of which I dont know the meaning of all the bits but that gave no results either.

    Any ideas?


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    hassemulle wrote: »
    Any ideas?

    From the screenshot looks like you almost have it.

    This is the line that sends back the same counter value that was received - the panel increments this value 0 to 4 each message - the rkp sends it back in the 4 byte reply to ack the message was received ok.
    bool bAck = (msgbuf[0] & 0x04) != 0; //required for good comms

    Now the tricky part - you mention two keypads... tricky because the line is normally HIGH(12v) and when the rkp is transmitting it pulls the line voltage LOW to send a 1 bit - this means two things - no one keypad must try to hold the line HIGH all the time..
    This also means that the signal is inverted TTL from normal RS232.
    The transistor circuit I made in post 32 will do both these things - invert the signal and effectively disconnect from the line when not talking to give some other keypad a chance to send a message on the same line.

    You should be able see the ASCII if (1) your Terminal software supports Inverted TTL - or (2) you move your connection to the USB device to another point (the other resistor in your divider? - where is hard to say without seeing your setup) or (3) build the circuit linked above- best option. (4) use the circuit and code with an arduino with the debug options turned on - look at code for "QUIET" or "DISPLAY_ALL_PACKETS" comments - these routines will display all the data nicely formatted and decoded on the PC screen in the Arduino Serial Monitor. Let us know how you get on...

    “Roll it back”



  • Registered Users Posts: 5 hassemulle


    ozmo wrote: »
    From the screenshot looks like you almost have it.

    YES!
    I missed the fact that the signal was inverted and thought a normal USB-RS232 (12V) could do the trick. Your circuit works great.

    I seems that I need to repeat the message for it to stay on the screen.

    Going to play with it now!


  • Moderators Posts: 6,870 ✭✭✭Spocker


    Just giving this thread a bump for some help; I have made this board (thanks Ozmo) and have it connected to my HKC Securewatch panel, and it gets picked up as a second keyboard no problem. However, I'm encountering this problem, all the time:
    Bazsutto wrote: »
    Here is an example of a comms fault I got a while back. As i said previous, it only happened when I tried to remote login to the panel.
    Usually there is no issues with this.


    redir?resid=E1E4F1C4252E7BFD!393&authkey=!AMZbgyOnQifxNts&v=3&ithint=photo%2cpng

    https://onedrive.live.com/redir?resid=E1E4F1C4252E7BFD!393&authkey=!AMZbgyOnQifxNts&v=3&ithint=photo%2cpng

    All my remote connections trigger a Panel communications fault, and I'm not sure what to look for, to fix it (I can browse via my local network no problem). I've also had no luck getting an email sent (I'm using a Blacknight account) but can't for the life of me get any logging output in the Arduino IDE - what stupid thing am I doing wrong?


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    Spocker wrote: »
    1)I can browse via my local network no problem
    2)All my remote connections trigger a Panel communications fault
    3)I've also had no luck getting an email sent
    4)but can't for the life of me get any logging output in the Arduino IDE

    1- great - thanks for the feedback.
    2- Oh- not seen this - could it be a slow mobile device? or slow network connection affecting it? The aritech may be taking too long downloading the internet message that it misses the time frame to respond to the HKC.
    3 - many email servers have very recently moved to https - the arduino is does not have enough memory to do ssl - maybe set up your own local SMTP server - or keep searching for a non ssl smtp?
    4 - You need an "Leonardo" (possibly "Mega" should work also but not tried it) or other Arduino with two serial ports - the standard UNO has only one Serial Port - so one for comms to the Aritech and one for comms to the PC.

    regards.

    “Roll it back”



  • Moderators Posts: 6,870 ✭✭✭Spocker


    ozmo wrote: »
    1- great - thanks for the feedback.
    2- Oh- not seen this - could it be a slow mobile device? or slow network connection affecting it? The aritech may be taking too long downloading the internet message that it misses the time frame to respond to the HKC.
    3 - many email servers have very recently moved to https - the arduino is does not have enough memory to do ssl - maybe set up your own local SMTP server - or keep searching for a non ssl smtp?
    4 - You need an "Leonardo" (possibly "Mega" should work also but not tried it) or other Arduino with two serial ports - the standard UNO has only one Serial Port - so one for comms to the Aritech and one for comms to the PC.

    regards.

    Thanks for the reply
    2 - could indeed be slow - I had been using a ddns.net hostname for resolution of my broadbands IP, but I'm using a fixed IP address anyways, I seem to get much quicker responses when just using the IP, and the panel doesn't trigger. Would I be correct in assuming it's the HKC panel with the delay, rather than the code on the Arduino
    3 - I'm with Vodafone and they recently retired their relay, which is why I used Blacknight - I don't think they require SSL, so I might roll my own with postfix in the meantime, to try it out
    4 - Ah, I have been using an Uno, I must pickup a Leonardo to try it out

    [Edit] One thing that stumped me for longer than it should have - the Websocket code no longer works with the latest version of Chrome, either on the laptop or mobile device, when I switched to Firefox it works fine, as does Safari


  • Advertisement
  • Moderators Posts: 6,870 ✭✭✭Spocker


    Pictures are always better, right? The finished job:

    477397.jpg


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    Spocker wrote: »
    Pictures are always better, right? The finished job:

    Oh - very nice - well done :)

    “Roll it back”



  • Registered Users Posts: 65 ✭✭UrsusMaritimus


    Hi Ozmo,
    I'm in the process of building one of these units for a HKC alarm and came across your instructable as i now have a fibre connection and the dialer no longer works, very awesome project by the way.

    I have very little experience with arduino and i'm wondering should an e-mail trigger each time the red LED comes on on my main keypad even in engineer mode?

    I'm trying to get the e-mails to send but i'm not sure if i'm triggering correctly. I'm programming on a PC and i can't have serial debug running at the same time as the alarm unit is too far away from the PC. I'm using GMX and from what i can see port 587 is non SSL, i have updated the port number in the code but as I said i'm not sure of the RED led triggers in engineer mode.


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    ...I have very little experience with arduino and i'm wondering should an e-mail trigger each time the red LED comes on on my main keypad

    I'm trying to get the e-mails to send .. I'm using GMX and from what i can see port 587 is non SSL, i have updated the port number in the code...

    Hi - thanks for the feedback :) - yes the Arduino looks only at the alarm state as reported by the keypad red led state - and should send an email each time it sees a transition from off to on - and wont send another until the led goes off and on again.
    From link 587 does appear to be the non SSL port for that service - so that looks ok.. There needs to be a username and password entered into the config also.

    You could try installing SMTP4Dev on your laptop and setting the Arduino to use that IP? Its a good simple test SMTP server that doesnt really send emails - just displays them.

    “Roll it back”



  • Registered Users Posts: 65 ✭✭UrsusMaritimus


    Hi Ozmo,

    Thanks for getting back to me, i have seen the UNO try to send the mail monitoring port 587 on my loacal network using SMTP4Dev as suggested but no joy with GMX.

    It tries to send a mail on resetting the unit but no joy on seeing a red alarm light from the RKP. I have tried 2x Uno's, one a Leonardo the other not, with the same result on both units.

    Looking at bit more at GMX it looks like port 587 is STARTTLS.


  • Registered Users Posts: 64 ✭✭bgengine1


    Hi,
    Is it possible to use a Arduino nano ( with a ethernet shield ) instead of a Arduino R3 Uno ?

    Can I port the code straight across ? ( I understand the connections might be slightly different )

    I see there is also code available for the ESP32 ...
    It says the code is "Note: this is a work in progress" does anyone have this code verified working ?

    thanks


  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    bgengine1 wrote: »
    Hi,
    Is it possible to use a Arduino nano ( with a ethernet shield ) instead of a Arduino R3 Uno ?

    The nano with ATmega328 written on the main chip should be compatible - the other Nano type doesn't have enough memory space - ... Wouldn't be huge saving though as an Arduino can be got for as low as 5 to 10 euros and you would still need to wire it somehow to the ethernet shield - I see there's a few ethernet shields on Adverts at the moment for 6 & 10 euros if that's any use to you...

    “Roll it back”



  • Registered Users Posts: 64 ✭✭bgengine1


    thanks for the response,

    I only mentioned the Nano ... as a I have one already and it's shield,

    If I had to buy something for then I think I'd probably go for the ESP32 .. but am just wondering if this code has been proved out and if there is much work left to complete the code ?

    It says the code is "Note: this is a work in progress" does anyone have this code verified working ?

    thanks


  • Registered Users Posts: 64 ✭✭bgengine1


    Hi,

    I'm trying to use the ESP32 code for my project .

    I have a Wemos D1 Mini that I plan on using,

    when I setup the Arduino IDE and compile the code I get an error ( I have the board set to "LOLIN( WEMOS) D1 R2 & mini") :

    1. Is the Wemos d1 mini ok to use for this project ?

    2. Any ideas on the error , I suspect I am missing a library(s) ?
    - I plan on Commenting out the parts that display to the 'D-duino-32' .. is there other part I will have to change ?

    all suggestions most welcome ..



    [COLOR="Blue"]In file included from C:\Users\BG\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/pgmspace.h:11:0,
                     from C:\Users\BG\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Arduino.h:258,
                     from sketch\CastleAritechArduinoESP32.ino.cpp:1:
    
    C:\Users\BG\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.5.0/tools/sdk/include/ets_sys.h:29:23: fatal error: eagle_soc.h: No such file or directory
    
     #include "eagle_soc.h"
                           ^
    compilation terminated.
    exit status 1
    Error compiling for board LOLIN(WEMOS) D1 R2 & mini.[/COLOR]
    


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 3,876 ✭✭✭ozmo


    bgengine1 wrote: »
    Is the Wemos d1 mini ok to use for this project ?

    That's not a file used by the system - not seen it before.

    But anyways the ESP branch is not competed - I got it as far as making the hardware (its 3.3volt vs arduino 5volt) and communicating with the panel (that works) - but I could not find an ESP32 Wifi drivers/library that supported web sockets - thats required for instant updates to the mobile phone web page - or SSL to support the new Email servers - main reason for using ESP32.
    I might revisit it again - but right now - the Arduino UNO/Mega/Leonardo and clones are only one tested working. Thanks.

    “Roll it back”



  • Closed Accounts Posts: 10 Hans1960


    Hello Ozmo, thanks a lot for your efforts to build this great tool for the Aritech panel. I have build the additional circuit with an Arduino Uno but i am not able to get the Arduino circuit recognized by the CD91 panel as an additional keypad. The LED on the Arduino is flashing and it sends mails to my account. Some error messages appear during compiling as well.


  • Moderators Posts: 6,870 ✭✭✭Spocker


    Post the compilation error messages, it will help us find the issue for you


  • Closed Accounts Posts: 10 Hans1960


    Of course but how to do that...i cannot save it


  • Moderators Posts: 6,870 ✭✭✭Spocker


    Can you cut and paste it from the Arduino IDE (the section at the bottom?)


  • Closed Accounts Posts: 10 Hans1960


    Hi Spocker, it took a while to find out but i am a new user and i cannot paste images etc., according to Boards.Ie messages.
    Not sure how to become a regular user...
    Anyway i uploaded the software again and this time it was successful without errors.
    However, the Arduino RKP is still not visible in the CD91.
    The Aritech RKP has address 0000, the Arduino RKP 0001.


  • Advertisement
  • Closed Accounts Posts: 10 Hans1960


    Sorry, also text copied from the Arduino IDE is not accepted by Boards.IE, not even plain text....


  • Registered Users, Registered Users 2 Posts: 8,749 ✭✭✭degsie


    Hans1960 wrote: »
    Sorry, also text copied from the Arduino IDE is not accepted by Boards.IE, not even plain text....

    Copy to notepad first and then copied here?


  • Closed Accounts Posts: 10 Hans1960


    Hello, I uploaded the software again to the Arduino and this time it was successful without errors.
    However, the Arduino RKP is still not visible in the CD91.
    The Aritech RKP has address 0, the Arduino RKP 1, also tried 2.
    I use exactly the same components as described in Ozmo's article except the NPN transistors are a different type (BC547).
    It should not make a difference, they are general purpose like the 2N2222.
    Also tried the direct connection to the CD91 chip but also this chip method did not work, i prefer to use the RKP method.
    The on-board LED of the Arduino Uno is flashing, so it receives data from the Aritech RKP bus.
    Is there any other suggestion to check hardware and/or software ?
    The CD91 panel has a Dutch software version but i think that does not matter...


  • Closed Accounts Posts: 10 Hans1960


    Hello, today i have connected the Arduino RKP to another CD91 control panel but also this one does not recognizes Ozmo's circuit at all. It does sends an email to my mailbox.


  • Closed Accounts Posts: 10 Hans1960


    Hi, the following error message appear when uploading to my Arduino Uno.





    sketch\SMTP.cpp: In static member function 'static void SMTP::SendEmailProcess()':

    sketch\SMTP.cpp:116:91: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

    WebSocket::base64_encode(WebSocket::htmlline, SMTP_USER, strlen(SMTP_USER)); //reuse htmlline buffer

    ^

    sketch\SMTP.cpp:124:91: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

    WebSocket::base64_encode(WebSocket::htmlline, SMTP_PASS, strlen(SMTP_PASS)); //reuse htmlline buffer

    ^

    In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Dns.cpp:8:0:

    C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Dns.cpp: In member function 'uint16_t DNSClient::BuildRequest(const char*)':

    C:\Program Files (x86)\Arduino\libraries\Ethernet\src&#0;ty/w5100.h:457:25: warning: result of '(256 << 8)' requires 18 bits to represent, but 'int' only has 16 bits [-Wshift-overflow=]

    #define htons(x) ( (((x)<<8)&0xFF00) | (((x)>>8)&0xFF) )

    ~~~^~~

    C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Dns.cpp:164:18: note: in expansion of macro 'htons'

    twoByteBuffer = htons(QUERY_FLAG | OPCODE_STANDARD_QUERY | RECURSION_DESIRED_FLAG);

    ^~~~~

    Sketch uses 18590 bytes (57%) of program storage space. Maximum is 32256 bytes.
    Global variables use 1127 bytes (55%) of dynamic memory, leaving 921 bytes for local variables. Maximum is 2048 bytes.


  • Advertisement
Advertisement