Page 16 of 17

Re: On-Screen Battery Monitor Options

Posted: Tue May 14, 2019 11:08 pm
by Patrizio
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!

Re: On-Screen Battery Monitor Options

Posted: Wed May 15, 2019 9:46 am
by infinitLoop
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.

Re: On-Screen Battery Monitor Options

Posted: Sat May 18, 2019 1:32 pm
by Patrizio
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.

Re: On-Screen Battery Monitor Options

Posted: Sat May 18, 2019 5:20 pm
by infinitLoop
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

Re: On-Screen Battery Monitor Options

Posted: Sat May 18, 2019 10:30 pm
by Patrizio
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.

Re: On-Screen Battery Monitor Options

Posted: Mon Jul 15, 2019 11:46 am
by Konek
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.

Re: On-Screen Battery Monitor Options

Posted: Mon Jul 15, 2019 12:48 pm
by rodocop
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 &")

Re: On-Screen Battery Monitor Options

Posted: Mon Jul 15, 2019 2:28 pm
by Konek
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 :)

Re: On-Screen Battery Monitor Options

Posted: Tue Apr 07, 2020 9:39 am
by Raccoon
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.

Re: On-Screen Battery Monitor Options

Posted: Tue Apr 28, 2020 11:46 am
by djobbydjobba
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 ?