question about teensy_gateway

Status
Not open for further replies.

liuhuan

Member
Dear friends,

When teensy ++ 2.0 is configured as sdcard+keyboard, I am able to receive data from teensy via the teensy_gateway program by listening to 127.0.0.1:28541.

The problem is that under Ubuntu Linux, I can no longer receive data from teensy if I remove and re-add the usbhid kernel module:

Code:
sudo modprobe -r usbhid # remove usbhid kernel module
sudo modprobe usbhid # add back usbhid kernel module

I have tried killing and restarting the teensy_gateway program after I re-add the usbhid module, but I still cannot receive data from teensy.

Another way to reproduce the problem is to unplug the teensy, and plug it back in. No data can be received after it's plugged back in.

I wonder if anyone could help me understand how teensy_gateway works, and/or point me to its source code so that I can take a look.

Thank you very much!

Huan
 
On Linux, teensy_gateway uses the hidraw driver. It tries to open the /dev/hidraw# devices. If you're configuring your kernel, make sure it has the hidraw driver. Also make sure other stuff (like usbfs) isn't claiming the interfaces which locks out drivers like hidraw from using them. The kernel log files often give useful info.
 
Thanks for the explanation, Paul!

From looking at kern.log, I can see that after Teensy is plugged back in, Teensy Disk/Keyboard is registered as generic-usb, input, hidraw2 and hidraw3 device. But not until I restart the computer, I cannot receive data from Teensy. In other words, teensy_gateway does not work after the device is unplugged.

Here's the kern log snippet:
Code:
Apr 18 01:35:02 devtmp kernel: [ 3226.516713] usb 2-1.5: new full speed USB device using ehci_hcd and address 13
Apr 18 01:35:02 devtmp kernel: [ 3226.630179] usb 2-1.5: configuration #1 chosen from 1 choice
Apr 18 01:35:02 devtmp kernel: [ 3226.630485] scsi10 : SCSI emulation for USB Mass Storage devices
Apr 18 01:35:02 devtmp kernel: [ 3226.630557] usb-storage: device found at 13
Apr 18 01:35:02 devtmp kernel: [ 3226.630559] usb-storage: waiting for device to settle before scanning
Apr 18 01:35:02 devtmp kernel: [ 3226.631255] input: Teensy Disk/Keyboard as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.1/input/input12
Apr 18 01:35:02 devtmp kernel: [ 3226.631412] generic-usb 0003:16C0:0484.0007: input,hidraw2: USB HID v1.11 Keyboard [Teensy Disk/Keyboard] on usb-0000:00:1d.0-1.5/input1
Apr 18 01:35:02 devtmp kernel: [ 3226.632652] generic-usb 0003:16C0:0484.0008: hidraw3: USB HID v1.11 Device [Teensy Disk/Keyboard] on usb-0000:00:1d.0-1.5/input2

Any idea?
 
Status
Not open for further replies.
Back
Top