esbiete
Posts: 6
Joined: Wed Mar 11, 2015 7:19 am

Re: Multi-console gamepad driver for GPIO

Sun Mar 15, 2015 6:13 pm

marqs wrote:
esbiete wrote:Definitively it's the last BerryBoot version, which has the -v7i-aufs kernel and it's being used cross-wide in all the OS's that you add to boot. I see no other option than wait for a new version of BerryBoot that includes a new kernel. I will try to see if I can get another solution. Anyway, do you have any link/how-to build for a specific kernel and getting the headers?
Yes, it seems that BerryBoot uses a single patched kernel for all OS. However, apparently Raspbian team kernels support AUFS (although only as a loadable module), so perhaps you could try installing one of those (using apt-get) and selecting it as the active kernel in BerryBoot (by modifying config.txt). Raspbian team kernels come with headers (also installable with apt-get), so that's also a solution for those who have issues with the generated headers for the standard Raspberry Pi foundation kernels.

I tried to quickly find out how BerryBoot patches its kernel, but I only found an old patch which may or may not work if headers were built for contemporary kernels.
There was a new BerryBoot version created for the RPI2 but I think was not created from the git repo so, it's being difficult to create it from scratch changing the kernel version and few more things. Also buildroot is creating some problems, but well, I will keep on trying for divertimento few more days and/or desist :) So, thanks for the links!!

Anyway, I've downloaded a Retropie standalone installation and added to a blank SD to try a different approach. After some tweaking (angelscript is movin /usr/local/include ln away) I run the installation of gamecon from retropie script.

It downloaded kernel headers 3.18.7-v7+ and make everything but I'm finding a problem already mentioned in some posts:

Code: Select all

sudo modprobe gamecon_gpio_rpi map=0,0,0,7
ERROR: could not insert 'gamecon_gpio_rpi': Exec format error
and from var/log/kern.log:

Code: Select all

gamecon_gpio_rpi: no symbol version for module_layout
I've done depmod -a and dpkg-reconfigure gamecon-gpio-rpi-dkms but no success.

Should I try with different headers?

Thanks!!

esbiete
Posts: 6
Joined: Wed Mar 11, 2015 7:19 am

Re: Multi-console gamepad driver for GPIO

Sun Mar 15, 2015 7:02 pm

esbiete wrote: It downloaded kernel headers 3.18.7-v7+ and make everything but I'm finding a problem already mentioned in some posts:

Code: Select all

sudo modprobe gamecon_gpio_rpi map=0,0,0,7
ERROR: could not insert 'gamecon_gpio_rpi': Exec format error
and from var/log/kern.log:

Code: Select all

gamecon_gpio_rpi: no symbol version for module_layout
I've done depmod -a and dpkg-reconfigure gamecon-gpio-rpi-dkms but no success.

Should I try with different headers?

Thanks!!
I answer myself ;) After rpi-update to 3.18.9-v7+ and a re-install everything is fine, symbols found :)

Now let's get that PSX pad running. Tx!

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Mon Mar 16, 2015 3:19 am

Gamecon drivers failed to install. Any idea why? and what i can do?

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Mon Mar 16, 2015 4:14 am

New gamecon log after it failed to update. Already did

Code: Select all

sudo apt-get update

Code: Select all

sudo apt-get upgrade

Code: Select all

sudo rpi-update
http://pastebin.com/QzMKz1VR

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Mon Mar 16, 2015 6:25 am

driftking96 wrote:New gamecon log after it failed to update. Already did

Code: Select all

sudo apt-get update

Code: Select all

sudo apt-get upgrade

Code: Select all

sudo rpi-update
http://pastebin.com/QzMKz1VR
Was your Pi connected to Internet while you installed the drivers? The server could also have been down momentarily. Try again and verify that wget downloads the files correctly in the log.

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Mon Mar 16, 2015 6:51 am

Yes my Pi was always connected. I checked my browser after it failed. And I did two installs and both failed. This log was the second one

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Mon Mar 16, 2015 8:44 pm

driftking96 wrote:Yes my Pi was always connected. I checked my browser after it failed. And I did two installs and both failed. This log was the second one
If you check the few first lines of the log, it shows that the download of this file failed due to server name lookup error. That could have been a temporary issue with your DNS, since there have been no reports on such issues before. If the problem persists, you can download the required files (earlier link plus gamecon) using another computer/network and then install them with dpkg.

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Tue Mar 17, 2015 12:15 am

marqs wrote:
driftking96 wrote:Where do I find and select the "Install multi-console gamepad drivers for GPIO" ? I did not see such option while installing.
The option is found under "Main menu" -> "SETUP (only if you already have run one of the installations above)".
Got it to work, thanks alot maarq really appreciate the help. I installed joystick, checked my logs, verified it and also i got modprobe to work as well. Now my only question is, is there any simple way for me to use an IDE like Geany and C++ as a programming language to read the input of the PS2 controller and send an output to the GPIO pins (not an output back to the PS2, just send an output to a seperate pin not connected to the PS2)?

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Wed Mar 25, 2015 4:16 am

How do you check if a PSX controller is working after installing the retropie setup and loading the drivers using modprobe?

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Wed Mar 25, 2015 10:13 am

driftking96 wrote:How do you check if a PSX controller is working after installing the retropie setup and loading the drivers using modprobe?
Install joystick package and run the test app:

Code: Select all

apt-get install joystick
jstest /dev/input/js0

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Thu Mar 26, 2015 1:47 am

This is what i got when i ran jstest with the PS2 controller hooked up to my Pi.

http://pastebin.com/V9Y0Yc46

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Thu Mar 26, 2015 7:49 am

driftking96 wrote:This is what i got when i ran jstest with the PS2 controller hooked up to my Pi.

http://pastebin.com/V9Y0Yc46
You're supposed to check if axis/button status values change when you press the buttons etc (the terminal window width should be maximized for better readability). However, it seems jstest reports a controller with 36 axis and 70 buttons - do you also have some other controller connected to Pi? In thet case, try /dev/input/js1 instead of /dev/input/js0.

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Thu Mar 26, 2015 11:25 pm

It looks like the jstest reads my usb transceiver as a controller but my controller which is clearly turned on and getting power from the Pi isnt detected.

Code: Select all

pi@raspberrypi ~ $ jstest /dev/input/js0
Driver version is 2.1.0.
Joystick (Microsoft Microsoft® Nano Transceiver v2.0) has 37 axes (X, Y, Z, Rx, Ry, Rz, Throttle, Rudder, Wheel, Hat0X, Hat0Y, Hat1X, (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null))
and 75 buttons (BtnThumbL, BtnThumbR, (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), Btn0).
Testing ... (interrupt to exit)
By the way i tried jstest with js1 and i got

Code: Select all

pi@raspberrypi ~ $ jstest /dev/input/js1
jstest: No such file or directory
And when i entered jstest /dev/input
i get

Code: Select all

pi@raspberrypi ~ $ jstest /dev/input
Driver version is 0.8.0.
jstest is not fully compatible with your kernel. Unable to retrieve button map!
Joystick (Unknown) has 2 axes and 2 buttons.
Testing ... (interrupt to exit)

jstest: error reading: Is a directory

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Thu Mar 26, 2015 11:45 pm

driftking96 wrote:It looks like the jstest reads my usb transceiver as a controller but my controller which is clearly turned on and getting power from the Pi isnt detected.

By the way i tried jstest with js1 and i got

Code: Select all

pi@raspberrypi ~ $ jstest /dev/input/js1
jstest: No such file or directory
Did you run modprobe before jstest? It should definitely add a new jsX node (where X is first free device number from 0 upwards) under /dev/input/ when the driver loads successfully. Check the few last lines of /var/log/kern.log to see if there are any issues.

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Thu Mar 26, 2015 11:50 pm

Just out of curiosity, do i run modprobe after every boot?

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Thu Mar 26, 2015 11:54 pm

driftking96 wrote:Just out of curiosity, do i run modprobe after every boot?
You can add the configuration line (e.g. "gamecon_gpio_rpi map=0,1,1,0") to /etc/modules to load it automatically on each boot.

driftking96
Posts: 20
Joined: Sun Mar 10, 2013 8:48 pm
Location: Scarborough, Ontario, Canada

Re: Multi-console gamepad driver for GPIO

Fri Mar 27, 2015 12:41 am

marqs wrote:
driftking96 wrote:Hey marqs, thanks for the reply, i will follow up on your instructions right now. What i meant by the last question was, can i connect the PS2 steering wheel to the Raspberry Pi 2, then use C++ to accept data from the PSX controller, in this case the steering wheel, via the GPIO pins, and produce an output that is dependent on the PSx input?
Yes, you can use joystick / libevdev APIs, or some higher-level APIs such as SDL.
Can you either tell me or just point me in the right direction for me to get started with joystick, libedev or SDL please?

bcrawford
Posts: 20
Joined: Fri May 10, 2013 8:22 pm

Re: Multi-console gamepad driver for GPIO

Sat Mar 28, 2015 7:34 pm

Argh, I updated a pi1, rev2 and I'm getting the dreaded

Code: Select all

ERROR: could not insert 'gamecon_gpio_rpi': Exec format error
I followed the usual procedure,

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo reboot
sudo rpi-update
sudo reboot
Then I ran the following from the RetroPie-Setup:
-Updated RetroPie-Setup script
-Binary Installation
-Gamecon Driver

And that damn error is back. I checked the usual places for issues. No errors on the gamecon installation, headers appear to be in sync.

Any ideas?

bcrawford
Posts: 20
Joined: Fri May 10, 2013 8:22 pm

Re: Multi-console gamepad driver for GPIO

Sat Mar 28, 2015 8:44 pm

Still don't know what happened, but I removed the headers and the gamecon packages and reinstalled them by hand and everything is working again. :?

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Sun Mar 29, 2015 8:40 am

driftking96 wrote:
marqs wrote:
driftking96 wrote:Hey marqs, thanks for the reply, i will follow up on your instructions right now. What i meant by the last question was, can i connect the PS2 steering wheel to the Raspberry Pi 2, then use C++ to accept data from the PSX controller, in this case the steering wheel, via the GPIO pins, and produce an output that is dependent on the PSx input?
Yes, you can use joystick / libevdev APIs, or some higher-level APIs such as SDL.
Can you either tell me or just point me in the right direction for me to get started with joystick, libedev or SDL please?
SDL is probably easiest to start with, as it abstracts the low-level routines. There is a collection of useful links (tutorials etc.) at SDL wiki, and you can google for more. For example, this tutorial site's lesson 25 has examples on joystick handling in SDL.

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Sun Mar 29, 2015 8:51 am

bcrawford wrote:Still don't know what happened, but I removed the headers and the gamecon packages and reinstalled them by hand and everything is working again. :?
Hmm, did you check if you kernel version was updated in the fw update? I just noticed that the RetroPie script does not fetch a new headers package if you already have headers (with potentially old Module.symvers) for the running kernel.

bcrawford
Posts: 20
Joined: Fri May 10, 2013 8:22 pm

Re: Multi-console gamepad driver for GPIO

Sun Mar 29, 2015 1:46 pm

marqs wrote: Hmm, did you check if you kernel version was updated in the fw update? I just noticed that the RetroPie script does not fetch a new headers package if you already have headers (with potentially old Module.symvers) for the running kernel.
Very good point, I could see this causing issues in rare cases. I didn't think to check at the time, but this sounds like it is likely the cause. Thanks for the reply marqs and keep up the good work!

esbiete
Posts: 6
Joined: Wed Mar 11, 2015 7:19 am

Re: Multi-console gamepad driver for GPIO

Sun Mar 29, 2015 4:28 pm

I'm in the same problem after updating raspberry to 3.18.10-v7+ via rpi-update and running Retropie suto-setup.

I've done the dpkg-reconfigure without success, removed gamecon and reinstalled again, no success, always the "no symbol version for module_layout".

After manual remove of headers, download from your website and installation, everything run fine.

Regards,
EB

bcrawford
Posts: 20
Joined: Fri May 10, 2013 8:22 pm

Re: Multi-console gamepad driver for GPIO

Sun Mar 29, 2015 4:42 pm

Well, just in case anyone else runs into this issue and needs some help, here are the commands I ran to fix the issue:

Code: Select all

sudo dpkg -P linux-headers-*
sudo dpkg -P gamecon-gpio-rpi-dkms
sudo dpkg -P db9-gpio-rpi-dkms
I found multiple linux-headers so I removed all of them to be safe, but this may not be necessary. Once the packages have been purged(removed), you can run the install gamecon driver option from the RetroPie-Setup script and it should work again.

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Multi-console gamepad driver for GPIO

Wed Apr 01, 2015 8:56 pm

marqs wrote: I just noticed that the RetroPie script does not fetch a new headers package if you already have headers (with potentially old Module.symvers) for the running kernel.
This is now fixed in latest RetroPie.

Return to “Gaming”