Loading GPIO Joystick drivers on startup
-
I'm using GPIO Joysticks – when I load the driver after connecting via SSH to my Recalbox, I can load the driver:
mk_arcade_joystick_rpi map=1,2
After that, the joysticks work perfectly.
However, after rebooting, the driver is gone – unsurprisingly, as it isn't loaded on startup. I'd like to change that.
Unfortunately, this tutorial
https://github.com/recalbox/mk_arcade_joystick_rpi
doesn't do the trick for me. It does, for instance, assume
sudo
to exist on the system (which isn't the case for Recalbox), and also I do have the feeling that I'm stuck in 'read only' mode after ssh'ing to the system.
Any ideas are welcome! Thank you.
-
I did manage to mount the SD card of my RPi 3 in writeable mode add
mk_arcade_joystick_rpi
to
/etc/modules
and
options mk_arcade_joystick_rpi map=1,2
to
/etc/modprobe.d/mk_arcade_joystick.conf
. – but still the drivers do not load on startup. When I run
mk_arcade_joystick_rpi map=1,2
manually after start-up, it works –but it doesn't do that automatically. Any help would be appreciated. Thank you!
-
@fh1105 Read this, it may be out of date, but it should help with something:
https://recalbox.gitbook.io/documentation/tutorials/controllers/gpio/gpio-controls/gpio-joystick-driver-for-raspberry-pi -
Yes, these are exactly the steps I took ("Automatic loading at startup").
How can I run a script upon booting Recalbox?
-
@fh1105 Did you enable GPIO controllers in the recalbox.conf file?
# ------------ D2 - GPIO Controllers ------------ # ## GPIO Controllers ## enable controllers on GPIO with mk_arcarde_joystick_rpi (0,1) controllers.gpio.enabled=0 ## mk_gpio arguments, map=1 for one controller, map=1,2 for 2 (map=1,map=1,2) controllers.gpio.args=map=1,2 ## Custom mk_gpio arguments, ## controllers.gpio.args=map=5 gpio=Y-,Y+,X-,X+,start,select,a,b,tr,y,x,tl,hk for one controller, ## controllers.gpio.args=map=5 gpio=pin1,pin2,pin3,.....,pin12,pin13 ## controllers.gpio.args=map=5,6 gpio=Y-,Y+,X-,X+,start,select,a,b,tr,y,x,tl,hk gpio2=Y-,Y+,X-,X+,start,select,a,b,tr,y,x,tl,hk for 2 (map=5,map=5,6) ## controllers.gpio.args=map=5,6 gpio=gpiox,gpioy,gpioz,.....,gpiou,gpiov gpio2=gpiox,gpioy,gpioz,.....,gpiou,gpiov # where gpiox,gpioy,gpioz ... are NOT pin numbers on the connector, BUT location gpio numbered as in # https://www.raspberrypi-spy.co.uk/wp-content/uploads/2012/06/Raspberry-Pi-GPIO-Layout-Model-B-Plus-rotated-2700x900.png ## Set pin to -1 to disable it # controllers.gpio.args=map=5,6 gpio=4,17,27,22,10,9,25,24,23,18,15,14,2 gpio2=11,5,6,13,19,26,21,20,16,12,7,8,3 ## MCP configuration : GPIO and MCP can be used together. You can mix them. ## map=0x20,0x21 for 2 mcp23017 on i2c bus #controllers.gpio.args=map=0x20,0x21,5,6 gpio=4,17,27,22,10,9,25,24,23,18,15,14,-1 gpio2=11,5,6,13,19,26,21,20,16,12,7,8,-1
To start a script automatically with Recalbox, this is the tutorial, but I don't know if that's what you need:
https://recalbox.gitbook.io/documentation/v/francais/tutoriels/systeme/modification/ajouter-votre-propre-script-au-demarrage -
That solved it for me – I set it to GPIO enabled = 1 in the .conf file. Thank you very much, keep it up!