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
Patrizio
Posts: 5
Joined: Mon Mar 18, 2019 12:15 am
Has thanked: 3 times
Been thanked: 3 times

Re: On-Screen Battery Monitor Options

Post by Patrizio » Tue May 14, 2019 11:08 pm

rodocop wrote:
Tue May 14, 2019 5:41 pm
Hmm. I would try to bypass the a0 on the pcb. Try wiring a0 on the ads1015 direct to the b+ out on the tp4056 and see if that helps. Is there any other scripts running that might be causing interference?

Also, can you confirm, are you using an ads1015, or 1115, since the 1115 would need modification to the script too.
Confirmed, I'm using ads1015.
I spoke with another user that made the same build and he had the same issues as well.
Eventually, he ended up installing Helder/Bluup's OneInAll script found here: https://github.com/Helder1981/OneForAll
I installed it too and it seems to work fine. I'm currently testing it to see if the battery icon color changes.

I may try to figure what's going on with the other script since it should work as well, but for now, I'll keep the OneInAll.

Thanks so much for your help!

User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: On-Screen Battery Monitor Options

Post by infinitLoop » Wed May 15, 2019 9:46 am

Patrizio wrote:
Tue May 14, 2019 11:08 pm
I may try to figure what's going on with the other script since it should work as well, but for now, I'll keep the OneInAll.
so, this might be super obvious, but one thing i've found to help reveal what's going wrong in the minty battery script, is to exit emulationstation on the gameboy. frequently whatever error it had will be (briefly) displayed onscreen. it's almost always a gpio conflict with something enabled in the config or something else setting or watching the pins. when it can't read the i2c, you get a message saying that's not found (so, likely, you have the 1115 not the 1015). it's hard to find those if you're remoting in to do your changes and debugging.

User avatar
Patrizio
Posts: 5
Joined: Mon Mar 18, 2019 12:15 am
Has thanked: 3 times
Been thanked: 3 times

Re: On-Screen Battery Monitor Options

Post by Patrizio » Sat May 18, 2019 1:32 pm

infinitLoop wrote:
Wed May 15, 2019 9:46 am
Patrizio wrote:
Tue May 14, 2019 11:08 pm
I may try to figure what's going on with the other script since it should work as well, but for now, I'll keep the OneInAll.
so, this might be super obvious, but one thing i've found to help reveal what's going wrong in the minty battery script, is to exit emulationstation on the gameboy. frequently whatever error it had will be (briefly) displayed onscreen. it's almost always a gpio conflict with something enabled in the config or something else setting or watching the pins. when it can't read the i2c, you get a message saying that's not found (so, likely, you have the 1115 not the 1015). it's hard to find those if you're remoting in to do your changes and debugging.
Well, it is not super obvious and I agree with you that it's helpful to look at those logs.
One thing that I found difficult in the past was not to have enough time to read those error messages because they stay on for a very small amount of time. I only recently found out about this command:

Code: Select all

tail -n 100 /var/log/syslog

You can replace the 100 with the number of lines that you want to show from the syslog.

For this specific issue tho, I could get any help from it.
I'm also experiencing other unrelated issues on this sd image, so I may start fresh from a new image and try the minty battery script again.

User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: On-Screen Battery Monitor Options

Post by infinitLoop » Sat May 18, 2019 5:20 pm

Patrizio wrote:
Sat May 18, 2019 1:32 pm
Well, it is not super obvious and I agree with you that it's helpful to look at those logs.
One thing that I found difficult in the past was not to have enough time to read those error messages because they stay on for a very small amount of time. I only recently found out about this command:

Code: Select all

tail -n 100 /var/log/syslog

You can replace the 100 with the number of lines that you want to show from the syslog.
awesome. thanks! i've just resorted to taking an iphone pic when it's too long to read :D

User avatar
Patrizio
Posts: 5
Joined: Mon Mar 18, 2019 12:15 am
Has thanked: 3 times
Been thanked: 3 times

Re: On-Screen Battery Monitor Options

Post by Patrizio » Sat May 18, 2019 10:30 pm

infinitLoop wrote:
Sat May 18, 2019 5:20 pm
Patrizio wrote:
Sat May 18, 2019 1:32 pm
Well, it is not super obvious and I agree with you that it's helpful to look at those logs.
One thing that I found difficult in the past was not to have enough time to read those error messages because they stay on for a very small amount of time. I only recently found out about this command:

Code: Select all

tail -n 100 /var/log/syslog

You can replace the 100 with the number of lines that you want to show from the syslog.
awesome. thanks! i've just resorted to taking an iphone pic when it's too long to read :D
Same here :lol: I have been doing the same since a few days ago until I found out about this.

User avatar
Konek
Posts: 4
Joined: Wed Jul 03, 2019 11:14 pm
Has thanked: 1 time
Been thanked: 1 time

Re: On-Screen Battery Monitor Options

Post by Konek » Mon Jul 15, 2019 11:46 am

Can we move the icon location and change it size? I'm using rpi3b+ with 7" official touch screen and would like to move it to top right hand corner with smaller size icon. Default icon size is little big and off a bit to left of that corner.

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 » Mon Jul 15, 2019 12:48 pm

Konek wrote:
Mon Jul 15, 2019 11:46 am
Can we move the icon location and change it size? I'm using rpi3b+ with 7" official touch screen and would like to move it to top right hand corner with smaller size icon. Default icon size is little big and off a bit to left of that corner.
Yes you can, to edit the size you actually need to modify the PNG image files on your computer to adjust the size, and then you need to adjust the script for the position.

Look in the MintyBatteryMonitor.py for this line and edit the X and Y and find what works best for you (there will be two instances of this line, edit both the same):

os.system(PNGVIEWPATH + "/pngview -b 0 -l 3000" + percent + " -x 650 -y 10 " + ICONPATH + "/battery" + percent + ".png &")

User avatar
Konek
Posts: 4
Joined: Wed Jul 03, 2019 11:14 pm
Has thanked: 1 time
Been thanked: 1 time

Re: On-Screen Battery Monitor Options

Post by Konek » Mon Jul 15, 2019 2:28 pm

ime=1563216535 user_id=1765]
Konek wrote:
Mon Jul 15, 2019 11:46 am
Can we move the icon location and change it size? I'm using rpi3b+ with 7" official touch screen and would like to move it to top right hand corner with smaller size icon. Default icon size is little big and off a bit to left of that corner.
Yes you can, to edit the size you actually need to modify the PNG image files on your computer to adjust the size, and then you need to adjust the script for the position.

Look in the MintyBatteryMonitor.py for this line and edit the X and Y and find what works best for you (there will be two instances of this line, edit both the same):

os.system(PNGVIEWPATH + "/pngview -b 0 -l 3000" + percent + " -x 650 -y 10 " + ICONPATH + "/battery" + percent + ".png &")
[/quote]

Thank you for your help :)

User avatar
Raccoon
Posts: 2
Joined: Sun Dec 22, 2019 4:50 am
Has thanked: 1 time

Re: On-Screen Battery Monitor Options

Post by Raccoon » Tue Apr 07, 2020 9:39 am

Guys,

For those who are working on RPI 3A+ Retropie builds the MintyBattery Monitor may be the only option.

Presently you can't get it working out-of-the-box. The reason being Adafafruit no longer supports Python2 and the project hasn't been updated for a while. But this is solvable.

In addition to steps outlined in original installation instructions you need to:

- Install PIP3
- Install Adafruit_ADS1X15 Lib for Python3 using PIP3
- Edit two lines of code in MintyBatteryMonitor.py to add byte object cast (as type checks are more strict in Python3):
…..
nums = out.split(b'\n')
……
os.system(b"sudo kill " + killid)
……
- Change command lines in MintyStart.py to use python3 instead of python (literally substitute "python" with "python3")

You should be good to go!

Hope this helps.
VLTIMA RATIO REGVM

djobbydjobba
Posts: 9
Joined: Tue Mar 26, 2019 6:45 am
Has thanked: 2 times
Been thanked: 1 time

Re: On-Screen Battery Monitor Options

Post by djobbydjobba » Tue Apr 28, 2020 11:46 am

Thank you for your help. Indeed it does not work anymore. But even with your instructions that still doesn't work. I've changed the lines as mentionned, installed pip3, installed adafruit circuitpython library... Nothing shows up.
Would you mind helping me out ?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest