PJ – Power Monitoring and Shutdown.

Overview

Power monitoring and the shutdown capability consists of a power / shutdown monitoring executable, and a init.d script. On startup the utility will monitor voltages on the JAMMA connector side (from the PSU) and shutdown the system cleanly when a brownout condition is detected and lasts for some time. Execute the utility manually for configuration parameters.

When extracted both can be found in the utilities/pwrmod directory of the tar file.

Installing the power monitoring and shutdown component:

Only the init.d script must be installed:

sudo cp /home/pi/utilities/pwrmon/init.d/pwrmon /etc/init.d

Using update-rc.d, create init symlinks so that power monitoring can be started on start-up.

sudo update-rc.d pwrmon defaults
sudo update-rc.d pwrmon enable

Power monitoring can also be started and stopped manually in the usual init way:

/etc/init.d/pwrmon start

or

/etc/init.d/pwrmon stop

Troubleshooting the power monitoring utility:

Make sure it is started on boot-up. Run the following to confirm:

ps -ef | grep pwrmon

You should see something that resembles the following:

root   368   1  0 09:46 ?    00:00:00 /home/pi/utilities/pwrmon/pwrmon 0.5

If not found, check the logs /var/log/debug and logs in /var/log/pwrmon for more information.

Check to make sure the script is set to execute on startup:

chkconfig pwrmon