Mopower UPS client side control script
For updates please see: http://www.allspectrum.com/mopower/
=================

!!!!! PLEASE NOTE RASPBIAN WHEEZY IS NO LONGER SUPPORTED, INFORMATION IS PROVIDED BELOW FOR THOSE ATTEMPTING INSTALL
!!!!! UPGRADING TO RASPBIAN JESSIE IS HIGHLY RECOMMENDED

Install Instructions

Target system is 2015-05-05-raspbian-wheezy


copy mopower-ups-xxx.tar.gz file to home directory (/home/pi/) and untar, this makes a /home/pi/mopower/ directory
        $ tar -xf mopower-ups-xxx.tar.gz

remove "console=ttyAMA0,115200" from /boot/cmdline.txt, use vi or any other text editor
	$ sudo vi /boot/cmdline.txt

comment out "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100" from /etc/inittab
	$ sudo vi /etc/inittab

install CRCMOD (tested version crcmod-1.7.tar.gz) homepage: http://crcmod.sourceforge.net/	download: http://sourceforge.net/projects/crcmod/
cd to appropriate directory 
	$ cd crcmod/crcmod-1.7/	
and issue install command..
	$ sudo python setup.py install

edit mopower-ups.py and uncomment the following line, on or about line number 16
TTY="/dev/ttyAMA0"

=================

edit /etc/rc0.d/K09halt

	$ sudo vi /etc/rc0.d/K09halt

and add the following after "### END INIT INFO"

	{ sleep 0.2; printf '\rTIMED_SHUTDOWN=5\r'; } > /dev/ttyAMA0
	{ sleep 0.2; printf '\rTIMED_SHUTDOWN=5\r'; } > /dev/ttyAMA0

=================

edit /etc/rc.local
        $ sudo vi /etc/rc.local
and add
        /home/pi/mopower/mopower-ups-wrapper.sh &
before the "exit 0" line

=================

It is highly recommended that you install minicom to test/troubleshoot or configure the UPS...

	$ sudo apt-get -y install minicom

=================
