Camble's Safe Shutdown and Minty Battery Monitor Problems

Having trouble with your GBZ build? Ask your questions here!
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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by infinitLoop » Sun Mar 03, 2019 9:08 pm

same results, essentially. retrogame is fine, safe shutdown is triggered but always results in kernel panic, and the battery monitor just doesn't do anything, that i can see.

i've double checked connection spots 20 times over, but i guess i could go through and try re-soldering or just applying some more solder, even tho they look ok.

this is my gpio mapping. i didn't think it was all that radical, but maybe there's something in there:

Safe Shutdown:

Code: Select all

3v3 
ON   17
OFF 27
LOW 22
ADS1015:

Code: Select all

SDA 2
SCL 3
(function 7)
Buttons:

Code: Select all

UP      20      # 'UP' button
DOWN    26      # 'DOWN' button
LEFT    21      # 'LEFT' Button
RIGHT   19      # 'RIGHT' button
A       0       # 'A' Button
B       1       # 'B' button
X       6       # 'X' button
Y       5       # 'Y' button
ENTER   12      # 'ENTER' button
SPACE   16      # 'SELECT' button
L       9       # 'Left' Shoulder button
R       24      # 'Right' Shoulder button
C       11      # 'Left' Trigger button
Z       23      # 'Right' Trigger button
ESC     16 12   # Hold Start+Select to exit ROM


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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by infinitLoop » Mon Mar 04, 2019 5:39 am

VeteranGamer wrote:
Mon Mar 04, 2019 12:47 am
Can you show you wiring or setup
.
here's one. it's hard to get a pic where the connections are all visible in it, and i just broke off the battery connection at the ads1015 when i was trying to move stuff around to get the picture, but that was connected at a0 where the resistor is.
power_issue.jpg
power_issue.jpg (2.26 MiB) Viewed 5975 times

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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by VeteranGamer » Mon Mar 04, 2019 6:24 am

well....

for a start....

unless you've changed the GPIO pinouts (in the script/config) for Camble Safe Shutdown
(you may have done, I might have missed that bit)


viewtopic.php?f=38&t=2260


On BCM/GPIO22 (physical pin 15)
Off BCM/GPIO27 (physical pin 13)
Low BCM/GPIO17 (physical pin 11)


you've got your wires around the wrong way.....
(but you may have done this knowingly)


Image


look where the LOW wire (Yellow) is compared to yours....
look where the ON wire (Purple) is compared to yours......


if you have changed the pinouts knowingly (and even if you didn't)....
just swap the wires over to how Camble has it originally in the script (as clearly detailed in his post), and just install/enable the Shutdown as its meant to be.....
you may not have been making the changes properly according to how it is wired (if you did this purposely)


this should solve that issue and the most probably the reason you were getting the Kernal panic....
(just wire and install everything as stock)



as for the ADS1015
that looks to be wired correctly (but I'm not 100% on this)....

but I cant see where the Power wire is going (is it getting proper power)
also
this is a long shot...
but this has happened to me, where I've ordered/purchased an ADS1015 and they sent me a ADS1115...
they both look identical except for the chip

ADS1015 will have BRPI on it
ADS1115 will have BOGI on it


its worth just double checking.....
as well as the wiring again...
and make sure the i2C is enabled (via Raspi-Config)



.

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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by infinitLoop » Mon Mar 04, 2019 7:20 am

ugh. are you kidding :oops: :x i figured there had to be something dumb i missed somewhere. i don't know where/how i got those 2 mixed up, but i do have it those the opposite way in my notes, and on the page i had printed for reference. so all my validating was validating those wrong. i'll try switching those in the config later today, but i think you're right, that that is my problem there, since it seems like that kernel panic gets thrown if its not getting that pin feedback. i swear i think i've developed dyslexia while doing this stuff.

for the ads, the power (first pin) is going to the 5v power strip. the ground is going to the battery ground.

if it was the 1115, i thought it would just have the wrong threshholds, but would still work. is that not the case?

it does appear to have the BOGI on the chip - so, if that's true, and this is the 1115, is there something else i should do with the software to get it going?

thanks for the help working through this with me

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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by VeteranGamer » Mon Mar 04, 2019 8:23 am

infinitLoop wrote:
Mon Mar 04, 2019 7:20 am
ugh. are you kidding :oops: :x i figured there had to be something dumb i missed somewhere. i don't know where/how i got those 2 mixed up, but i do have it those the opposite way in my notes, and on the page i had printed for reference. so all my validating was validating those wrong. i'll try switching those in the config later today, but i think you're right, that that is my problem there, since it seems like that kernel panic gets thrown if its not getting that pin feedback. i swear i think i've developed dyslexia while doing this stuff.

for the ads, the power (first pin) is going to the 5v power strip. the ground is going to the battery ground.

if it was the 1115, i thought it would just have the wrong threshholds, but would still work. is that not the case?

it does appear to have the BOGI on the chip - so, if that's true, and this is the 1115, is there something else i should do with the software to get it going?

thanks for the help working through this with me


personally i wouldn't start changing the config.txt for the Safe Shutdown....
the better option/route IMHO is to just swap the wires over and to have everything as stock and install it the way its designed to be.....


as for the ADS1115
i've personally never had success with it (ads1115)...
thats not to say it wont/cant work, as there have been members that have stated/reported that they have had success.....


but I would look at these bits in MintyBatteryMonitor.py



line 24 (this could need to be changed/edited to reflect what ADS you have)

Image



line 55 (this should be adjusted to the appropriate type of ADS in regards to read values)

Image







.

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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by infinitLoop » Mon Mar 04, 2019 9:27 am

VeteranGamer wrote:
Mon Mar 04, 2019 8:23 am

personally i wouldn't start changing the config.txt for the Safe Shutdown....
the better option/route IMHO is to just swap the wires over and to have everything as stock and install it the way its designed to be.....


as for the ADS1115
i've personally never had success with it (ads1115)...
thats not to say it wont/cant work, as there have been members that have stated/reported that they have had success.....


but I would look at these bits in MintyBatteryMonitor.py



line 24 (this could need to be changed/edited to reflect what ADS you have)


line 55 (this should be adjusted to the appropriate type of ADS in regards to read values)

.
i didn't mean in the config.txt, just the pin configuration/mapping in the safe_power_monitor.py file. i don't *think* i can screw that up, but who knows.

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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by infinitLoop » Mon Mar 04, 2019 4:48 pm

yep - swapping the values in the safe shutdown file fixed that. that's good (and bad that i missed it so many times).

still no luck with the battery monitor. i swapped out the voltage divisor and the model number reference, but i still don't get any onscreen feedback. i tried reinstalling the python packages for the adafruit 1115 drivers even, but it said everything was up-to-date already with the 1x15 stuff. no errors (that i saw), just nothing on screen.

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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by infinitLoop » Mon Mar 04, 2019 4:59 pm

maybe i'll just cut my losses on pull out the ads...

i still have the button though, and i already modded the case for it, so i have to do something there. maybe i'll try and hack a script together to do something like the combo script, to control brightness and bluetooth and stuff.

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: Camble's Safe Shutdown and Minty Battery Monitor Problems

Post by infinitLoop » Mon Mar 04, 2019 8:12 pm

success!! i swapped out the little purple guy, that i *thought* was a 1015, with the bigger blue guy that i figured was the 1115 that didn't want to use, and using a 4.4 image, and the 1115 settings.... I GET THE BATTERY ICON !!!

:D :!:
SpoilerShow
pwr.jpg
pwr.jpg (882.97 KiB) Viewed 5920 times
and safe shutdown and retrogame all seem to be working, and the button 7 works to hide / show the icon. !! :D

finally

so... now that i know i can get that, i may try to get something going with this ads and the combo

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest