[Home]HereIsHowToCheck

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Difference (from prior author revision) (major diff, minor diff)

Changed: 1c1

hal_joystick has been depreciated from EMC 2.4



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

Changed: 3,4c3,22
First open a terminal.
Type:

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:

Changed: 8c26
now, after you've plugged your joypad, load the hal_joystick component (I will assume that the address of your joypad is /dev/input/js0, the default if you have only one joypad attached):
Now, after you've plugged your joypad, load the hal_input component with the correct input specification from step 1.

Changed: 10c28
halcmd: loadusr hal_joystick -d /dev/input/js0 -p joypad
halcmd: loadusr -W hal_input -KRAL Dual

Changed: 12c30
now we load one halmeter to check the axes values:
Now we load one halmeter to check the axes values:

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

Changed: 18c36
upload:select.jpg
upload:select.png

Changed: 20c38
select the first axis, and click apply; now you should see the little halmeter window shoving the value for that axis:
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:

Changed: 22c40
upload:meter.jpg
upload:meter.png

Changed: 25c43,64
You can check all other axes if ou want, however if the first outputs the right values, others should do the same. If things are not that good, you could try to calibrate your joypad using jscal (install the package joystick from synaptic)
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




Changed: 27c66
[BACK]
This is the joypad I used

Added: 28a68
upload:LogitechF310.jpg

Added: 29a70
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.

Added: 30a72,78
Axes Pin Names
* hat0x - Discrete pad.
* hat0y - Discrete pad.
* x - Right joystick.
* y - Right joystick.
* z - Left joystick.
* rz - Left joystick.

Added: 31a80,92
Button Pin Names
* top2 - Front left top.
* pinkie - Front right top.
* base - Front left bottom.
* base2 - Front right bottom.
* base3 - "9" or "BACK" depending on vintage.
* base4 - "10" or "START".
* base5 - Left joystick press.
* base6 - Right joystick press.
* joystick - "1" or "X".
* thumb - "2" or "A".
* thumb2 - "3" or "B".
* top - "4" or "Y"

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 8:54 pm by JTrantow (diff)
Search:
Published under a Creative Commons License