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

Aritech Alarm Internet Dialler

16781012

Comments

  • Registered Users Posts: 7 johnrm


    @Ozmo, nice project, thanks.
    I have all the components, fingers crossed.


  • Registered Users Posts: 5 KhaosTheory


    johnrm wrote: »
    @Ozmo, nice project, thanks.
    I have all the components, fingers crossed.

    How did you get on? I have a cs350 and waiting on the arduino. I'm just curious if the system still works considering that this project was first started 7 years ago.

    I've found this whole thread to be a great read from start to finish and I'm looking forward to joining the club as such.


  • Registered Users Posts: 5 redhat2


    @Ozmo,

    exuse my poor English i'm Dutch.

    The project is stil working great until i tried to use a cd95 pannel.
    The keypad is not found some were in te forum this it posible a timing problem due to the fact there is space for more remote's.
    I have tried version 3 and the latest version no luck.
    What did work is proramming it on a already attached remote 0 and if i leave the trasmission disconnected, it displays remote 0.
    So it receives ok, it's in the transmission.

    Is there some one that got it to work on the lager pannels???.
    And can you pont me in a direction to solve the timing problem.

    I hope there is stil some activity here it's a gread addition to my alarm.

    greetings jasper


  • Registered Users Posts: 3,826 ✭✭✭ozmo


    redhat2 wrote: »
    @Ozmo,
    The project is still working great, until I tried to use a cd95 panel.
    The keypad is not found - its possible a timing problem due to the fact there are more remote's.

    What did work is attaching as remote 0 and if I leave the transmission disconnected, it displays. So it receives ok, it's in the transmission.

    Thanks for the update - well done on the UI changes too - I have most the panels - but unfortunately CD95 is one Aritech alarm panel I don't have one to test -
    I think you could be correct in it being a timing issue - Possibly that panel supports so many remote devices by reducing again the amount of time a remote gets to respond.
    If I can think of anything to try Ill post here - possibly if I ever get back to completing my Esp32 version of this project that might give some extra speed... but without a panel to test cannot be sure...

    “Roll it back”



  • Registered Users Posts: 5 redhat2


    Great to hear you are still active.

    Is there a cance if you stip the log option and the smtp option this can speedup the board.

    If you have some code to test i will be happy to, may be a stripped version yust to see if the a keypad is recognised.
    unfortunately my coding in arduino is not that good, i have some experience with microchip in proton.

    hope to hear from you again

    greetings jasper


  • Advertisement
  • Registered Users Posts: 3,826 ✭✭✭ozmo


    Hi - I uploaded two versions to github if anyone would like to test...

    1. Latest version for Arduino UNO
    - it works well with latest Chrome Browser, Edge etc,
    - Has support for using keyboard when on a pc.
    - Some small fixes
    - By default Email is Off - since Arduino cannot communicate with modern SMTP servers anymore since they all went SSL.

    https://github.com/OzmoOzmo/CastleAritechArduinoRKP


    2. A rewritten one using using an ESP32 Board (a more powerful, but cheaper, version of the Arduino)
    This version supports
    • Sending Emails via Gmail servers!
    • WiFi (not ethernet - no ethernet shield needed)
    • Better diagnostics
    • LCD Display

    https://github.com/OzmoOzmo/CastleAritechArduinoESP32

    For the ESP32 version - I tested on a "D1 R32" which looks exactly like a Arduino UNO - and a Wemos Lolin32 which is an ESP32 with built in LCD display.
    I am still testing on all the panels I have - but all seems ok so far. Let me know if you anyone tries it and has any difficulty with it.


    540639.png

    “Roll it back”



  • Registered Users Posts: 3,826 ✭✭✭ozmo


    Hi - Latest update to the ESP32 version is it now connects to Amazons Alexa...

    As a demo I have it configured that if you ask "Alexa, Home Security ON" it will Arm the Aritech panel.... :)


    Open to suggestions on how best to integrate Alexa - What would it be useful to be able to ask it to do?



    All the code, and circuit is in Git hub.

    “Roll it back”



  • Registered Users Posts: 5 redhat2


    good to see you are still active.

    I'm running you new code Arduino UN some time now on a cd92 system that can handle max 8 remotes.
    Without any problems.
    On the lager panels cd95 still not working probably still timing issues.
    I order t a esp32 to test the other code on a cd95 panel maybe it solves the timing issue.

    An i have order t a stm32 to see if i can drop your Arduino UN code in there to solve the timing issue.

    keep it going still a grade addition to my panel.

    greetings jasper


  • Registered Users Posts: 3,826 ✭✭✭ozmo


    redhat2 wrote: »
    good to see you are still active.

    I'm running you new code Arduino UN some time now on a cd92 system that can handle max 8 remotes.

    Cool the latest UNO version of the software will work with latest Chrome and mobiles - so worth updating for that.

    If you are trying the ESP32 - Here is a photo of my ESP 32 version soldered up - you can see it requires just 4 wires - no ethernet cable or power supply module.... I put on a display :) but that's optional.


    546319.jpg

    “Roll it back”



  • Registered Users Posts: 21 Vasarbob


    Hi there Ozmo .
    Brilliant work.
    I am also going to use this great interface for the HKC alarm. Would it be hard to transport this to the ESP 32 ? if so i will use the Arduino.
    I have a few relays at the minute that tells me when the alarm is set / unset and also if it goes off. also can set off the alarm siren with another relay. it all is fed into home assistant . i also use zwave binary sensors to tell me when the zones open and close so i and use the PIR for lights etc. Its a good system but the zwave are unreliable as they are gen 1 versions. Would love to use this instead as it would open huge possibilities.


  • Advertisement
  • Registered Users Posts: 4 bobmarray16


    I'd like to get into doing something with arduino, but I've no programming background at all and Im not too sure where Id start, this is an interesting practical use, I'll follow along for any updates, might pick something up.


  • Registered Users Posts: 3,826 ✭✭✭ozmo


    Vasarbob wrote: »
    Hi there Ozmo .
    Brilliant work.
    I am also going to use this great interface for the HKC alarm. Would it be hard to transport this to the ESP 32 ?.

    Thanks- the Esp32 is only for the Aritech at the moment. But the UNO version is should still be ok...

    “Roll it back”



  • Registered Users Posts: 43 gg3390


    Hello,

    Thanks for a most interesting project, which I was aware of before, but was waiting for news on the ESP32 version, which makes ethernet much easier with wifi.

    I have a few issues, and would be delighted if anybody has any ideas. Using an ESP32 Wroom32 module, and after some false starts with the esp32_https_server (currently I just copied all the lib zip files into the arduino libraries folder, I can compile and install the code. However, it seems to hang, and after enabling logging, it always gets to "All done", or sometimes the logs show "All Don" (missing e, and nothing else.)
    Its most probably the fault is mine, as currently I don't have the panel connected - I wanted to firstly flash the ESP32 and see it getting connected to wifi, then look at the interface to the panel.

    Any idea why the code appears to hang - is it due to not being able to find the panel (as its not connected).
    Any help greatly appreciated.

    Thanks again for your work on this Ozmo.

    Regards
    Ger


  • Registered Users Posts: 3,826 ✭✭✭ozmo


    gg3390 wrote: »
    Hello,

    ... currently I just copied all the lib zip files into the arduino libraries folder, I can compile and install the code. However, it seems to hang, and after enabling logging, it always gets to "All done"

    .. I don't have the panel connected

    Yeah - in order for it to never miss a byte - once initialised the code will block until it receives messages from the panel. Sounds like you have that part working ok so far.

    How do you plan make the interface - I found the prototype shields make a nice neat solution.

    SolderedBoard.png?raw=true

    “Roll it back”



  • Registered Users Posts: 43 gg3390


    Thanks for the reply.

    I have quite a number of ESP32's about the house already, so have made up some adapter boards from vero and headers, so will be easy to add the serial interface and power.
    Also I've dabbled previously with making my own PCB's, but after designing a Z80 microcomputer board I found using KiCAD or EasyEDA together with cheapo boards from somewhere like jlpcb makes for an easy and very professional outcome.
    Assuming of course one gets the schematic right first time, and you're prepared to wait a few weeks for the boards from China...

    Thank you again - I'll retry once I build up the interface.

    Regards
    Ger


  • Registered Users Posts: 43 gg3390


    Hello,
    Just a quick update - built the alarm interface, and this aspect worked very well for me.
    Unfortunately though it looks like I'm hit with a similar problem to previous posters with integration into my CD95 panel - while I can see panel activity, especially if I set the esp32 as the same ID as an existing remote, I cannot add the esp as an RKP - the panel refuses to recognise it on any ID. Although I'm not enough of an expert by any means to glean timings from the current code, it appears from others comments that timing differences on this panel are probably the cause of this.
    So for now I'm going to just implement a simple arm/disarm and printer output monitor. This will more than suffice for looking at logs and remote arm/.disarming.
    Thanks to Ozmo and other for their input, and if anybody else has ideas on how the timings might be changed in the code I'd love to try it.
    Ozmo, you mentioned previously that you might publish the reverse-engineered serial protocol for these panels - did you ever get around to do this? I would not mind understanding the hex values I'm seeing from my panel, but moreso the serial values being transmitted out by the esp32. In my case I'm not sure if they are actually correct (from my limited knowledge and investigations). No worries if not.

    Thanks all.
    Ger


  • Registered Users Posts: 3,826 ✭✭✭ozmo


    gg3390 wrote: »
    ..I'm hit with a similar problem to previous posters with integration into my CD95 panel - while I can see panel activity, especially if I set the esp32 as the same ID as an existing remote, I cannot add the esp as an RKP - the panel refuses to recognise it on any ID.

    ...you mentioned previously that you might publish the reverse-engineered serial protocol for these panels - did you ever get around to do this?

    CD95 is not a panel I use in my house - as the CD95 panel I own has no proper heat sink I can only run it for a short time before it overheats :O
    But Ill set it up again and see what the issue is and get back to you.

    The RKP protocol is fairly well documented in the RKP.cpp file -
    pm me if there are any questions and I can discuss.
    Cheers!

    “Roll it back”



  • Registered Users Posts: 43 gg3390


    No problem - and thanks again for your assistance and efforts on this.

    Regards
    Ger


  • Registered Users Posts: 8 MrWickerman


    Hi,

    I have just been reading through this thread - Ozmo, great job – I love it :)

    I followed your description but I ended up burning the fuse on the panel a few times so maybe this a good time to ask for an advice. I have an Aritech CS351 panel, CD3008 keypad and are using a Mega+WiFi R3 ATmega2560+ESP8266. I have 1 months of experience with Arduino and Aritech so be kind 😉

    What have I done:

    • Build the “two transistor interface board - connects to 12v ABCD keypad socket” but something is not working out for me.
    • Reworked the code from: CastleAritechArduinoRKP-master and CastleAritechArduinoESP32-master to fit my needs.
    • I am able to send Json formatted data from ATmega2560 -> ESP8266 and upload it to an API enabled application in cloud.
    • Managed to get below printed so I can’t be too far away from a solution:

    DUMP_RAW_LINE_DATA:

    • B2 CD 2E 38 D2 00 00 03 E0 87 88 20 17 29 00 00 13 A0 09 13 CF 00 00 23:...8.........).........#
    • A1 20 20 20 20 20 43 53 33 35 31 20 20 56 33 2E 38 C2 00 00 33 A1 20 20:......CS351..V3.8...3...
    • 20 20 20 43 53 33 35 31 20 20 56 33 2E 38 D2 00 -- -- -- -- -- -- -- --:...CS351..V3.8..########
    • 00 07 E0 87 88 20 17 2D 00 00 13 A0 09 13 CF 00 00 23 A1 20 20 20 20 20:.......-.........#......

    DISPLAY_ALL_PACKETS:

    • #0)07 E0 09 13 03 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --:......##################
    • #1)13 A0 09 13 CF 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --:......##################
    • #2)23 A1 20 20 20 20 20 43 53 33 35 31 20 20 56 33 2E 38 C2 00 -- -- -- --:#......CS351..V3.8..####
    • #3)33 A1 20 20 20 20 20 43 53 33 35 31 20 20 56 33 2E 38 D2 00 -- -- -- --:3......CS351..V3.8..####

     

    Question 1)

    I have looked at your diagram ‘CircuitAndPerformanceAnalysis.jpg’ and from what I can tell, the signals are negated.

    E.g., when PnlTx goes high => ArdRx goes low – is that intentional and how/where is that handled?

    E.g. ~(00001111) = (11110000)

    If this is it: PORTB &= ~(_BV(0));  //cbi(PORTB, 0);

    How is it handled sending data back?


    Question 2)

    I have a CS351 panel (not CS350). Do you know if the communication bus is the same?

    Using a Voltmeter, I get readings like:

    PnlTx: 6.90 - 7.22V

    PnlRx: 0.09 - 1.23V (seems low). I have a feeling that this is the reason

    I’m waiting for my oscilloscope to arrive to get exact readings.

    Is there other things I can do to validate?


    Question 3)

    I have a ReadDatabus() function call in main loop to read incoming data (similar to your RKPClass::Poll(); in ESP project).

    bool RemoteKeypad::ReadDatabus()

    {

     …

      while (Serial1.available()) //yes - two...make sure we loop until all bytes gone

            while (Serial1.available())

            {

                byte rx = Serial1.read();

                //uart_read_bytes(uart_num, &rx, 1, 0);

     

                if (bReceivingPacketNow == false)

                {

    Main reason for using this is that I struggle to understand the Interrupt version in CastleAritechArduinoRKP.

    Do you know if above ESP32 approach can be used or would you recommend interrupt version from RPK project? Pros/cons?


    Question 4)

    What is triggering below function to be called in RPK projekt?

     

    #if defined(UART1_RX_vect)

    ISR(UART1_RX_vect)

    #elif defined(USART1_RX_vect)

    ISR(USART1_RX_vect)

    #elif defined(USART_RX_vect)

    ISR(USART_RX_vect) //UNO has no Serial1

    #else

    #error "No Serial Port?"

    #endif

    {

        static int msgbufLen = 0;

        static byte msgbuf[ixMaxPanel];

        static bool bReceivingPacketNow = false;

        static byte lastByte=-1;

     

        //Note - nothing here is to be blocking

        //- so sending emails must not block receiving serial logs

        byte rx = UDR;

        if (bReceivingPacketNow == false)

        {

            if(lastByte == 0)

            {//last char was a zero - this was the end of the last message

                if (rx==0)

                    return; //CD34 sends 0 at s



  • Registered Users Posts: 8 MrWickerman


    Small update from my end.

    I have managed to get the CastleAritechArduinoRKP-master work on pnlTx channel.

    I can read messages, example (text in danish):

    0)07 A0 90 53 79 73 74 65 6D 20 46 72 61 6B 6F 62 6C 65 74 76 00 -- -- --:...System.Frakobletv.###

    0)06 A0 90 46 6F 72 6C 61 64 20 6F 6D 72 E5 64 65 20 6E 75 AD 00 -- -- --:...Forlad.omr.de.nu..###

    The Arduino Interrupt thing is slowly starting to make sense. I just can't stop wondering if it is needed/better then 'while (Serial1.available() > 0))'?



  • Advertisement
  • Registered Users Posts: 3,826 ✭✭✭ozmo


    Hi - Ill try answer all the questions..

    1. Board - I've found the ESP32 to be the best - its crazy fast and has lots of memory and wifi - the mega and a ethernet shield should be fine too. But the esp32 can send emails via gmail - the mega doesnt support ssl so it cannot. also the ESP32 is very cheap - way less than 10 euros. And you can get a really cheap ice debugger to step through the code - all not so easy on the arduinos.
    2. Build the circuit - you can either build the circuit or connect directly to the panel (*using very short wires*). Maybe test using direct connect to ensure its working - then build the circuit?
    3. Sending to cloud - without a multithreaded environment this might take too much time to complete and the panel will give errors if it doesn't get a response to a message packet almost immediately.
    4. "Managed to get below printed." Thats great - that means you are successfully receiving good data from the panel. That looks good.
    5. "the signals are negated" - that's correct, the ABCD keyboard bus hardware in the panel expects the signal to be inverted (0v = 1, 12v = 0) - the transistor in the circuit inverts the signal from the arduino - two transistors one for rx and one for tx - if you connect directly to the panel microprocessor chip using the diode, this bypassess that bus electronics and then the signals are Not required to be negated.
    6. Using voltmeter - could be ok - the voltage doesn't need to be exactly 0 or the max voltage for it to be registered as a 0 or 1. Oscilloscope is great to have.
    7. "while (Serial1.available())" - when a byte arrives - we need to spend all the time needed to get the whole packet and respond to it immediately. It would be bad to get half a packet and then exit function and wait for next time in there to get the rest of the packet - we might take too long to respond to the message - three or four missed packets causes a message "keypad disconnected" to appear on the aritech panel.
    8. "the Interrupt version" - every time a byte arrives the arduino calls our function and we store the bytes until we detect its a whole complete message. This means we dont have the overhead of "polling" or constantly asking "are we there yet" of the uart - it will tell us when something has arrived. If you look at earlier versions in the git history - you can see I did use polling originally in the arduino just like you are trying now, but the interupt way made it respond quicker and didnt block the http server and email sending code - The esp32 is using a multithread approach and its cpu is much faster, it doesnt need to use interrupt way. Of the 3 - polling,interrrupt and multithreads - I prefer the esp32 multithreaded way.
    9. "What is triggering below function" - ISR(USART_RX_vect) is called by the arduino - you just need to define it in the code and it will be called - its triggered by the hardware receiving 1 or more bytes
    10. "I just can't stop wondering if it is needed/better then 'while (Serial1.available() > 0))'?" - both are fine, I had both working, you can check the git history for the other version - The interrupt version was slightly quicker to respond and so helped make it work with more panels like the CD92 which has an especially short time available to respond.

    I'd recommend getting an esp32 to play with also - it has more features like Gmail and experimental Amazon Alexa support and there is much more space for experimenting with adding more html etc.

    all the best...

    “Roll it back”



  • Registered Users Posts: 8 MrWickerman


    Hi ozmo,

    Thank you so much for the answer. I have a few things to work with :)

    My solution is build in a slightly different way compared to you.

    I'm using a 'MEGA R3+WiFi ATmega328P+ESP8266 32Mb Memory' board. Build in ESP8266 on Mega board.

    ATmega2560:

    • Send/Receive messages from comm. bus (Serial1)
    • Send/Receive messages from ESP8266 (Serial3)
    • Analog read from sensors

    ESP8266:

    • Send/Receive messages from ATmega2560 (Serial)
    • Connected to WiFi
    • OTA
    • Communication with cloud application (SSL enabled API, JSON)
    • Network scan looking for 'friendly' devices (mobile phones) connected to local network
    • Logging
    • etc.

    Cloud App:

    • Data storage, storing sensor data etc.
    • Connected to mobile app

    However, I will get a ESP32 for comparison and see if it makes life easier or at least more speedy :)

    thanks again



  • Registered Users Posts: 8 MrWickerman


    Hi Ozmo,

    Thanks again for pointing me in the right direction. With your great work I am getting close to a working solution :)

    I get all messages from my CS351 panel and can show them on my web-keypad. I am storing all messages in a database which allows me to show latest movement etc.

    However, I am struggling to make my keypad work alongside the original keypad (CD3008).

    If I disconnect the CD3008 and connect my keypad with ID 1 (RKP_ID: 0) and everything works.

    When I go to the 'Install Panel menu' and connect my keypad with ID 2, 3 or 4 the warning LED turn on and the CD3008 freezes (can't press any keys).

    Is there a special order I should follow when installing my keypad?

    This is what I do:

    1. I connect my Arduino keypad to the comm. bus (excluding Tx port). I do this while power is on.
    2. I navigate to the tech menu 'install panel' using CD3008. The display text is: Panels p***.
    3. I connect the Tx from my Arduino.
    4. The CD3008 panel text changes to: Panels pp**. Shortly after the CD3008 are turning on/off with a 'click' sound and the display text changes to: Panels *P**, the warning LED turns orange and the panel freezes. At this point in time I am unable to use any of the keypads. I can see that ACK messages are send from the Arduino to the panel (12 00 00 12).


    Post edited by MrWickerman on


  • Registered Users Posts: 8 MrWickerman


    A completely differing topic/question.

    I bought a cheap oscilloscope DS211 as you suggested in one of your earlier posts - which has been crazy helpful.

    From that I can see that there seems to be a small delay between each byte send by the original keypad. The delay is not there when sending messages from the Arduino board. Did you solve that somehow?

    Yn: Messages send from Arduino

    Ex: ack (02 00 00 02) send by CD3008.




  • Registered Users Posts: 8 MrWickerman


    Last post updated

    Post edited by MrWickerman on


  • Registered Users Posts: 8 MrWickerman


    Last post updated



  • Registered Users Posts: 3,826 ✭✭✭ozmo


    Oh - just noticed this - this new site update.. - Im not getting notifications always of this and other threads - dont know why...

    Do you still have the problem?

    To make those traces match more closely - maybe can you try changing the baud rate setting on the arduino a tiny bit faster and do another test with the oscilloscope.

    #define nSerialBaudKP_RX 1953 <--- increase this number by 1 to 10 and see if that helps...

    “Roll it back”



  • Registered Users Posts: 21 Vasarbob


    Hi Ozmo,

    I have made the transistor pcb with a uno and connected it to the HKC panel . All good there . Installed it on the panel as a keypad and it shows up as finding 4 ( i have 3 keypads connected to the panel so that is the uno showing up as the forth) so that is ok too. Problem is i can log into the keypad but nothing is showing up on the small screen. I can press the keys but nothing shows up. I checked the html with the developer tool on chrome and it shows up this as a problem . Is this java that is not loading ? Any ideas would be great



  • Registered Users Posts: 21 Vasarbob



    s what the error is. sorry but it wont let me post links on the forum yet.



  • Advertisement
  • Registered Users Posts: 21 Vasarbob


    Also Mr Wickerman,

    How did you get on with the keypad freezing when you connected it. I have the same problem but I am using the HKC panel. keypads freeze , yellow light ect.



Advertisement