MintyBatterymonitor No on-screen battery icon

Having trouble with your GBZ build? Ask your questions here!
Post Reply
User avatar
kaning
Posts: 10
Joined: Tue Nov 01, 2016 6:47 pm
Has thanked: 3 times

MintyBatterymonitor No on-screen battery icon

Post by kaning » Wed Mar 25, 2020 10:45 am

Hi all!

My setup is not really a pi zero build but i couldn´t find any other section taht this topic would fit.

I´ve built a Raspberry Pi 3 B+ on classic gameboy shell. i use Arduino Pro MIcro for the Controller.
For Power and Safe Shutdown i got a TinkerBoy PowerSwitch.
For Battery monitoring i got an ADS1015 and installed MintyBatteryMonitor.

So i installed both following GitHub and TinkerBoys instructions.
SafeShutdown works as it should. The MintyBatteryMonitor was installed sucessfully, no errors but on reboot no icon showed up. To check i grounded GPIO7 and indeed the PI turned of. When i ground GPIO19 nothing happens. I´ve read that you can do the same with "Select" (2 secs) but again nothing happens, never seen the battery icon. See connections below.

Image
Image
(nevermind the loose cable)

ADS1015
A0 connected to Battery+ with a 10k resistor
SDA to SDA on PI3
SCL to SCL on PI3
VDD and GRND to VDD and GRND on TinkerBoy PowerSwitch
I triple checked it. :D

So with this said i don´t know how i should debug this? Any tips?
ADS1015 Faulty?meh...
Should i start a fresh SD? I would cry because i dont even know what image i used eheh
Also thought of Trying OneForAll but i´m afraid the GPIO assigned for buttons bugs my current configuration, i dont use GPIO's for the controller. Can i remove the Key maping from OneForAll script? Thanks! in advance!!

User avatar
VeteranGamer
Posts: 1738
Joined: Thu Jan 26, 2017 11:12 am
Location: London, UK
Has thanked: 528 times
Been thanked: 909 times

Re: MintyBatterymonitor No on-screen battery icon

Post by VeteranGamer » Wed Mar 25, 2020 11:23 am

have you enabled/turned on I2C in raspi-config.....

should be found in interfacing options....


.

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: MintyBatterymonitor No on-screen battery icon

Post by infinitLoop » Wed Mar 25, 2020 11:34 am

kaning wrote:
Wed Mar 25, 2020 10:45 am

So with this said i don´t know how i should debug this? Any tips?
ADS1015 Faulty?meh...
Should i start a fresh SD? I would cry because i dont even know what image i used eheh
Also thought of Trying OneForAll but i´m afraid the GPIO assigned for buttons bugs my current configuration, i dont use GPIO's for the controller. Can i remove the Key maping from OneForAll script? Thanks! in advance!!
running "sudo i2cdetect -y 1" at the command line should tell you if the ads is working. you should get like a grid of lines, with a "48" in the middle. i forget exactly where, like 40/b or something. it should look similar to this: https://learn.adafruit.com/adafruits-ra ... g-i2c-5-14

it shouldn't hurt to run the oneforall without using the gpio mapping either if you want to try that


.

User avatar
kaning
Posts: 10
Joined: Tue Nov 01, 2016 6:47 pm
Has thanked: 3 times

Re: MintyBatterymonitor No on-screen battery icon

Post by kaning » Wed Mar 25, 2020 11:56 am

Hi! That was a fast reply!
infinitLoop wrote:
Wed Mar 25, 2020 11:34 am
running "sudo i2cdetect -y 1" at the command line should tell you if the ads is working. you should get like a grid of lines, with a "48" in the middle. i forget exactly where, like 40/b or something. it should look similar to this: https://learn.adafruit.com/adafruits-ra ... g-i2c-5-14
Yes, confirmed.See below.
So does that mean that the battery monitoring is working?
SpoilerShow
Image
infinitLoop wrote:
Wed Mar 25, 2020 11:34 am
it shouldn't hurt to run the oneforall without using the gpio mapping either if you want to try that
Even if the TinkerBoy PowerSwitch have the S and P pins using those GPIOS?
VeteranGamer wrote:
Wed Mar 25, 2020 11:23 am
have you enabled/turned on I2C in raspi-config.....

should be found in interfacing options....
I did infinitloop tip first so i guess that confirms it. I went in and set to enable anyway. Rebooted but still no baterry icon.

Could it be just a "graphical" issue? caused by the theme i'm using or something? Sorry about my ignorance eheh

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: MintyBatterymonitor No on-screen battery icon

Post by infinitLoop » Wed Mar 25, 2020 12:55 pm

kaning wrote:
Wed Mar 25, 2020 11:56 am

So does that mean that the battery monitoring is working?
yes - insofar as, the pi is recieving the reading from the ads over i2c
kaning wrote:
Wed Mar 25, 2020 11:56 am
Even if the TinkerBoy PowerSwitch have the S and P pins using those GPIOS?
probably, but you can always update the one-for-all text config to point to other pins
kaning wrote:
Wed Mar 25, 2020 11:56 am
Could it be just a "graphical" issue? caused by the theme i'm using or something? Sorry about my ignorance eheh
it could actually. the icon can sometimes get lost off the screen.

you can enable the debug option in the mintybatterymonitor script, and that will write the voltage to the screen output, if it is reading it. then you can tweak the placement of the icon in there too -> MintyBatteryMonitor.py, "changeicon" method, change the X/Y coordinates in the PngView call

User avatar
kaning
Posts: 10
Joined: Tue Nov 01, 2016 6:47 pm
Has thanked: 3 times

Re: MintyBatterymonitor No on-screen battery icon

Post by kaning » Thu Mar 26, 2020 2:48 pm

Hi again,

turning on the debug feature didn´t work, also tried messing with x,y but also no luck.

Ended improving my screen in process by tweaking a few settings and installed OneForAll script which worked but the icon is so small (i´m using 1280*960), a battle for another day. eheh

I also looked a way on how to remove MintyBatteryMonitor.py from the Pi but i got a permission denied when using
rm command. Is there other way to do this?

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

Re: MintyBatterymonitor No on-screen battery icon

Post by rodocop » Fri Mar 27, 2020 9:34 pm

kaning wrote:
Thu Mar 26, 2020 2:48 pm
Hi again,

turning on the debug feature didn´t work, also tried messing with x,y but also no luck.

Ended improving my screen in process by tweaking a few settings and installed OneForAll script which worked but the icon is so small (i´m using 1280*960), a battle for another day. eheh

I also looked a way on how to remove MintyBatteryMonitor.py from the Pi but i got a permission denied when using
rm command. Is there other way to do this?
Wouldn't be too concerned about removing it, just put a '#' in front of the line in the rc.local file. So it's disabled.

But if you want to remove the directory for the minty battery monitor try this:

In the terminal:
rm -rf directory name (if that doesn't work use sudo in front)

To change the icon size you'll likely just need to edit the files on your computer and copy the larger icons over the existing icons.

User avatar
kaning
Posts: 10
Joined: Tue Nov 01, 2016 6:47 pm
Has thanked: 3 times

Re: MintyBatterymonitor No on-screen battery icon

Post by kaning » Wed Jul 15, 2020 4:11 pm

Hi guys,

Recently i took another try at it with a fresh image.
At the start i was not getting it to work but after following the steps from Raccoon reply on another post it worked!!

It has to do with python3. i will leave is comment below. Thanks!

"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."

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest