On-Screen Battery Monitor Options

General GBZ-related chat goes here. Share ideas, tips and tricks, or ask questions that don't fit into the hardware/software help forums.
User avatar
goosewerks
Posts: 93
Joined: Mon May 22, 2017 8:27 am
Has thanked: 18 times
Been thanked: 39 times

Re: On-Screen Battery Monitor Options

Post by goosewerks » Wed Sep 26, 2018 9:27 am

Peeked through code as mentioned above, and have no idea what I'm looking for in the code. Is there a specific enable?? I see that holding "SELECT" for 2 seconds should enable it, but it only toggles the screensaver on/off. While playing TMNT and button mashing, the monitor disappeared. Not sure what was pressed, but the only way I've been able to fix it to display the icon is to reinstall the image. Anyone care to shed more light on this? As said before, the low battery monitor still works, appears, and will eventually shutdown. Anything other than the LOW battery icon will no longer display.

EDIT: Found Button_19, which is also set to "Y". Turns out holding "Y" for 2 seconds will enable or disable the battery monitor. Thanks for the hints so long ago :lol:

User avatar
rodocop
Posts: 1723
Joined: Mon Aug 22, 2016 3:14 pm
Location: Saskatchewan
Has thanked: 606 times
Been thanked: 608 times

Re: On-Screen Battery Monitor Options

Post by rodocop » Thu Sep 27, 2018 3:06 pm

goosewerks wrote:
Wed Sep 26, 2018 9:27 am
Peeked through code as mentioned above, and have no idea what I'm looking for in the code. Is there a specific enable?? I see that holding "SELECT" for 2 seconds should enable it, but it only toggles the screensaver on/off. While playing TMNT and button mashing, the monitor disappeared. Not sure what was pressed, but the only way I've been able to fix it to display the icon is to reinstall the image. Anyone care to shed more light on this? As said before, the low battery monitor still works, appears, and will eventually shutdown. Anything other than the LOW battery icon will no longer display.

EDIT: Found Button_19, which is also set to "Y". Turns out holding "Y" for 2 seconds will enable or disable the battery monitor. Thanks for the hints so long ago :lol:
Also, FYI, you can change that value to any other GPIO as well, if you want a different buttons to toggle the monitor on/off and shutdown.

User avatar
goosewerks
Posts: 93
Joined: Mon May 22, 2017 8:27 am
Has thanked: 18 times
Been thanked: 39 times

Re: On-Screen Battery Monitor Options

Post by goosewerks » Mon Oct 01, 2018 12:40 pm

rodocop wrote:
Thu Sep 27, 2018 3:06 pm
goosewerks wrote:
Wed Sep 26, 2018 9:27 am
Peeked through code as mentioned above, and have no idea what I'm looking for in the code. Is there a specific enable?? I see that holding "SELECT" for 2 seconds should enable it, but it only toggles the screensaver on/off. While playing TMNT and button mashing, the monitor disappeared. Not sure what was pressed, but the only way I've been able to fix it to display the icon is to reinstall the image. Anyone care to shed more light on this? As said before, the low battery monitor still works, appears, and will eventually shutdown. Anything other than the LOW battery icon will no longer display.

EDIT: Found Button_19, which is also set to "Y". Turns out holding "Y" for 2 seconds will enable or disable the battery monitor. Thanks for the hints so long ago :lol:
Also, FYI, you can change that value to any other GPIO as well, if you want a different buttons to toggle the monitor on/off and shutdown.
Yep! Changed it to the right GPIO value for SELECT and it works just like it's supposed to work. The shutdown trigger also works, but I don't ever use it.

User avatar
goosewerks
Posts: 93
Joined: Mon May 22, 2017 8:27 am
Has thanked: 18 times
Been thanked: 39 times

Re: On-Screen Battery Monitor Options

Post by goosewerks » Mon Oct 08, 2018 6:00 pm

sixteenbit wrote:
Sun Apr 22, 2018 4:25 pm
Has anyone had any issues with this stopping from working after a while? I'm using ADS1115 and it works fine for a week or so then stops. If i do a fresh install of retropie and the script it works again.
In MintyShutdown.py go to the end and change the GPIO pin value for enable monitor. Same problem with mine finally fixed it.

User avatar
Merlin
Posts: 60
Joined: Thu Feb 22, 2018 12:32 pm
Has thanked: 44 times
Been thanked: 28 times

Re: On-Screen Battery Monitor Options

Post by Merlin » Fri Oct 12, 2018 6:27 am

Thanks for this thread!
I added an ADS1015 to my build too.
I already had a Safe Shutdown board by Camble (Banggood ed.) used to safe shutdown the gbz (but with battery monitor part disabled because it hangs the system)
So,first of all I completely removed Camble's Safe Power Monitor script and installed Mintybatterymonitor by HoolyHoo.
Then modded a little bit the script to works in combination to Safe Shutdown board and his power switch,without adding more physical buttons.

for those interested...(only if you are in mine condition: Camble's Safe shutdown Banggood ed. + asd1015)

Be sure to have the line: dtoverlay=gpio-poweroff:gpiopin=22,active_low="y" in your config.txt file

To use the power switch to shutdown the system:

Edit the MintyShutdown.py file

in line 46 change "shutdown_btn = Button(7, hold_time=1)" to "shutdown_btn = Button(27, pull_up=False, hold_time=0.3)"
Because GPIO 27 is the pin used by Safe Shutdown to issue a shutdown command and it needs to be pulled down, so it can go in high state when the switch is triggered.
Hold time reduced to 1 seconds to 0.3 seconds to have a fast response when the switch is moved to off position.

in line 47 "monitor_btn = Button(19, hold_time=2)" you can change 19 to any other button.
I used button 11 that for my setup corresponds to START button.
So when I hold START the battery icon will show up (and the emulationstation menu also appear because it use the same button,however this not go in conflict in any way with adafruit retrogame script)

Save and reboot

After this you have safe shutdown capability, onscreen battery monitoring and video alert...all toghether that works like a charm!

7dave7
Posts: 2
Joined: Mon Oct 15, 2018 2:18 am
Has thanked: 9 times

Re: On-Screen Battery Monitor Options

Post by 7dave7 » Sun Oct 28, 2018 7:58 am

Merlin wrote:
Fri Oct 12, 2018 6:27 am

Be sure to have the line: dtoverlay=gpio-poweroff:gpiopin=22,active_low="y" in your config.txt file
Hi, I would like ta ask you where the config.txt file is located.

Thnx

User avatar
rodocop
Posts: 1723
Joined: Mon Aug 22, 2016 3:14 pm
Location: Saskatchewan
Has thanked: 606 times
Been thanked: 608 times

Re: On-Screen Battery Monitor Options

Post by rodocop » Sun Oct 28, 2018 6:12 pm

/boot/config.txt

Ziploc99
Posts: 36
Joined: Sun Jun 17, 2018 10:02 am
Has thanked: 26 times
Been thanked: 11 times

Re: On-Screen Battery Monitor Options

Post by Ziploc99 » Sat Nov 10, 2018 12:43 pm

Merlin wrote:
Fri Oct 12, 2018 6:27 am
Thanks for this thread!
I added an ADS1015 to my build too.
I already had a Safe Shutdown board by Camble (Banggood ed.) used to safe shutdown the gbz (but with battery monitor part disabled because it hangs the system)
So,first of all I completely removed Camble's Safe Power Monitor script and installed Mintybatterymonitor by HoolyHoo.
Then modded a little bit the script to works in combination to Safe Shutdown board and his power switch,without adding more physical buttons.

for those interested...(only if you are in mine condition: Camble's Safe shutdown Banggood ed. + asd1015)

Be sure to have the line: dtoverlay=gpio-poweroff:gpiopin=22,active_low="y" in your config.txt file

To use the power switch to shutdown the system:

Edit the MintyShutdown.py file

in line 46 change "shutdown_btn = Button(7, hold_time=1)" to "shutdown_btn = Button(27, pull_up=False, hold_time=0.3)"
Because GPIO 27 is the pin used by Safe Shutdown to issue a shutdown command and it needs to be pulled down, so it can go in high state when the switch is triggered.
Hold time reduced to 1 seconds to 0.3 seconds to have a fast response when the switch is moved to off position.

in line 47 "monitor_btn = Button(19, hold_time=2)" you can change 19 to any other button.
I used button 11 that for my setup corresponds to START button.
So when I hold START the battery icon will show up (and the emulationstation menu also appear because it use the same button,however this not go in conflict in any way with adafruit retrogame script)

Save and reboot

After this you have safe shutdown capability, onscreen battery monitoring and video alert...all toghether that works like a charm!
I'm having a little trouble with working out how to wire the ads1015 with camble's safe shutdown board. I have a PB1000c, so it's a little different but could you share your wiring, I'd appreciate it. The software side changes above I understand. Thanks for figuring this out as I already have camble's board installed and wanted to add OSD battery.

Thanks

User avatar
Merlin
Posts: 60
Joined: Thu Feb 22, 2018 12:32 pm
Has thanked: 44 times
Been thanked: 28 times

Re: On-Screen Battery Monitor Options

Post by Merlin » Mon Nov 12, 2018 1:15 pm

I'm having a little trouble with working out how to wire the ads1015 with camble's safe shutdown board. I have a PB1000c, so it's a little different but could you share your wiring, I'd appreciate it. The software side changes above I understand. Thanks for figuring this out as I already have camble's board installed and wanted to add OSD battery.

Thanks
This is the schematic diagram that I used,you can find it at pag.7 of this thread:

Image

User avatar
hueblo
Posts: 175
Joined: Mon Jun 06, 2016 2:59 pm
Has thanked: 78 times
Been thanked: 81 times

Re: On-Screen Battery Monitor Options

Post by hueblo » Tue Dec 11, 2018 12:23 pm

Ziploc99 wrote:
Sat Nov 10, 2018 12:43 pm
Merlin wrote:
Fri Oct 12, 2018 6:27 am
Thanks for this thread!
I added an ADS1015 to my build too.
I already had a Safe Shutdown board by Camble (Banggood ed.) used to safe shutdown the gbz (but with battery monitor part disabled because it hangs the system)
So,first of all I completely removed Camble's Safe Power Monitor script and installed Mintybatterymonitor by HoolyHoo.
Then modded a little bit the script to works in combination to Safe Shutdown board and his power switch,without adding more physical buttons.

for those interested...(only if you are in mine condition: Camble's Safe shutdown Banggood ed. + asd1015)

Be sure to have the line: dtoverlay=gpio-poweroff:gpiopin=22,active_low="y" in your config.txt file

To use the power switch to shutdown the system:

Edit the MintyShutdown.py file

in line 46 change "shutdown_btn = Button(7, hold_time=1)" to "shutdown_btn = Button(27, pull_up=False, hold_time=0.3)"
Because GPIO 27 is the pin used by Safe Shutdown to issue a shutdown command and it needs to be pulled down, so it can go in high state when the switch is triggered.
Hold time reduced to 1 seconds to 0.3 seconds to have a fast response when the switch is moved to off position.

in line 47 "monitor_btn = Button(19, hold_time=2)" you can change 19 to any other button.
I used button 11 that for my setup corresponds to START button.
So when I hold START the battery icon will show up (and the emulationstation menu also appear because it use the same button,however this not go in conflict in any way with adafruit retrogame script)

Save and reboot

After this you have safe shutdown capability, onscreen battery monitoring and video alert...all toghether that works like a charm!
I'm having a little trouble with working out how to wire the ads1015 with camble's safe shutdown board. I have a PB1000c, so it's a little different but could you share your wiring, I'd appreciate it. The software side changes above I understand. Thanks for figuring this out as I already have camble's board installed and wanted to add OSD battery.

Thanks
Below is the wiring I used for my Adafruit 1000c with the shutdown switch.
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest