[Home]HereIsHowToCheck

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

This page illustrates how to identify pins available on a hal_input joypad device.

Step 1 Identify your joypad

In a terminal window type:

less /proc/bus/input/devices

The output will look something like this:

 I: Bus=0003 Vendor=046d Product=c216 Version=0300
 N: Name="Logitech Logitech Dual Action"
 P: Phys=usb-0000:00:03.2-2/input0
 S: Sysfs=/class/input/input3
 H: Handlers=event3 js0
 B: EV=b
 B: KEY=fff 0 0 0 0 0 0 0 0 0
 B: ABS=30027

Don't proceed until you identify your joypad! You need to find a unique pattern in the output fields to specify your device. In my case I chose "Dual". See the Input Specification section of http://linuxcnc.org/docs/html/man/man1/hal_input.1.html for details.

Step 2 Check what's available on your joypad.

In a terminal window type:

  $ halrun 

Now, after you've plugged your joypad, load the hal_input component with the correct input specification from step 1.

  halcmd: loadusr -W hal_input -KRAL Dual

Now we load one halmeter to check the axes values:

  halcmd: loadusr halmeter

the little halmeter window should open, click on select and you will see all pins created by hal_input:

  upload:select.png

select the position of the desired joystick axis, and click on the position; now you should see the little halmeter window showing the position value for that axis:

  upload:meter.png

If it is 0 and you are not moving the joypad, everything is fine. Try to move your joypad in order to see which is the axis.0 You can check all other axes if you want, however if the first outputs the right values, others should do the same.

Permissions

If your system doesn't recognize the joypad you may need to modify the udev permissions to access the device. Prepared a one line file as per the description in the man udev.

new syntax:

ATTR{idProduct}=="c216", ATTR{idVendor}=="046d", MODE="0660", GROUP="plugdev"

old syntax:

SUBSYSTEM=="input", mode="0660", group="plugdev"

Save the file to the /etc/udev/rules.d directory. Now tell Ubuntu to reload udev rules by entering the following in the terminal window:

sudo udevadm trigger

Next, add yourself to the plugdev group.

 adduser $username plugdev

Logitech F310 Specific Absolute Axes and Button Pins

This is the joypad I used

upload:LogitechF310.jpg

The Logitech F310 supports 6 absolute axes and twelve buttons. See http://linuxcnc.org/docs/html/man/man1/hal_input.1.html for the full pin names for these axes and buttons.

Axes Pin Names

Button Pin Names


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited February 9, 2021 12:54 pm by JTrantow (diff)
Search:
Published under a Creative Commons License