PDA

View Full Version : raw hid on linux



cmason
12-31-2012, 07:16 AM
Has anyone successfully used the hid_listen RAW hid (http://www.pjrc.com/teensy/hid_listen.html) serial console on linux? I'm trying to get it to work on a raspberry pi and hot having much luck. It works great on my mac.

I've tried the stock 1.0.2-beta 9 code with -DUSB_HID and this test program.


#include <stdlib.h>

#include "avr_functions.h"
#include "elapsedMillis.h"
int main(void)
{
pinMode(13, OUTPUT);

bool blink = 0;
while(1) {
Serial.println("hello");
Serial.flush();
digitalWrite(13, blink);
blink = !blink;
delay(1000);
}
}

This gives this lsusb output (http://pastebin.com/KABmvTfU) but the hid_listen (https://bitbucket.org/cmason/teensy3/src/tip/teensy/hid_listen/hid_listen.c?at=default) executable just says waiting... forever. The same hid_listen program compiled on the mac results in the expected hello output.

I do have CONFIG_HIDRAW=y in the kernel config. Are there other config options I need?

If someone can confirm if this works on regular desktop x86 linux, it would be most helpful.

Thanks,

-c

PaulStoffregen
12-31-2012, 08:05 AM
When you plug the Teensy in, does a new /dev/hidraw# device file appear?

Did you install the udev rules? Or just run hid_listen as root, so it always has permission to access the device.