HID device drivers

OK, I’ll try that.

John Nagle
Team Overbot

Henry VanDyke wrote:

John Nagle <> nagle@overbot.com> > wrote in message
news:ccco9r$b0v$> 1@inn.qnx.com> …

OK, thanks.

Here’s the device, nonresponsive after a day of idle:

gcrear1$ ./usb
USB (UHCI) v1.10, v1.01 DDK

device 1 - descriptors - Input/output error



Ok.

Either the device is in a bad state or something is wrong in the USB stack.
I’ll try to reproduce it here. Could you verify that it happens overnight
with just the ‘hidview -a’ running ( Without the joystick driver running)
Also, if you have a usb mouse or keyboard you could plug it in as well
and see if it is still responsive when running hidiview/usb.


== unplugged USB cable and plugged it back in ==

gcrear1$ ./usb
USB (UHCI) v1.10, v1.01 DDK

Device Address : 1
Vendor : 0x046d (Logitech )
Product : 0xca03 (Logitech MOMO Racing )
Class : 0x00 (Independant per interface)

So either the device or the driver is in some bad state.
Any insights?

Inserting and removing the device brings it back up.
Restarting my application does NOT bring it back up. My
program gets an insertion event for the dead device when
the program is started, but never gets any other events.

“hidview -a” doesn’t produce any output from the device
when it’s in the “Input/output error” state.

John Nagle

Henry VanDyke wrote:

John Nagle <> nagle@downside.com> > wrote in message
news:cbustr$n5i$> 1@inn.qnx.com> …


This is still happening. And on at least one occasion,
the device seemed to stop responding.

There’s always the possibility that the joystick device
itself is having problems. Is there some way I can send
a command to the joystick that tests if it is responding?


You could run the usb utility. This will at least make sure the device
is responding.

Also try running ‘hidview -A’ . This will display the raw data coming
from the device.



What’s the easiest way to force an HID update event?
I need to do that at startup, anyway, to get the
initial position readings.


hidd_get_report()



John Nagle
Team Overbot

John Nagle wrote:



Another problem:

If my application is left idle for hours, with no HID activity,
new joystick activity DOES NOT result in input events. Unplugging
the device WILL result in a removal event. Plugging the device
back in WILL result in an insertion event, and thereafter it works.
I’ve seen this three times now, overnight.

Are there any long timeouts in the HID code? Please check.

John Nagle
Team Overbot






\

OK. This time, I plugged in two different joystick devices
into an otherwise-idle x86 QNX machine (QNX 6.2.1).
We get:

…/usb
USB (UHCI) v1.10, v1.01 DDK

Device Address : 1
Vendor : 0x046d (Logitech )
Product : 0xca03 (Logitech MOMO Racing )
Class : 0x00 (Independant per interface)

Device Address : 2
Vendor : 0x046d (Logitech)
Product : 0xc214 (Logitech Attack 3)
Class : 0x00 (Independant per interface)

Then I left the machine alone overnight, with ./hidview
running.

The next day, I log in remotely via ssh, and try “usb”.

…/usb
USB (UHCI) v1.10, v1.01 DDK

device 1 - descriptors - Input/output error

device 2 - descriptors - Input/output error

So the USB subsystem really is failing during long periods
of inactivity, and it’s not a defective joystick device.

John Nagle
Team Overbot

Either the device is in a bad state or something is wrong in the USB
stack.
I’ll try to reproduce it here. Could you verify that it happens overnight
with just the ‘hidview -a’ running ( Without the joystick driver running)
Also, if you have a usb mouse or keyboard you could plug it in as well
and see if it is still responsive when running hidiview/usb.

John Nagle wrote:



Another problem:

If my application is left idle for hours, with no HID activity,
new joystick activity DOES NOT result in input events. Unplugging
the device WILL result in a removal event. Plugging the device
back in WILL result in an insertion event, and thereafter it works.
I’ve seen this three times now, overnight.

Are there any long timeouts in the HID code? Please check.

John Nagle
Team Overbot






\

John Nagle wrote:

OK. This time, I plugged in two different joystick devices
into an otherwise-idle x86 QNX machine (QNX 6.2.1).

As an additional note, “hidtest” is still running, but hasn’t
printed anything overnight. It hasn’t noticed the devices
have failed.

We look forward to a fix. We’re getting close to running
our robot vehicle through this interface, and need it solidly
reliable.

John Nagle
Team Overbot

John Nagle <nagle@overbot.com> wrote in message
news:40F461B6.2040005@overbot.com

John Nagle wrote:
OK. This time, I plugged in two different joystick devices
into an otherwise-idle x86 QNX machine (QNX 6.2.1).

I tried running hiview -a overnight here on UHCI chipset

and it was working fine this morning.

As an additional note, “hidtest” is still running, but hasn’t
printed anything overnight. It hasn’t noticed the devices
have failed.

We look forward to a fix. We’re getting close to running
our robot vehicle through this interface, and need it solidly
reliable.

Have you tried 6.30 version of the drivers ?


John Nagle
Team Overbot

Henry VanDyke wrote:

John Nagle <> nagle@overbot.com> > wrote in message
news:> 40F461B6.2040005@overbot.com> …

John Nagle wrote:

OK. This time, I plugged in two different joystick devices
into an otherwise-idle x86 QNX machine (QNX 6.2.1).

I tried running hiview -a overnight here on UHCI chipset
and it was working fine this morning.


As an additional note, “hidtest” is still running, but hasn’t
printed anything overnight. It hasn’t noticed the devices
have failed.

We look forward to a fix. We’re getting close to running
our robot vehicle through this interface, and need it solidly
reliable.


Have you tried 6.30 version of the drivers ?

We’re still waiting for 6.30. But if you send
me a new driver to try, I’ll run it.

John Nagle
Team Overbot

We’ve been running our robot vehicle around using
the HID driver and the Logitech MOMO steering wheel.
See “http://www.overbot.com”.

This is still using QNX 6.21. We have QNX 6.3, and
we just put it on an expendable PC for testing.
We may switch over in a few weeks.

John Nagle

John Nagle wrote:

Henry VanDyke wrote:

John Nagle <> nagle@overbot.com> > wrote in message
news:> 40F461B6.2040005@overbot.com> …

John Nagle wrote:

OK. This time, I plugged in two different joystick devices
into an otherwise-idle x86 QNX machine (QNX 6.2.1).


I tried running hiview -a overnight here on UHCI chipset
and it was working fine this morning.


As an additional note, “hidtest” is still running, but hasn’t
printed anything overnight. It hasn’t noticed the devices
have failed.

We look forward to a fix. We’re getting close to running
our robot vehicle through this interface, and need it solidly
reliable.



Have you tried 6.30 version of the drivers ?


We’re still waiting for 6.30. But if you send
me a new driver to try, I’ll run it.

John Nagle
Team Overbot

I would like to send a simple command to a PMD-1208 from Measurement
Computing by using the QNX HID ddk.

I do not have the Windows DDK, but here is a code segment that should
send the report_id required & removed by Windows and a command to
blink a LED in the Windows based version:
.
.
typedef struct
{
unsigned char report_id;
unsigned char cmd;
} TOutReport;

TOutReport report;

report.report_id = 0;
report.cmd = 0x0b;

WriteFile (file_handle, (unsigned char *)&report,
sizeof(report),
&(bytes_sent, NULL);
.
.


Here is a Linux version segment fro Dr. Warren J. Jasper:

#define BLINK_LED (0x0B) // Causes LED to blink

int usbBlink(int fd)
{
__u8 cmd[1];

cmd[0] = BLINK_LED;

return PMD1208_SendCommand(fd, cmd, sizeof(cmd));
}


int PMD1208_SendCommand(int fd, __u8* vals, int num_vals)
{
int ret = CBUSB_SUCCESS;
int i;
struct hiddev_report_info out_report;
struct hiddev_usage_ref out_usage;

out_usage.report_type = HID_REPORT_TYPE_OUTPUT;
out_usage.report_id = 0;
out_usage.field_index = 0;
out_usage.usage_index = 0;
/* usage code for this usage */
ret = ioctl(fd, HIDIOCGUCODE, &out_usage);
if ( 0 > ret ) {
perror(“ioctl to get usage code for out report”);
return ret;
}

for ( i = 0; i < num_vals; i++) {
out_usage.usage_index = i;
out_usage.value = i < num_vals ? vals : 0;
ioctl(fd, HIDIOCSUSAGE, &out_usage);
}

out_report.report_type = HID_REPORT_TYPE_OUTPUT;
out_report.report_id = 0;
ioctl( fd, HIDIOCGREPORTINFO, &out_report );

/* this ioctl puts the report on the wire */
ioctl( fd, HIDIOCSREPORT, &out_report );
if ( 0 > ret ) {
perror(“ioctl to send output report”);
return ret;
}

usleep(20*1000);

return ret;
} // PMD1208_SendCommand()



Here are the questions:
Are there any examples using QNX to send data to the device?

Is the library mentioned previously still available?

I also believe that “button” in hidd_set_buttons( ) is what is used to
set
values, is this correct?


Any help would be appreciated.

Thanks,
Merle

:slight_smile: