powerfail monitors the input 12V to the MFM reader/emulator board and shuts down the BeagleBone when power is lost.
--powercmd -p 'command and arguments'
The command to execute when power is lost.
--command -c 'command and arguments'
The command to execute when powerfail starts. This program is sent a SIGINT when power is lost. The powercmd is sent after this program exits.
--threshold -t #
When the input power drops below this voltage the power down actions will start. Default is 11.5 volts.
--wait -w #
The input power must be below the threshold for the specified number of seconds before the power down actions will start. Default is .1 seconds.
--scale -s #
The resistor divider scale value used to convert the A/D reading to voltage. Should be r16 / (r16 + r15). Default is 0.1253.
Print debugging and status information.
Print program version number.
Long options can be abbreviated to the shortest unique name. Long option values can't have spaces.
# is a floating point number.
Example if running from emu directory:
../powerfail/powerfail --powercmd 'halt -f' --command './mfm_emu --drive 1 --file disk_file'
If you have the extra chip installed to activate the power button when power returns the recommended powercmd is poweroff otherwise it is halt. For Debian it is recommended to use the -f flag to to poweroff or halt.