All Projects → Camble → Safe-Power-Monitor

Camble / Safe-Power-Monitor

Licence: other
Camble - SudoMod

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Safe-Power-Monitor

piugba
🎮 PIU emulator for the GBA 🎮
Stars: ✭ 43 (+126.32%)
Mutual labels:  gameboy
micropython-adafruit-mqtt-esp8266
Using MQTT to Publish/Subscribe to adafruit io. MicroPython/CircuitPython implementation on ESP8266/ESP32
Stars: ✭ 53 (+178.95%)
Mutual labels:  adafruit
gbcam-rev-engineer
Tools used to reverse engineer the GB Camera using Arduino UNO.
Stars: ✭ 64 (+236.84%)
Mutual labels:  gameboy
demo-emulator
Nintendo Game Boy emulator written in Go to be used in workshops about emulator programming
Stars: ✭ 41 (+115.79%)
Mutual labels:  gameboy
MiniGBS
Small .gbs chiptune player for Linux
Stars: ✭ 15 (-21.05%)
Mutual labels:  gameboy
bitboy
BitBoy : a Gameboy emulator for bitbox !
Stars: ✭ 14 (-26.32%)
Mutual labels:  gameboy
matrix-rain-gb
Matrix digital rain effect for the Game Boy
Stars: ✭ 24 (+26.32%)
Mutual labels:  gameboy
ghidra-gb
[WIP] A simple Ghidra loader for GameBoy ROMs
Stars: ✭ 11 (-42.11%)
Mutual labels:  gameboy
gba-remote-play
Stream Raspberry Pi games to a GBA via Link Cable
Stars: ✭ 356 (+1773.68%)
Mutual labels:  gameboy
cart-dumper
🎮 Gameboy ROM for cartridge dumping
Stars: ✭ 24 (+26.32%)
Mutual labels:  gameboy
node-gameboy
A Gameboy emulator runnable on browsers or server side
Stars: ✭ 58 (+205.26%)
Mutual labels:  gameboy
mealybug-tearoom-tests
🪲☕️ Game Boy emulator test ROMs
Stars: ✭ 40 (+110.53%)
Mutual labels:  gameboy
gameboy-glitch-shooter
Bullets don't stop writing to memory when they leave the screen. I'm sure everything will be fine.
Stars: ✭ 14 (-26.32%)
Mutual labels:  gameboy
apultra
Free open-source compressor for apLib with 5-7% better ratios
Stars: ✭ 84 (+342.11%)
Mutual labels:  gameboy
tinyfont
Text library for TinyGo displays
Stars: ✭ 37 (+94.74%)
Mutual labels:  adafruit
gnuboy
latest version of original laguna source, with a handful fixes for modern compilers and systems
Stars: ✭ 70 (+268.42%)
Mutual labels:  gameboy
CAMLBOY
A Game Boy emulator written in OCaml that runs in your browser 🐫 🎮
Stars: ✭ 409 (+2052.63%)
Mutual labels:  gameboy
emulators
development methodology software emulators
Stars: ✭ 24 (+26.32%)
Mutual labels:  gameboy
camera.zero
Combining Camera Zero with an Arducam 12MP camera, a Raspberry Pi Zero WH, a PiMoRoNi trackball breakout, and an Adafruit 16-LED NeoPixel ring will result in a neat little screenless camera that can be controlled with your thumb.
Stars: ✭ 26 (+36.84%)
Mutual labels:  adafruit
boombeastic
A Raspberry Pi based smart connected speaker with support for airplay, spotify, mpd and local playback
Stars: ✭ 206 (+984.21%)
Mutual labels:  adafruit

Safe-Power-Monitor 1.0.3

Background

Based on the original GBZ-Power-Monitor by Nullcorn, this power monitor script accompanies the Safe Shutdown PCB by Camble. Compatible with various power supplies, it monitors the power switch and reacts to low battery alerts in the form of video warning(s) and gracefully shutting down to prevent SD card corruption.

The script can log events to a log file to help with troubleshooting and is on by default.

Requirements

Dependencies

  • Retropie 3.7+ or latest Raspbian
  • Python 2.7 and Python Module RPi.GPIO (comes installed with Retropie 3.7)
  • omxplayer (comes installed with Retropie 3.7)
  • Must be run as a sudoer user (the default Pi user on Retropie 3.7 is a sudoer)

Installation

You will need to connect the PI Zero to Wifi and from another computer on the same WiFI network, SSH in (or use Putty on Windows):

Default password is 'raspberry'.

Copy the Safe Power Monitor script and video assets with the following command:

cd ~;git clone https://github.com/Camble/Safe-Power-Monitor.git

If you are using a generic power supply, or want to change the GPIO pin numbers, edit safe_power_monitor.py:

sudo nano ~/Safe-Power-Monitor/safe_power_monitor.py

Make your changes to the variables at the top of the script and press Ctrl+X to quit. Press 'Y' to save.

Editing /boot/config.txt automatically

Each time the script is run, it checks your /boot/config.txt for the keep-alive line. If it does not exist, it will add it and reboot.

For safety, the script will create a backup first. If for whatever reason, it cannot create a backup, an entry will be written in the log advising you make the amendment manually.

The script will make a temporary copy (/tmp/config.txt) and append the keep-alive line to it. This will then be copied back over /boot/config.txt.

If you would prefer to make the change manually, follow the steps below. If not, skip to "Running the script"

Below is an extract from the log file.

2016-12-24 13:15:02 [11] Safe Power Monitor script running.
2016-12-24 13:15:02 [80] Reading /boot/config.txt took 0.3671 seconds.
2016-12-24 13:15:02 [81] No dtoverlay line found for keep-alive in /boot/config.txt
2016-12-24 13:15:02 [82] Backup successfully created /boot/config.bak
2016-12-24 13:15:02 [83] Successfully amended /boot/config.txt. Rebooting...
2016-12-24 13:15:16 [11] Safe Power Monitor script running.
2016-12-24 13:15:16 [80] Reading /boot/config.txt took 0.2362 seconds.
2016-12-24 13:15:16 [30] Adafruit PowerBoost is selected.

Editing /boot/config.txt manually (optional)

At the command line, type:

sudo nano /boot/config.txt

Add the following line:

dtoverlay=gpio-poweroff:gpiopin=22,active_low="y"

Press Ctrl+X to exit, and press 'Y' to save.

Running the script

If you are happy you have configured the script correctly, add it to the startup process to complete the installation.

Note: if you chose to let the script alter /boot/config.txt for you, it will reboot at this point.

echo "@reboot /usr/bin/nice -n 19 /usr/bin/python ~/Safe-Power-Monitor/safe_power_monitor.py" >> mycron; crontab mycron;rm mycron

If you would prefer to test the script first, run it once without adding to startup.

Note: if you chose to let the script alter /boot/config.txt for you, it will still reboot at this point, but will not run on startup.

python ~/Safe-Power-Monitor/safe_power_monitor.py

Keeping Up-to-Date

You can make sure you have the latest updates by issuing this command

cd ~/Safe-Power-Monitor;git pull origin master

Links

Thread to order Safe Shutdown Switch (PowerBoost edition): http://sudomod.com/forum/viewtopic.php?f=3&t=1293

Thread to order Safe Shutdown Switch (BangGood edition): http://sudomod.com/forum/viewtopic.php?f=3&t=1706

Feel free to contact me on the Sudomod forums (www.sudomod.com/forum) or on the Sudomod Discord channel (https://discordapp.com/channels/188359728454303744/188359728454303744)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].