GAMEPAD problem

More
08 Dec 2012 14:14 #27403 by GM2012
GAMEPAD problem was created by GM2012
Hi
I hope someone at least can give me some tips what to do to make my USB gamepad get to life.

Ubuntu 8.04
Kernel Linux 2.6.24-16-rtai
Pentium 4, 2.4G

USB Gamepad - Logitech F310

I think I've read all I could find on the net related but not much of a help.

In general, when I plug in gamepad, I can see it in Device Manager (good that I've installed it, it is great help).
I've followed instruction to set it up manually:

cd /dev/input
sudo MAKEDEV js
sudo modprobe joydev (loaded different modules)

All I am trying to do is to use gamepad to run my desktop CNC finding that keyboard is not always the best for manual operation.
But I cannot get ANY signal from gamepad.

I know about small X-D switch on the back of gamepad. Only after few switching between X and D I get to see gamepad in device manager as

'POINTING DEVICE' , device file /dev/input/event4 - it changes from USB device to MOUSE

All other tests do not show any signal from gamepad. It works in WIndows, it is brand new.

I've used

jstest
cat
jscalibrator
evtest
od

evtest stops at line

Event type 4 (?)
Testing ... (interrupt to exit)
and it stays there

In jstest I see all axis and buttons but all is 0. Do not get any change when I move joysticks or buttons.

Also used halmeter, can see all pins, but no any change when I open any of pins (signals).

I know this is not enough information, but if anyone is willing and has knowledge I can show whatever is needed.

I am not versed in Linux, just using it to run EMC2 and was surprised to find out how difficult is to make something like gamepad to run.

thanks for reading

Please Log in or Create an account to join the conversation.

More
08 Dec 2012 15:09 #27405 by cmorley
Replied by cmorley on topic GAMEPAD problem
Well on thing you can try is running PNCconf.
PNCconf is a configuration for linuxcnc for Mesa products but one one page is a joystick option.
In that option it helps to do the basic set up and testing to see if the joystick will work.

On the third page (External Controls) there is a n option USB joystick Jogging.
check it and click on details.

You'll see add device, test device and search for rules.
click add device rule follow the prompts
you have to remember the device name and type it in the device name prompt (usually one word will do but make sure its fairly unique)
then click test device

If all goes well a hameter dialog will open with a bunch of pins showing click one and the meter should change when you push the right button.

Then at least you know it does work!

Please Log in or Create an account to join the conversation.

More
08 Dec 2012 16:07 #27408 by Rick G
Replied by Rick G on topic GAMEPAD problem

Please Log in or Create an account to join the conversation.

More
09 Dec 2012 00:25 #27419 by GM2012
Replied by GM2012 on topic GAMEPAD problem
thanks cmorley and RIck G. I'll check if I can do something with PNCconf -

Rick G: I've read simple pendant and after basically forsing Gamepad to be recognized (sudo MAKEDEV js) and connecting and disconnecting gamepad and flipping back X-D switch several times I see controller icon changes in device manager so I know system can see it.

When I do LESS ..... (as shown in Simple Remote Pendant) I get a similar output:

I: Bus=0003 Vendor=046d Product=c216 Version=0111
N: Name="Logitech Logitech Dual Action"
P: Phys=usb-0000:00:0d.2-4.1/input0
S: Sysfs=/devices/pci0000:00/0000:00:0d.2/usb5/5-4/5-4.1/5-4.1:1.0/input/input8
U: Uniq=9CB7CB73
H: Handlers=event4 js0
B: EV=1b
B: KEY=fff 0 0 0 0 0 0 0 0 0
B: ABS=30027
B: MSC=10

As I've said I don't know Linux in depth to make much of use of all of those numbers.
It is certainly fun to learn but not much time.

To add to this - after me started playing with gamepad my mouse doesn't function properly. It looks like buttons got mixed. After I plug mouse in and out it works fine. So something is crossed here - similar thing with gamepad, to make it visible (properly) I have to plug it in, unplug, and change X-D switch few times.
This looks like something to be resolved at system level ...
And I still do net get any signal from gamepad - axis are all 0 and buttons do not change state ...

Please Log in or Create an account to join the conversation.

More
09 Dec 2012 01:08 #27421 by Rick G
Replied by Rick G on topic GAMEPAD problem
Sounds like you have had to do a lot more than I ever did to get it to work.

Did you see this at the bottom of the page?

If your system won't recognize the joypad you might have to look at hal_input man page and perhaps modify the permissions to access the device. Prepared a one line file as per the description in the man page.

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

Name the file 51-plugdev.rules and save it in /etc/udev/rules.d


also

I believe as Chris stated PNCcnfg can create the rule for you.

Don't forget Halui

Rick G

Please Log in or Create an account to join the conversation.

More
09 Dec 2012 21:58 #27455 by gmouer
Replied by gmouer on topic GAMEPAD problem
Take a look at the hidcomp component. I used it for interfacing a shuttlexpress and a gamepad on my recent lathe retrofit and it makes interfacing usb devices pretty easy. Its a very powerfull tool for usb device interfacing.

Please Log in or Create an account to join the conversation.

More
10 Dec 2012 01:48 #27466 by GM2012
Replied by GM2012 on topic GAMEPAD problem
I am using 8.04 hardy:

PNCConf - is this available for 8.04? Couldn't find how to install.
hidcomp is ubuntu 10 -

Reluctant yet to upgrade to 10 -

Please Log in or Create an account to join the conversation.

More
10 Dec 2012 05:02 #27474 by BigJohnT
Replied by BigJohnT on topic GAMEPAD problem
Pncconf is not dependent on the Ubuntu version. It is included in LinuxCNC 2.5, I'm not sure if it is in 2.4 or not. Open a terminal window and type in pncconf and see if it pops up.

John

Please Log in or Create an account to join the conversation.

More
10 Dec 2012 07:20 #27481 by GM2012
Replied by GM2012 on topic GAMEPAD problem
Not knowing how to resolve this issue I've taken another spare PC and installed Ubuntu 10.4 and that moved me a bit.
Now I know I DO have output from gamepad (Logitech F310) since I can see it in

jstest

Again, having DEVICE MANAGER helps a lot since I can see gamepad there.

This time, device is shown as

Generix X-Box pad

and under properties I can see:

linux.device_file /dev/input/event5

Not 100% sure yet, but it made the difference at what USB connector I've connected gamepad. Again, not 100% sure that it matter.

Normally under windows, mode button, when pushed, would lit GREEN. This mode button is to swap hat and left joystick.
On other two PC (old ones) this LED would not always lit depending where I stick gampepad. Do not believe it has to do anything with power
consumption.

Now I got answer to my question how to install "Pncconf" - it comes with Live CD.

Now I am trying to add rule in udevs ...
Thanks again to all.
Once I finish, I'll try to submit for other Logitech users.

Please Log in or Create an account to join the conversation.

More
10 Dec 2012 19:49 #27501 by andypugh
Replied by andypugh on topic GAMEPAD problem
I think that the problem here might be that you are trying to install the joystick as a Ubuntu device, and you really want to install it as a LinuxCNC/HAL device.

I don't think joydev is part of the solution.

The instructions in wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Remote_Pendant ought to work. It sounds like you have an identical joypad to the example!

To test with the simplest possible system, open a terminal and type

halrun

You will then get a halcmd prompt, and type

halcmd> loadusr -W hal_input -KRAL Dual

Then

halcmd> show pin

If you get a nice list of joypad pins, then all is well, and you can use those pins in the HAL file, as described, to perform specific LinuxCNC actions.
If you get an error after the loadusr line, or there are no pins, then you probably need to setup the plugdev rules, though as is is showing up in /proc/bus/devices this is unlikely to be a problem in your case.

My impression is that you haven't got as far as trying to add the joystick to your HAL config yet, and are expecting it to work as a jog device as if it were emulating cursor keys.

Please Log in or Create an account to join the conversation.

Time to create page: 0.153 seconds
Powered by Kunena Forum