Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Teensy 3.2: USB HID simple example updates?

  1. #1
    Senior Member
    Join Date
    Oct 2015
    Location
    Roma (IT, EU)
    Posts
    360

    Teensy 3.2: USB HID simple example updates?

    Hello,
    I'm trying to send simple USB messages from Teensy 3.2 (in USB HID mode) to a Linux PC.

    I'm following this sample:
    https://www.pjrc.com/teensy/usb_debug_only.html
    but since it's obsolete (as per web page), I actually used the sample sketch under "Teensy -> USBRawHID -> basic"
    I'm running Teensyduino 1.44 and Arduino IDE 1.8.5.

    On the Linux PC (Debian 8, kernel 3.16) I'm running this (recompiled from source):
    https://www.pjrc.com/teensy/hid_listen.html

    I see the Teensy USB HID device properly detected from Linux kernel:

    Code:
    13978.907046] usb 2-2.1: new full-speed USB device number 5 using uhci_hcd
    [13979.160640] usb 2-2.1: New USB device found, idVendor=16c0, idProduct=0486
    [13979.160644] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [13979.160646] usb 2-2.1: Product: Teensyduino RawHID
    [13979.160647] usb 2-2.1: Manufacturer: Teensyduino
    [13979.160648] usb 2-2.1: SerialNumber: 1215370
    [13979.180408] hid-generic 0003:16C0:0486.0004: hiddev0,hidraw1: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:02:00.0-2.1/input0
    [13979.207723] hid-generic 0003:16C0:0486.0005: hidraw2: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:02:00.0-2.1/input1
    but "hid_listen" does not detect any device:

    Code:
    sudo ./hid_listen 
    Waiting for device:...............................
    Maybe the server code needs to be updated, being no longer "in sync" with the IDE sample sketch?

    Thank you for any hint,

    Fernando

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,453

  3. #3
    Senior Member
    Join Date
    Oct 2015
    Location
    Roma (IT, EU)
    Posts
    360
    [Unfortunately, not even that code works: "No rawhid device found" :-(
    (note: to build it, package "libusb-dev" is needed on Debian)]

    It works now!
    It just works differently from hid_listen. The latter waits patiently for a device to connect, while rawhid_test has to be launched while the HID Teensy is already connected. :-)
    It also has to be started with "sudo".

    Thanks Paul!

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,207
    Did you install the udev rules? More instructions as well as the file can be found on the installation page: https://www.pjrc.com/teensy/td_download.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •