Teensy as USB Keyboard for Raspberry Pi

Status
Not open for further replies.
I have connected a joystick and button to my teensy and have loaded an arduino sketch to it to take button presses/joystick movement and translate it into keystrokes. This works great on my Mac, but the Raspberry Pi doesn't pick up any input from the controls when the Teensy is plugged into it. I programmed it so that when a button is pressed the LED on the teensy lights up for debugging purposes. The light illuminates when plugged into the Pi so I know that I am receiving power. Also I can see the teensy being plugged in via /var/log/messages.

Code:
Aug  7 19:04:18 pi kernel: [ 1391.391166] usb 1-1.2: new full-speed USB device number 10 using dwc_otg
Aug  7 19:04:18 pi kernel: [ 1391.503738] usb 1-1.2: New USB device found, idVendor=16c0, idProduct=0487
Aug  7 19:04:18 pi kernel: [ 1391.503774] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug  7 19:04:18 pi kernel: [ 1391.503790] usb 1-1.2: Product: Serial+Keyboard+Mouse+Joystick
Aug  7 19:04:18 pi kernel: [ 1391.503804] usb 1-1.2: Manufacturer: Teensyduino
Aug  7 19:04:18 pi kernel: [ 1391.503817] usb 1-1.2: SerialNumber: 12345
Aug  7 19:04:18 pi kernel: [ 1391.507711] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
Aug  7 19:04:18 pi kernel: [ 1391.520474] input: Teensyduino Serial+Keyboard+Mouse+Joystick as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.2/input/input18
Aug  7 19:04:18 pi kernel: [ 1391.523294] hid-generic 0003:16C0:0487.0015: input,hidraw0: USB HID v1.11 Keyboard [Teensyduino Serial+Keyboard+Mouse+Joystick] on usb-bcm2708_usb-1.2/input2
Aug  7 19:04:18 pi kernel: [ 1391.534345] input: Teensyduino Serial+Keyboard+Mouse+Joystick as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.3/input/input19
Aug  7 19:04:18 pi kernel: [ 1391.536611] hid-generic 0003:16C0:0487.0016: input,hidraw1: USB HID v1.11 Mouse [Teensyduino Serial+Keyboard+Mouse+Joystick] on usb-bcm2708_usb-1.2/input3
Aug  7 19:04:18 pi kernel: [ 1391.550702] input: Teensyduino Serial+Keyboard+Mouse+Joystick as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.4/input/input20
Aug  7 19:04:18 pi kernel: [ 1391.554096] hid-generic 0003:16C0:0487.0017: input,hidraw2: USB HID v1.11 Joystick [Teensyduino Serial+Keyboard+Mouse+Joystick] on usb-bcm2708_usb-1.2/input4

Am I missing something to have the keys send to the Pi?
 
To get started, try using File > Examples > Teensy > USB_Keyboard > Buttons. There are lots of comments in the code to explain how it works.
 
I uploaded that sketch to my teensy and tested it on my computer, worked as expected. Plugged directly into my Pi and no output was generated.
 
Can't get Teensy 3.1 to work as USB HID device

I uploaded that sketch to my teensy and tested it on my computer, worked as expected. Plugged directly into my Pi and no output was generated.

I have the exact same thing going on. Tried a simple teensy program on multiple PCs to generate a single keypress + release and it works fine; moved teensy to Pi and nothing.

Any findings from the previous post?
 
I ran in to something similar before. Is the Teensy plugged directly into the Pi or a powered hub? I found that the USB ports on the Raspberry Pi Model B I was using didn't provide enough power to the teensy but when I used a powered hub the Teensy worked as expected.
 
Status
Not open for further replies.
Back
Top