LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-18-2019, 12:37 PM   #1
triley831
Member
 
Registered: Feb 2017
Posts: 34

Rep: Reputation: Disabled
UDEV Rule for Joystick/JS0


Good afternoon Community,

hoping someone can give some advice. We have a joystick running on a piece of equipment running RHEL 7.7 server that has software that looks for the joystick at JS0. However, something else on the system is grabbing js0 and leaving the Joystick to use JS1.

I was thinking I could write a udev rule to force the joystick to use JS0, but have a question related to the last parameter of the rule.

Using the "hwinfo --usb" command I can easily get the device path. So currently here is how my rule looks:

SUBSYSTEM=="net", ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb3/3-11/e-11.4/3-11.4.3/3.11.4.3:1.0/input/*", NAME=js0

Of course this rule isn't working to force the joystick on js0. I think the problem is with the end of my rule in that I used "NAME". I don't think I can use this parameter for js0. But I don't know how to describe (or if I can) in a udev rule, what js0 is.

THanks in advance for any info that can be provided
 
Old 10-18-2019, 11:24 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
I don't know if such a rule will work, but I note that you posted
Code:
NAME=js0
as part of your rule. The device name should be enclosed within quotes like this
Code:
NAME="js0"
 
1 members found this post helpful.
Old 10-18-2019, 11:43 PM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
BTW, is your joystick device USB-connected? If so, it might be possible to construct a rule using other attributes.

You should be able to get the joystick device (/dev/input/event<number>) using
Code:
xinput
then
Code:
xinput list-props <device-number>
From that udevadm can be used to get the device attributes eg assuming the joystick is /dev/input/event12...
Code:
udevadm info -a -n /dev/input/event12
 
1 members found this post helpful.
Old 10-19-2019, 12:04 AM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Returning to your opening post where you mentioned
Quote:
We have a joystick running on a piece of equipment running RHEL 7.7 server that has software that looks for the joystick at JS0. However, something else on the system is grabbing js0 and leaving the Joystick to use JS1.
You should be able to identify the device via dmesg eg
Code:
dmesg|grep input
and perhaps
Code:
udevadm -a -n /dev/js0
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange USB device behaviour - /dev/input/js0 is dead. DevID: 068e:00a6 tmcki Linux - Hardware 1 10-15-2012 06:35 AM
Off-brand Gamepad Controller - no /dev/input/js0 tuxdelux Linux - Hardware 0 07-12-2009 02:19 PM
/dev/input/js0 not appearing headrift Linux - Games 2 08-10-2008 06:45 PM
xbox contoller detected but does not make /dev/input/js0 sonicbhoc Linux - Games 0 09-23-2006 03:29 PM
/dev/js0 as second mouse ty pe input device in Xfree86 frieza Linux - Software 0 05-24-2004 11:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration