Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

PiGrrl 2 button inputs
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PiGrrl 2 button inputs

by adamjjacobs1 on Wed Jul 29, 2020 11:53 am

Hello, I got the PiGrrl 2 kit 2 years ago or so at this point, and I finally decided to give the project a go. Most everything works just as it should, though I cannot figure out what is going on with my "Left" and "Start" inputs! I'm only mildly experienced with a soldering iron so I'm hoping it is just user error, though I'm not sure how to go about this. I have a multimeter, though Im not sure witch pins to test. I've tried re-flowing all the solder joints, and even at one point the "Left" input started working! But no longer does... so weird...

Could I wire the buttons on the gamepad PCB directly to the GPIO's on the RPI 3? Ive tried with the "Start" button (Pin 31 GPIO 6) least I think I did... but no luck
I'm not super experienced with this stuff, troubleshooting is tough enough. Is there an alternative fix I'm not aware of?

adamjjacobs1
 
Posts: 10
Joined: Sat Jan 20, 2018 1:18 pm

Re: PiGrrl 2 button inputs

by mikeysklar on Wed Jul 29, 2020 5:15 pm

Hi adamjjacobs1,

Could you post some good quality photos of your soldering? Maybe we can see the issue.

When you press the buttons directly (not using the 3D printed enclosure) do the buttons "Left" and "Start" trigger properly? There is no need to tie directly to the GPIOs.

I struggled to get my 3D prints to make good contact with all the buttons below initially. I had to get the case closed just right.

mikeysklar
 
Posts: 1730
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiGrrl 2 button inputs

by adamjjacobs1 on Thu Jul 30, 2020 1:22 am

mikeysklar wrote:Hi adamjjacobs1,

Could you post some good quality photos of your soldering? Maybe we can see the issue.

When you press the buttons directly (not using the 3D printed enclosure) do the buttons "Left" and "Start" trigger properly? There is no need to tie directly to the GPIOs.

I struggled to get my 3D prints to make good contact with all the buttons below initially. I had to get the case closed just right.



Hey! Thanks for the reply, I figured out the issue with the buttons.

So they were shorting with all four pins of the buttons soldered to the pcb. I desoldered the 2 buttons, and resoldered 2 different buttons but using only 2 of the four legs.

Weird the problem didn't affect any of the other inputs!

Though I've got a different issue now!

I can't get the audio to work. I hear light feedback coming from the speaker when it is on (which seems like a good thing) but does not play in-game.

Is there a setting I need to change in emulationstation?

I've tried changing the output to the option "speaker" which 0%'s the volume, but even if i manually hold the button to turn it to 100% it still 0's out once I exit the screen.

Could it be something to do with that?

Should I change the output to HDMI, audio jack, or auto?

I feel like things are finally starting to roll, but dang it sure would be nice to hear the games!

adamjjacobs1
 
Posts: 10
Joined: Sat Jan 20, 2018 1:18 pm

Re: PiGrrl 2 button inputs

by mikeysklar on Thu Jul 30, 2020 1:58 pm

Hi adamjjacobs1,

Good job on getting the buttons sorted out. I suspect they might have been mounted 90 degrees off the intended angle since soldering only two of the four pins resolved the issue.

The sound should be set to audio jack.

We do have some bits of Audio Issues addressed in the trouble-shooting section of the pigrrl-2 guide.

https://learn.adafruit.com/pigrrl-2/trouble-shooting

Retropie has sound options built into the software. It may be muted or set to really low. To adjust it, press the "Start" button to bring up the Menu. Then, use the D-Pad to highlight “Sound Settings”. Use the “A” button to select and D-Pad to increase volume. Press the “B” button to exit.

mikeysklar
 
Posts: 1730
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiGrrl 2 button inputs

by adamjjacobs1 on Fri Jul 31, 2020 10:41 pm

mikeysklar wrote:Hi adamjjacobs1,

Good job on getting the buttons sorted out. I suspect they might have been mounted 90 degrees off the intended angle since soldering only two of the four pins resolved the issue.

The sound should be set to audio jack.

We do have some bits of Audio Issues addressed in the trouble-shooting section of the pigrrl-2 guide.

https://learn.adafruit.com/pigrrl-2/trouble-shooting

Retropie has sound options built into the software. It may be muted or set to really low. To adjust it, press the "Start" button to bring up the Menu. Then, use the D-Pad to highlight “Sound Settings”. Use the “A” button to select and D-Pad to increase volume. Press the “B” button to exit.


Oh my, that certainly was the easiest issue to resolve... audio works now!

I spent the last day and a half trying to fit everything into the case, dang that took a lot more effort than anticipated...

Wires kept popping off everywhere. I over-tightened some screws...

But I picked up flux, what a life saver...

No issues now Just fit everything together actually! It's working as it should!

Though a few things;

Should I really mount the RPI to the back part of the shell?

1. I don't have screws short enough for mounting (no dremel to file down a screw either)

2. It seems like it would make opening the case a pain, it's annoying enough...

Is there any fool-proof way to reduce or eliminate the static in the sound? I've read in the forums here:

Someone wrapped the battery in metallic tape and grounded with copper tape to the powerboost.

Someone else wrapped the speaker wires with a special shielding.

Someone else lowered a value in a config file

Do any of these solutions really help?

One last thing, I can't get to retroarch through most emulators, sega-cd and pce-cd randomly do though

Most systems just toggle a fast forward hot key whenever I press select, normal button combinations (select+X, select+start) don't work so I can't go into retroarch to change my

controls, and I can't exit the game, amongst other crucial things.

Although, the button (left bottom to the screen) will exit the game, which is weird but helpful.

Not in pce-cd or sega-cd though, select+ whatever works fine there

This is super weird, I worked on this image for awhile and just made it compatible with the pi grrl.

Would it be in my favor to start with a fresh retropie image? That'd be a pain, but if it works great!

Sorry for the long winded reply!

I really appreciate the help, I've done some light soldering: console mods, arcade controls, PC repair

But this one was kinda intense for me! Plus I don't know anyone that could help personally.

So this is great! Thanks!
Attachments
pi grrl.jpg
pi grrl.jpg (142.11 KiB) Viewed 43 times

adamjjacobs1
 
Posts: 10
Joined: Sat Jan 20, 2018 1:18 pm

Re: PiGrrl 2 button inputs

by mikeysklar on Mon Aug 03, 2020 4:23 pm

Case and buttons look great. Nice color combo.

Did you install the keypress retrogame support?

https://learn.adafruit.com/pigrrl-2/software

Code: Select all | TOGGLE FULL SIZE
 cd
curl https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/retrogame.sh >retrogame.sh
sudo bash retrogame.sh


You have to redo part of this setup after you have everything enclosed and pretty much working:

Also, after the system is assembled with the PiTFT and controls, you’ll need to re-do the controller setup. This might wait ’til all the parts are assembled in the case.
raspberry_pi_input.png
From the main EmulationStation screen, press whatever key was assigned to the “Start” button to access the main menu. You’ll find an option here for “CONFIGURE INPUT.”

Go through the control setup process again using the PiGRRL buttons now instead of the keyboard; assign the D-pad directions, Start and Select buttons, A, B, X and Y. For


I ended up not using the speaker on my Pi. The sound quality bothered me, but shielding the audio wires and battery might help. I think it might be worth considering using bluetooth or if you can tolerate it a 1/8" cable into the audio port for when you really want audio.

mikeysklar
 
Posts: 1730
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiGrrl 2 button inputs

by adamjjacobs1 on Wed Aug 05, 2020 12:17 am

Hey thanks, was kinda reproducing the look of my childhood GBC!

I didn't realize you had to reinstall the controller pad software.

One thing of note, I got fed up with fiddling with the image I was using, bit of a shame I put some work into that one!

So I downloaded a user made image, ran the scripts for the TFT and game pad, and no issues. I was so surprised.

I'm just going to try modifying this one to my liking.

I was thinking I may want to go the route of headphones, though I still would like to use the speaker.

If I installed an audio jack, since the speaker is going off the audio jack on the pi,
would plugging in headphones override the speaker and play only through the headphones, or both?

Do you think this could work? I really want to try all the shielding methods before I give up on the speaker.

A bluetooth speaker isn't a bad idea, but still not preferable.

Maybe something like this mounted to the case with an aux cable connecting it to the RPI's audio jack?
https://www.ebay.com/itm/NEW-Philmore-3 ... Sw4tJecQT~

Ill do some tinkering

adamjjacobs1
 
Posts: 10
Joined: Sat Jan 20, 2018 1:18 pm

Re: PiGrrl 2 button inputs

by mikeysklar on Wed Aug 05, 2020 10:43 am

You should be able to use the mini speaker and headphones plugged into via 1/8th" audio plug at the same time.

Also USB audio dongles are a thing. Maybe that is viable option.

USB Audio Adapter - Works with Raspberry Pi
https://www.adafruit.com/product/1475

mikeysklar
 
Posts: 1730
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiGrrl 2 button inputs

by adamjjacobs1 on Thu Aug 06, 2020 9:10 am

mikeysklar wrote:You should be able to use the mini speaker and headphones plugged into via 1/8th" audio plug at the same time.

Also USB audio dongles are a thing. Maybe that is viable option.

USB Audio Adapter - Works with Raspberry Pi
https://www.adafruit.com/product/1475




Hm, so you think if I did add an audio jack sound would play through both the speaker mounted in the case, and the headphones at the same time?

I have seen that usb adapter, I just really would like to keep everything as consolidated as possible.

adamjjacobs1
 
Posts: 10
Joined: Sat Jan 20, 2018 1:18 pm

Re: PiGrrl 2 button inputs

by mikeysklar on Thu Aug 06, 2020 11:12 am

You would have to configure alsa.conf to control the audio output. Adding a USB device is usually something changing the 0 values here to 1.

Code: Select all | TOGGLE FULL SIZE
sudo nano /usr/share/alsa/alsa.conf


Code: Select all | TOGGLE FULL SIZE
defaults.ctl.card 0
defaults.pcm.card 0



Code: Select all | TOGGLE FULL SIZE
defaults.ctl.card 1
defaults.pcm.card 1


The Pi folks tried to make things easy with HDMI and Analog jack being auto-detected by default. Give it a try and see if you can have USB and analog simultaneously.

https://www.raspberrypi.org/documentati ... -config.md

mikeysklar
 
Posts: 1730
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiGrrl 2 button inputs

by adamjjacobs1 on Tue Aug 11, 2020 8:19 pm

mikeysklar wrote:You would have to configure alsa.conf to control the audio output. Adding a USB device is usually something changing the 0 values here to 1.

Code: Select all | TOGGLE FULL SIZE
sudo nano /usr/share/alsa/alsa.conf


Code: Select all | TOGGLE FULL SIZE
defaults.ctl.card 0
defaults.pcm.card 0



Code: Select all | TOGGLE FULL SIZE
defaults.ctl.card 1
defaults.pcm.card 1


The Pi folks tried to make things easy with HDMI and Analog jack being auto-detected by default. Give it a try and see if you can have USB and analog simultaneously.

https://www.raspberrypi.org/documentati ... -config.md



At the end of the day I didn't have much luck with the copper tape and ferrite beads,
Though I later realized I did much of it wrong! Perhaps if I took more time and reread some things I'd have gotten it right.

So anyway, I got frustrated and snipped the speaker wires. Spruced up some crappy soldering, and said I'm done.
I'm just going to use a low profile usb/audio dongle for audio.

Headphones should suffice, and when playing multiplayer a portable speaker would work great!

I would love to spend more time with this and try for my original vision, but honestly it's pretty darn rad as is, plus the audio dongle should save the day.

One last question,

Is there anyway I can check the status of the battery life in retropie that I would be able to navigate without a keyboard?

adamjjacobs1
 
Posts: 10
Joined: Sat Jan 20, 2018 1:18 pm

Re: PiGrrl 2 button inputs

by mikeysklar on Wed Aug 12, 2020 4:29 pm

Hi adamjjacobs1,

Yes, the PowerBoost 1000C is an awesome device that can be hooked into your Pi to read the battery voltage. Unfortunately, this requires adding another chip the MCP3008 ADC and using at least two GPIO pins for communication. Both of which are problematic with the PiGRRL setup having a display and minimal space. I'll include a schematic and github project that illustrate the process at the end of this.

The easier solution here is to rely on the PowerBoost 1000C three LEDs:
* low battery (red)
* charging (yellow)
* full charged (green)

Your 2000 - 2500mAH battery will be good for 5-6 hours. If you want to break out the LEDs with a piece of fiber optic or cuts into the case you could view the status of the battery.

Here is the github project if you want OS level access to the battery. You'll have to rig up something clever to remap the pi_power.py script to a gamepad key to bypass the need for a keyboard.

https://github.com/craic/pi_power

1CE58673-5350-4AAC-9367-2804335FC71A.jpeg
1CE58673-5350-4AAC-9367-2804335FC71A.jpeg (416.44 KiB) Viewed 14 times

mikeysklar
 
Posts: 1730
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.