This post will go over the setup I had to do to get my 8Bitdo NES30 Pro controller working on my Arch linux desktop with steam. This results in the system loading the xboxdrv automatically when the controller is connected, and unloading once finished.
fwupdmgr refresh
fwupdmgr get-updatessudo
fwupdmgr update
Firmware Update
The first thing to tackle was the firmware update on the controller, This may not be needed, but I like to keep my devices up to date.
After some googling, I was able to find a program called fwupd that's able to update the controller via a USB connection. It's available for Arch in the community repo.
The basic syntax of the command is:
fwupdmgr get-devicesfwupdmgr refresh
fwupdmgr get-updatessudo
fwupdmgr update
The controller will need to be put into 'Firmware update mode'. Be aware that the final command will also update all eligible firmware on your system, so If you don't want that, please dig into the documentation
Create a new service file /etc/systemd/system/nes30pro.service
[Unit]
Description=NES30 Pro controller driver daemon
Documentation=man:xboxdrv(1)
BindsTo=dev-btjoy.device
After=dev-btjoy.device
[Service]
User=root
PIDFile=/var/run/nes30pro.pid
ExecStart=/usr/bin/xboxdrv --pid-file /var/run/nes30pro.pid -c /etc/default/nes30pro --detach-kernel-driver --deadzone 4000 --deadzone-trigger 10%
[Install]
WantedBy=multi-user.target
edit the udev rule for the device, and append the following to the device line
, TAG+="systemd", ENV{SYSTEMD_WANTS}="nes30pro.service"
Bluetooth Connection
Getting the controller connected is basically a matter of following along with the Arch Wiki. To summarize:
install bluez bluez-utils bluez-plugins xboxdrv
enable bluetooth service
Connect to controller, get the name and uniq
grep NES -B1 -A9 /proc/bus/input/devices
install bluez bluez-utils bluez-plugins xboxdrv
enable bluetooth service
Connect to controller, get the name and uniq
grep NES -B1 -A9 /proc/bus/input/devices
Create the udev rule with the above info.
Xboxdrv mapping
I couldn't find a propper mapping for the controller, to Xboxdrv, so I created the following:
#8Bitdo NES30 Pro Config
[xboxdrv]
evdev-debug = true
evdev = /dev/btjoy
evdev-grab = true
rumble = false
mimic-xpad = true
silent = true
[evdev-absmap]
ABS_HAT0X = dpad_x
ABS_HAT0Y = dpad_y
ABS_X = X1
ABS_Y = Y1
ABS_Z = X2
ABS_RZ = Y2
[axismap]
-Y1 = Y1
-Y2 = Y2
[evdev-keymap]
# Map start and select
BTN_START=Start
BTN_SELECT=Back
# Map power to guide
BTN_C=Guide
# Map buttons to the printed key
BTN_SOUTH=A
BTN_EAST=B
BTN_NORTH=X
BTN_WEST=Y
# L1 R1 as Triggers
BTN_TL=LT
BTN_TR=RT
# L2 R2 as buttons
BTN_TL2=LB
BTN_TR2=RB
# Thumbs as thumbs
BTN_THUMBL=TL
BTN_THUMBR=TR
Put the above config into /etc/default/nes30pro
#8Bitdo NES30 Pro Config
[xboxdrv]
evdev-debug = true
evdev = /dev/btjoy
evdev-grab = true
rumble = false
mimic-xpad = true
silent = true
[evdev-absmap]
ABS_HAT0X = dpad_x
ABS_HAT0Y = dpad_y
ABS_X = X1
ABS_Y = Y1
ABS_Z = X2
ABS_RZ = Y2
[axismap]
-Y1 = Y1
-Y2 = Y2
[evdev-keymap]
# Map start and select
BTN_START=Start
BTN_SELECT=Back
# Map power to guide
BTN_C=Guide
# Map buttons to the printed key
BTN_SOUTH=A
BTN_EAST=B
BTN_NORTH=X
BTN_WEST=Y
# L1 R1 as Triggers
BTN_TL=LT
BTN_TR=RT
# L2 R2 as buttons
BTN_TL2=LB
BTN_TR2=RB
# Thumbs as thumbs
BTN_THUMBL=TL
BTN_THUMBR=TR
Auto Start/Stop on BT connect
Put the above config into /etc/default/nes30pro
Create a new service file /etc/systemd/system/nes30pro.service
[Unit]
Description=NES30 Pro controller driver daemon
Documentation=man:xboxdrv(1)
BindsTo=dev-btjoy.device
After=dev-btjoy.device
[Service]
User=root
PIDFile=/var/run/nes30pro.pid
ExecStart=/usr/bin/xboxdrv --pid-file /var/run/nes30pro.pid -c /etc/default/nes30pro --detach-kernel-driver --deadzone 4000 --deadzone-trigger 10%
[Install]
WantedBy=multi-user.target
edit the udev rule for the device, and append the following to the device line
, TAG+="systemd", ENV{SYSTEMD_WANTS}="nes30pro.service"
Problems encountered
The analogue sticks won't produce output
- I had to open the controller and detach, clean and reattach the ribbon cable.
No output for 60 seconds after connection
- this is a bug with xboxdrv. Patches exist but I'm just going to live with it.
Do people other than me read your blog? I liked your pascal press posts.
ReplyDelete