<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Attached is a power fail check script using the Pi GPIO. By default it assumes bit 24, pin 35 of the Pi. This bit is pulled low to indicate a power failure. This could be achieved by a SPDT relay or a clean 3V (no more!) source powered from the mains. Of course to use this the Pi must be powered from a source independent of the mains.<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">The script has a timer set to 30 seconds before it assumes a power fail. It sends a "power fail set" message at start and after a power failure is over. When a power failure is happening it says "power failure" on the air locally every 5 minutes.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Times and GPIO bits are changeable in the script.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">The script, after checking, is run in the background and uses an interrupt requiring scant resources.<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Copy this script to your server and make it executable - chmod 750 power_fail_check.sh<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br clear="all"></div><div><div class="m_-7250041910858251219gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><b><font size="4">73 Doug<br></font></b></div><b><font size="4">WA3DSP<br></font></b></div><b><font size="4"><a href="http://www.crompton.com/hamradio" target="_blank">http://www.crompton.com/hamradio</a><br></font></b></div></div></div>
</div>
</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div></div>