Table of Contents

Logitech Gamepad

Installation

Install the following packages

sudo apt-get install joystick
sudo apt-get install jstest-gtk

Make sure the gamepad is in X-mode, run this command to check

dmesg | grep input

you should now see something similar to this somewhere

input: Generic X-Box pad as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input21

now open jstest-gtk to see the prot where the controller is installed. In this case

/dev/input/js0

The gamepad is now installed on the computer.

Permissions

Do the following steps:

  1. Add a new group
    sudo groupadd gamepad
  2. Add your user to the group
    useradd -G gamepad [username]
  3. Add the file joystick_acl_correction.sh to
    /etc/udev/
  4. Make joystick_acl_correction.sh executable
    sudo chmod a+x joystick_acl_correction.sh
  5. Add the file 80-local.rules to
    /etc/udev/rules.d/

    The udev-rule file is numbered 80 to make sure it is executed after /lib/udev/rules.d/70.udev-acl.rules

joystick_acl_correction.sh
#!/bin/bash
 
if [ -c /dev/input/js* ]; # -c is a character device - see http://tldp.org/LDP/abs/html/fto.html for option
then
	setfacl -m g:gamepad:rw- /dev/input/js* #for ACL see https://help.ubuntu.com/community/FilePermissionsACLs 
   	echo "Gamepad ACL permission set"
else
   	echo "No gamepad detected, ACL not set"
fi
80-local.rules
#This rule is to make the Logitec gamepad read/writeable for the normal user.
SUBSYSTEM=="input", ATTRS{name}=="Generic X-Box pad", GROUP="gamepad", MODE="0660", RUN+="/etc/udev/joystick_acl_correction.sh"

Running MobotWare with Gamepad

go to the folder

/home/phoenix/mobotware/phoenix/

open the file

rhdconfig.joy.xml

make sure the

<joystik port="/dev/input/js0" />

is set to the correct port.

Now start MobotWare

Starting mobotware