Solved Flightgear can't see Thrustmaster Joystick

I can't tell if it's a FreeBSD or Wayland related issue:

FlightGear 3.19 from ports
sway 1.9 from ports
FreeBSD 14.0-RELEASE, fresh install.

Flightgear/js_demo can't find the Joystick:
sudo dmesg | grep Joystick
hgame0: <Thrustmaster T.Flight Hotas X Joystick> on hidbus1

This is probably a pretty simple solution, but I'm missing something here and I can't see it.

Plug, unplug, reboot done.

Google didn't provide anything useful so far, including FreeBSD forums, which mostly cover issues like detection or calibration.

Any help would be much appreciated.
 
For an arcade stick I had to add a /usr/local/etc/devd/dashine.conf that sets the right permissions on the USB device. Or else it won't get detected and isn't usable. You might need something similar.

Code:
cat /usr/local/etc/devd/dashine.conf
notify 100 {
  match "system"        "USB";
  match "subsystem"     "INTERFACE";
  match "type"          "ATTACH";
  match "vendor"        "0x045e";
  match "product"       "0x028e";
  action "chgrp operator /dev/$cdev; chmod 660 /dev/$cdev";
};

This specifically looks for a matching vendor and product, then sets the group and permissions (my user is a member of the operator group).
 
FlightGear likely wants Linux-style evdev joysticks, so to complement SirDice's advice:
JSON:
$ cat /etc/devfs.rules
[localrules=10]
add path 'input/event*' group video

$ cat /etc/devd/hgame.conf
attach 200 {
    device-name "hgame[0-9]+";
    action "chmod g+rw `sysctl kern.evdev.input | awk -F: /$device-name/' { print $1 }' | sed 's,kern\.evdev\.input\.\([[:digit:]]*\)\.phys,/dev/input/event\1,'`";
};

$ sysrc devfs_system_ruleset=localrules
$ service devfs restart
$ service devd restart
$ usbconfig reset # or just detach/attach to trigger devd
 
For an arcade stick I had to add a /usr/local/etc/devd/dashine.conf that sets the right permissions on the USB device. Or else it won't get detected and isn't usable. You might need something similar.

Code:
cat /usr/local/etc/devd/dashine.conf
notify 100 {
  match "system"        "USB";
  match "subsystem"     "INTERFACE";
  match "type"          "ATTACH";
  match "vendor"        "0x045e";
  match "product"       "0x028e";
  action "chgrp operator /dev/$cdev; chmod 660 /dev/$cdev";
};

This specifically looks for a matching vendor and product, then sets the group and permissions (my user is a member of the operator group).
Thanks for the suggestion.
This is what I have but still no success:
cat /usr/local/etc/devd/hotas.conf
Code:
notify 100 {
  match "system"        "USB";
  match "subsystem"     "INTERFACE";
  match "type"          "ATTACH";
  match "vendor"        "0x044f";
  match "product"       "0xb108";
  action "chgrp operator /dev/$cdev; chmod 0660 /dev/$cdev";
};
 
FlightGear likely wants Linux-style evdev joysticks, so to complement SirDice's advice:
JSON:
$ cat /etc/devfs.rules
[localrules=10]
add path 'input/event*' group video

$ cat /etc/devd/hgame.conf
attach 200 {
    device-name "hgame[0-9]+";
    action "chmod g+rw `sysctl kern.evdev.input | awk -F: /$device-name/' { print $1 }' | sed 's,kern\.evdev\.input\.\([[:digit:]]*\)\.phys,/dev/input/event\1,'`";
};

$ sysrc devfs_system_ruleset=localrules
$ service devfs restart
$ service devd restart
$ usbconfig reset # or just detach/attach to trigger devd
Unfortunately both solutions didn't work.
❱ js_demo
Joystick test program.
~~~~~~~~~~~~~~~~~~~~~~
Joystick 0 not detected
Joystick 1 not detected
Joystick 2 not detected
Joystick 3 not detected
Joystick 4 not detected
Joystick 5 not detected
Joystick 6 not detected
Joystick 7 not detected

For testing purposes only, and to rule out a defective piece of hardware, I installed VirtualBox, attached the controller to the VM and I was able to detect it and configure it.
 
Back
Top