AD2Pi and a RasPi model A+ and WiFi powered by alarm system

General Discussion

AD2Pi and a RasPi model A+ and WiFi powered by alarm system

Postby Gordon » Sun Nov 30, 2014 2:52 pm

For anyone who might be interested, below I describe my use of the AD2Pi and a Raspberry Pi model A+ with an old Vista-10se alarm system using Wi/Fi while powering the entire system from the alarm panel. The new Raspberry Pi (RasPi) model A+ is a low power version of the RasPi with one USB port and no Ethernet port. It sells for US $ 20 ($15 less than the Model B). I spent a number of hours testing this system over two days and it works wonderfully so far. If I run into any problems I will report them here. This is a great upgrade for my security system!

:arrow: I take absolutely no responsibility for any use of this information. There might be consequences both known and unknown by using this equipment in this configuration and you assume all the responsibility. You may not hold me accountable for anything that results from using the following information, including but not limited to the possibility of property damage or personal injury from the failure of the alarm system to perform as expected or any other reason.

PROS
1. Wiring the system is simplified. Only the four wire run from the alarm panel to the RasPi system is required. No other power supply is needed and the internet connection is wireless.
2. The RasPi has an uninterruptable power supply (UPS) that will handle short-term power service interruptions.

CONS
1. If you get a trigger on the fire zone, then when you reset the alarm, the power to the RasPi will be cut in this configuration. This could result in data corruption and failure of the RasPi to run properly, or at all, rendering the AD2Pi ineffective. I have not had a fire alarm in twenty years and I can repair the system if it becomes corrupted therefore I am willing to take that risk. However, if you experience false fire/smoke alarms and/or regularly test the fire/smoke sensor(s) then powering the RasPi from the panel's aux power supply might not be for you. If you do test the fire alarm (as you probably should), or if you have a fire alarm, then before resetting the alarm you should SSH into the RasPi and shut it down properly, then remove power to the RasPi until the testing and system reset is concluded.
2. In case of power failure, the alarm system will run for a shorter time (on the same sized battery) then it would if the RasPi was powered from a different source (such as a wall wart).
3. You need to make sure you do not exceed the amperage rating of the auxiliary power on the alarm panel and that the RasPI is located where it will have a good WiFi link.
---
Power consumption for the RasPi A+ alone is around 200 mA @ 5 VDC (appx. one watt). Using the RasPi A+ with AD2Pi and WiFi adapter (similar to this one) and a switching voltage regulator that is fed by a 12 VDC supply, I measured the current draw using a cheap meter. The readings showed a max current draw from the 12 VDC source of about 125 mA peak with the draw usually close to or under 100 mA (or up to 1.5 watts).

My alarm panel (Vista 10se board SA142GENC) has an aux power supply for keypads, etc, which is rated at 500 mA at 12 VDC. I only have one keypad ( a 6128) and one fire/smoke detector (2112/25T) which together draw only 65 mA max. (closer to 31 mA in typical standby usage). Therefore, there is sufficient reserve to power the RasPi /AD2Pi system from the alarm panel. Using this RasPi/AD2Pi system with other alarm systems that have added accessories (keypads, etc.) might draw more current than the panel can supply in which case the back-up battery will be drained. In this case, I assume that the RasPi will shut down and maybe restart repeatedly as the battery recharges and discharges and your battery backup time for the alarm system will be drastically shortened or eliminated.

My system has an 8-amp hour battery and I have made the following estimates of battery back-up time:
Current draw of component parts: Panel 100 mA; Keypad 30 mA; RasPi/AD2Pi system 100 mA
Total 12 VDC current draw, security system only: 130 mA ; with RasPi/AD2Pi system: 230 mA.
Maximum backup time with 8 amp hour battery:
    Without RasPi/AD2Pi: 61.5 hours;
    With RasPi/AD2Pi: 34 hours.
I tested the system with AC power loss for 60 minutes and in that hour I did a test and also an actual alarm trigger (without sirens connected) and everything worked fine.

With the RasPi model A you initially need to connect it to a display and keyboard to configure the WiFi. On the model A with a single USB port it's a little easier to use a USB hub to connect both a keyboard and WiFi adapter at the same time to configure the WiFi settings but once it is configured any further access can be via SSH. I even run a graphical desktop on the RasPi from a remote computer using XRDP.


!
One other thing to note; the four wire connection block on the AD2Pi has pins on the underside of the board which are very likely to short out by coming into contact with the HDMI connector on the RasPi. There are any number of ways to insulate this space. Sean @ Nu Tech tells me that they use rubber feet, which I assume, are self-adhesive and attached to the top of the HDMI port. But however you do it, I strongly suggest you insulate the boards and/or connector to prevent a short.


I am a novice around alarm panels and not an electronics expert so please feel free offer any advice or correction as appropriate, especially in my calculations or understanding on how the panel operates. Here is a photo of my semi-temporary installation:

PB300158.jpg
PB300158.jpg (199.41 KiB) Viewed 16261 times
Gordon
newt
newt
 
Posts: 17
Joined: Fri Nov 28, 2014 3:02 pm

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby Scott » Mon Dec 01, 2014 12:17 pm

Thanks for the write-up, Gordon! Very cool stuff.
Scott
Expert Nut
Expert Nut
 
Posts: 118
Joined: Thu Dec 12, 2013 11:17 am

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby Gordon » Wed Dec 31, 2014 4:19 pm

Update.. this config has been working just fine for me.
I had an unplanned power outage in my area that lasted 2 hours and 50 minutes, and the Alarm system with RasPi and AD2Pi kept humming along just fine with no interruptions in service while running on battery back-up.

I had notifications set up to send a text message upon all events, and I did get the power change status message when the mains went dead, but I did not get a message when the power was restored. It was also not listed in the log. Don't know if this is by design or not.

The only other things I noted were very high CPU usage after trying to set up SSL via the web app. This is a known issue so just don't use SSL for now. Lastly, I get error messages in the ap log when going from one client to another with different IP (or on a different network). The error message begins, "ERROR: Exception while handling socketio connection" but it seems to have absolutly no effect on the functionality and I have had no problem controling the ssytem using a phone on 3G, laptop on WiFi, etc.

So as Roger Ebert would say, "two thumbs up!"
Gordon
newt
newt
 
Posts: 17
Joined: Fri Nov 28, 2014 3:02 pm

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby wilsonb » Mon Jul 27, 2015 1:59 pm

Same conversation going on here to..

viewtopic.php?f=3&t=83&p=1024#p1024

I am also interested in this battery backup setup..

battery --> Voltage regulator (http://www.amazon.com/RioRand-LM2596-Co ... =pd_cp_e_1) --> Raspberry Pi

Should be good right?
wilsonb
Senior Nut
Senior Nut
 
Posts: 77
Joined: Sun Jul 26, 2015 4:14 pm

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby kevin » Mon Jul 27, 2015 2:10 pm

Yes, that will work fine.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby Gordon » Mon Jul 27, 2015 6:29 pm

Update: RasPi powered by alarm panel is running fine here.. current up-time is 104 days.

I have had a problem with my RasPis losing the WiFi connection at times (not just the one on the alarm panel), so I added a script to check the connection and if it is down, restart it. The script is below and runs via cron job every five (5) minutes. It has detected the link to be down and restarted it a few times.
----
Code: Select all
#!/bin/bash

##################################################################
# A Project of TNET Services, Inc
#
# Title:     WiFi_Check
# Author:    Kevin Reed (Dweeber)
#            dweeber.dweebs@gmail.com
# Project:   Raspberry Pi Stuff
#
# Copyright: Copyright (c) 2012 Kevin Reed <kreed@tnet.com>
#            https://github.com/dweeber/WiFi_Check
#
# Purpose:
#
# Script checks to see if WiFi has a network IP and if not
# restart WiFi
#
# Uses a lock file which prevents the script from running more
# than one at a time.  If lockfile is old, it removes it
#
# Instructions:
#
# o Install where you want to run it from like /usr/local/bin
# o chmod 0755 /usr/local/bin/WiFi_Check
# o Add to crontab
#
# Run Every 5 mins - Seems like ever min is over kill unless
# this is a very common problem.  If once a min change */5 to *
# once every 2 mins */5 to */2 ...
#
# */5 * * * * /usr/local/bin/WiFi_Check
#
##################################################################
# Settings
# Where and what you want to call the Lockfile
lockfile='/var/run/WiFi_Check.pid'
# Which Interface do you want to check/fix
wlan='wlan0'
pingip='192.168.1.1'
##################################################################
#echo
#echo "Starting WiFi check for $wlan"
#date
#echo

# Check to see if there is a lock file
if [ -e $lockfile ]; then
    # A lockfile exists... Lets check to see if it is still valid
    pid=`cat $lockfile`
    if kill -0 &>1 > /dev/null $pid; then
        # Still Valid... lets let it be...
        #echo "Process still running, Lockfile valid"
        exit 1
    else
        # Old Lockfile, Remove it
        #echo "Old lockfile, Removing Lockfile"
        rm $lockfile
    fi
fi
# If we get here, set a lock file using our current PID#
#echo "Setting Lockfile"
echo $$ > $lockfile

# We can perform check
#echo "Performing Network check for $wlan"
/bin/ping -c 2 -I $wlan $pingip > /dev/null 2> /dev/null
if [ $? -ge 1 ] ; then
    logger -t $0 "Network connection down! Attempting reconnection."
    /sbin/ifdown --force $wlan
    /bin/sleep 5
    /sbin/ifup --force $wlan
#else
#    echo "Network is Okay"
fi

#echo
#echo "Current Setting:"
#/sbin/ifconfig $wlan | grep "inet addr:"
#echo

# Check is complete, Remove Lock file and exit
#echo "process is complete, removing lockfile"
rm $lockfile
exit 0

##################################################################
# End of Script
##################################################################
Gordon
newt
newt
 
Posts: 17
Joined: Fri Nov 28, 2014 3:02 pm

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby kevin » Mon Jul 27, 2015 6:32 pm

Yeah, we have noticed this as well, and have a script we are bundling with our image/WebApp for people who choose to use WiFi on the pi - problematic, but what can you do
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby wilsonb » Mon Jul 27, 2015 7:32 pm

A "heart beat" script / function would be great. I think many will be running wireless & headless as myself.
wilsonb
Senior Nut
Senior Nut
 
Posts: 77
Joined: Sun Jul 26, 2015 4:14 pm

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby wilsonb » Fri Aug 07, 2015 6:55 am

I just noticed my Raspberry wasn't connected for who knows how long.
Will the 'HeartBeat" be added to the next release?
:D


Thank you..
wilsonb
Senior Nut
Senior Nut
 
Posts: 77
Joined: Sun Jul 26, 2015 4:14 pm

Re: AD2Pi and a RasPi model A+ and WiFi powered by alarm sys

Postby kevin » Fri Aug 07, 2015 9:16 am

If you're running wireless, you're running in a non-suggested configuration, and at this point in time there is nothing we can do to help you. Yes, we have a wifi restart script we are shipping with the next release, however it will still be use at your own discretion.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Next

Return to General

Who is online

Users browsing this forum: No registered users and 22 guests

cron