Idiots install guide (20p, AD2pi, raspi zero, & SmartThings)
Posted: Tue Jul 25, 2017 5:14 pm
First off, let me say this device is great once you get everything set up. I think I made every mistake in the book when setting it all up, so I thought I would write this little guide for myself (friends/family want similar set up to what I have done), and also contribute a little to the community. Little background: I am a complete newbie when it comes to raspi, Linux, and home automation, so I hope this guide will help anyone else that was as lost as I was.
Goal: A headless/wireless AD2pi that is powered by the alarm battery and integrates into SmartThings
Hardware:
AD2pi: http://www.alarmdecoder.com/catalog/product_info.php/products_id/33/osCsid/asqifu52fcn174haamsad9lpt2 + add on some alarm cable
Power:
If you can solder - https://www.amazon.com/RioRand-LM2596-Converter-1-23V-30V-1Pcs-LM2596/dp/B008BHAOQO + spare MicrUSB cable (I had a ton laying around)
If you can't solder: http://www.alarmdecoder.com/catalog/product_info.php/cPath/1/products_id/40
Raspberry Pi Zero W: https://www.adafruit.com/product/3400
microSD card:: Any will do, but get at least 8gb. I got this one:https://www.amazon.com/SanDisk-Memory-Frustration-Free-Packaging-SDSDQ-008G-AFFP/dp/B007KFXICK/ref=sr_1_1?s=pc&ie=UTF8&qid=1500951691&sr=1-1&keywords=micro+sd+card&refinements=p_n_feature_two_browse-bin%3A6518302011
GPIO Header Pins:
If you can solder - https://www.adafruit.com/product/2822
If you can't solder: https://www.adafruit.com/product/3413
Pi Case: https://www.adafruit.com/product/3252
Multimeter
Screwdriver
USB phone charger (5v)
Set-up
1. Attatch GPIO pins (either the solder or non-solder method)
2. Download Jessie Lite https://www.raspberrypi.org/downloads/raspbian/
3. Download Etcher https://etcher.io/
4. Flash Jessie Lite to you MicroSd using Etcher
5. Follow the link to a tutorial on adding 2 files to the boot directory of the SD card you just flashed in order for us to log into the pi without a monitor hooked up to it:https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html
6. Now let's ensure the pi boots and we can talk to it! Plug the raspi in using a microUSB and a phone charger and it should boot up (there are 2 microUSB ports one is labled power)!
7. Download and install Putty on your main PC http://www.putty.org/
8. Enter the hostname as "raspberrypi" (no quotes) and connect (sometimes it needs a .local after the raspberrypi - not sure why some systems need it, but mine did - so it would be raspberrypi.local)
9. Default user name is "pi" and password is "raspberry"
10. Enter command:
11. Change the hostname to "alarmdecoder" and change the password to something other than "raspberry"
12. Exit out of that and shutdown:
13. unplug the raspi once the green LED shuts off
14. if you purchased the soldering option power unit, you will need to take a micro USB cable, and cut off the USB-A end (the one that would go into your main computer) and attach the red to the +in and the black to the -in. Then cut the cord about halfway, and attach your newly cut end to the out + and - (red and black respectively). You should now have a wire with one cut end, the step down converter in the middle and a micro USB connection at the end. You will eventually connect the remaining red and black wires to the alarm panel battery.
15. If you are currently on paid monitoring, put your alarm into test mode (I did that by going to myadt.com)
16. Unplug the alarm panel from the outlet and battery
17. Attach the cut end of the power adapter you made in step 14 to the red and black terminals of the battery
18. Use your multimeter to measure the voltage coming out of the step down converter, and adjust it down to 5.1 volts by twisting the little flat-head screw
19. Attach your AD2pi to the alarm panel (the little document that came with the AD2pi clearly labels which wires go where).
20. attach the AD2pi to the GPIO pins - there is a marked square on the back of the AD2pi that will align with a square on the raspi's GPIO pins
21. Plug the battery and AC adapter back in to power up the alarm panel
22. Plug in the raspi and boot it up.
23. Go back to your main pc and fire up Putty again - this time the hostname will be alarmdecoder (once again might need a .local after it).
24. Once logged in we need to update the repos and install GIT:
25. Now that GIT is installed, let's clone the alarmdecoder docker repo:
26. go into the directory that was just created:
27. Run the pull script:
28. Go grab dinner, this takes a while (in my experience over an hour)
29. You should get a final message saying that everything installed ok, and to reboot. Before you do, you may need to modify the serial port configuration. Type the following command:
find the entries that are labeled serial0 and serial1. If serial0 is assigned to ttyAMA0, skip down to step 36 & reboot. Otherwise, if it looks like this, it needs to be swapped, so continue on:
30. Now that we see the serial ports are wrong, we need to swap them around by adding one line to a file. I use nano to edit my txt files so the command would be:
31. Once in there, add this one line to the bottom (you have to use your arrow keys to scroll down):
32. Save (Ctrl+o) and exit (Ctrl+x)
33. Reboot the pi:
34. Log back in (using putty and the hostname alarmdecoder) and type:
35. Now it is time to set up the webapp. The first boot takes a while so give it 10 minutes or so, but then go to http://alarmdecoder.local in your browser.
36. Click on the Start button and select AD2pi and tag it as a local device (it is local to your network)
37. On the next page, leave the path and baudrate as the defaults but check the share on the network box.
38. I left everything at the default values for the next 2 screens. Then it will test everything. Hopefully all is well here. If not, check your wires and soldering job to ensure everything looks good.
39. Once in the app, you will need to create all your zones by going into the settings -> zones. If you don't know the zone #, just open the door, activate the motion sensor, or undo the smoke/CO detector. The virtual panel should show you the zone # that has the fault.
40.The next steps is to get it integrated into SmartThings, and those are clearly written, so I am not going to rewrite them, but they can be found here: https://github.com/nutechsoftware/alarmdecoder-smartthings
There are still a few things I haven't figured out on the SmartThings side, so I figure out how notifications all work, and if a SmartThings device (something not wired to the alarm panel) can trigger the alarm, I will add that information - or if someone wants to shed some light, it would be appreciated.
I hope my little guide helped anyone that was as overwhelmed by the task of getting this all set up. Let me know if you have any questions, or notice any mistakes or typos. Thanks for reading!
Goal: A headless/wireless AD2pi that is powered by the alarm battery and integrates into SmartThings
Hardware:
AD2pi: http://www.alarmdecoder.com/catalog/product_info.php/products_id/33/osCsid/asqifu52fcn174haamsad9lpt2 + add on some alarm cable
Power:
If you can solder - https://www.amazon.com/RioRand-LM2596-Converter-1-23V-30V-1Pcs-LM2596/dp/B008BHAOQO + spare MicrUSB cable (I had a ton laying around)
If you can't solder: http://www.alarmdecoder.com/catalog/product_info.php/cPath/1/products_id/40
Raspberry Pi Zero W: https://www.adafruit.com/product/3400
microSD card:: Any will do, but get at least 8gb. I got this one:https://www.amazon.com/SanDisk-Memory-Frustration-Free-Packaging-SDSDQ-008G-AFFP/dp/B007KFXICK/ref=sr_1_1?s=pc&ie=UTF8&qid=1500951691&sr=1-1&keywords=micro+sd+card&refinements=p_n_feature_two_browse-bin%3A6518302011
GPIO Header Pins:
If you can solder - https://www.adafruit.com/product/2822
If you can't solder: https://www.adafruit.com/product/3413
Pi Case: https://www.adafruit.com/product/3252
Multimeter
Screwdriver
USB phone charger (5v)
Set-up
1. Attatch GPIO pins (either the solder or non-solder method)
2. Download Jessie Lite https://www.raspberrypi.org/downloads/raspbian/
3. Download Etcher https://etcher.io/
4. Flash Jessie Lite to you MicroSd using Etcher
5. Follow the link to a tutorial on adding 2 files to the boot directory of the SD card you just flashed in order for us to log into the pi without a monitor hooked up to it:https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html
6. Now let's ensure the pi boots and we can talk to it! Plug the raspi in using a microUSB and a phone charger and it should boot up (there are 2 microUSB ports one is labled power)!
7. Download and install Putty on your main PC http://www.putty.org/
8. Enter the hostname as "raspberrypi" (no quotes) and connect (sometimes it needs a .local after the raspberrypi - not sure why some systems need it, but mine did - so it would be raspberrypi.local)
9. Default user name is "pi" and password is "raspberry"
10. Enter command:
- Code: Select all
sudo raspi-config
11. Change the hostname to "alarmdecoder" and change the password to something other than "raspberry"
12. Exit out of that and shutdown:
- Code: Select all
sudo shutdown -h
13. unplug the raspi once the green LED shuts off
14. if you purchased the soldering option power unit, you will need to take a micro USB cable, and cut off the USB-A end (the one that would go into your main computer) and attach the red to the +in and the black to the -in. Then cut the cord about halfway, and attach your newly cut end to the out + and - (red and black respectively). You should now have a wire with one cut end, the step down converter in the middle and a micro USB connection at the end. You will eventually connect the remaining red and black wires to the alarm panel battery.
15. If you are currently on paid monitoring, put your alarm into test mode (I did that by going to myadt.com)
16. Unplug the alarm panel from the outlet and battery
17. Attach the cut end of the power adapter you made in step 14 to the red and black terminals of the battery
18. Use your multimeter to measure the voltage coming out of the step down converter, and adjust it down to 5.1 volts by twisting the little flat-head screw
19. Attach your AD2pi to the alarm panel (the little document that came with the AD2pi clearly labels which wires go where).
20. attach the AD2pi to the GPIO pins - there is a marked square on the back of the AD2pi that will align with a square on the raspi's GPIO pins
21. Plug the battery and AC adapter back in to power up the alarm panel
22. Plug in the raspi and boot it up.
23. Go back to your main pc and fire up Putty again - this time the hostname will be alarmdecoder (once again might need a .local after it).
24. Once logged in we need to update the repos and install GIT:
- Code: Select all
sudo apt-get update
- Code: Select all
sudo apt-get install git
25. Now that GIT is installed, let's clone the alarmdecoder docker repo:
- Code: Select all
sudo git clone https://github.com/nutechsoftware/alarmdecoder-docker.git
26. go into the directory that was just created:
- Code: Select all
cd alarmdecoder-docker
27. Run the pull script:
- Code: Select all
sudo chmod +x pull.sh
- Code: Select all
./pull.sh
28. Go grab dinner, this takes a while (in my experience over an hour)
29. You should get a final message saying that everything installed ok, and to reboot. Before you do, you may need to modify the serial port configuration. Type the following command:
- Code: Select all
ls -l /dev
find the entries that are labeled serial0 and serial1. If serial0 is assigned to ttyAMA0, skip down to step 36 & reboot. Otherwise, if it looks like this, it needs to be swapped, so continue on:
- Code: Select all
lrwxrwxrwx 1 root root 5 Jul 24 03:58 serial0 -> ttyS0
lrwxrwxrwx 1 root root 7 Jul 24 03:58 serial1 -> ttyAMA0
30. Now that we see the serial ports are wrong, we need to swap them around by adding one line to a file. I use nano to edit my txt files so the command would be:
- Code: Select all
sudo nano /boot/config.txt
31. Once in there, add this one line to the bottom (you have to use your arrow keys to scroll down):
- Code: Select all
dtoverlay=pi3-miniuart-bt
32. Save (Ctrl+o) and exit (Ctrl+x)
33. Reboot the pi:
- Code: Select all
sudo reboot
34. Log back in (using putty and the hostname alarmdecoder) and type:
- Code: Select all
ls -l /dev
- Code: Select all
lrwxrwxrwx 1 root root 7 Jul 24 04:23 serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Jul 24 04:23 serial1 -> ttyS0
35. Now it is time to set up the webapp. The first boot takes a while so give it 10 minutes or so, but then go to http://alarmdecoder.local in your browser.
36. Click on the Start button and select AD2pi and tag it as a local device (it is local to your network)
37. On the next page, leave the path and baudrate as the defaults but check the share on the network box.
38. I left everything at the default values for the next 2 screens. Then it will test everything. Hopefully all is well here. If not, check your wires and soldering job to ensure everything looks good.
39. Once in the app, you will need to create all your zones by going into the settings -> zones. If you don't know the zone #, just open the door, activate the motion sensor, or undo the smoke/CO detector. The virtual panel should show you the zone # that has the fault.
40.The next steps is to get it integrated into SmartThings, and those are clearly written, so I am not going to rewrite them, but they can be found here: https://github.com/nutechsoftware/alarmdecoder-smartthings
There are still a few things I haven't figured out on the SmartThings side, so I figure out how notifications all work, and if a SmartThings device (something not wired to the alarm panel) can trigger the alarm, I will add that information - or if someone wants to shed some light, it would be appreciated.
I hope my little guide helped anyone that was as overwhelmed by the task of getting this all set up. Let me know if you have any questions, or notice any mistakes or typos. Thanks for reading!