USB not detected

Status
Not open for further replies.

johnh

Member
I am using a Teensy LC an an HID Keyboard. This works fine in most devices. I am trying to use it in an EPSON printer (as an HID Keyboard card reader) but it is not detected as a device. Other HID devices seem to work fine in the printer including keyboards, card readers etc. If I put the Teensy into program mode (pressing the button) it is detected by the printer but of course is not running my code!

Any ideas/suggestions?

Thanks,

John
 
I have check a device which works on the printer and in device manage it shows as a single usb input device (where the Teensy shows as 3 input devices). I'm not sure it will make any difference but is this something I can change for the Teensy?

John
 
You might need to edit usb_desc.h to customize the USB descriptors. By default, even the keyboard only option in Tools > USB Type still includes an extra HID interface to emulate serial, so you can use Serial.print().

Windows, Linux, Macintosh and all modern PC bios are able to properly detect USB composite devices having multiple HID interfaces and ignore the extra HID interface they don't understand. But perhaps the code inside this printer is not so savvy?

You can delete the extra interface by just commenting out some of those lines and editing a few numbers. See the comments in that file for instructions. Of course, what this printer will actually detect involves some guesswork.
 
Thanks Paul. I will try and have a go at it. Is the code which initialises the usb for the bootloader (when the reset button is pressed) very different to the startup for programs?

We are using 2 Teensies as a serial to USB keyboard device and it has been a pleasure to work with.

I also had problems with RC522 readers locking attached to a Raspberry PI, moved the reading to a Teensy with a watchdog and no more problems!

Thanks!
 
I managed to make the changes but unfortunately it is not seen.

It is odd that it is detected when the bootloader button is pressed. Does that run at a different speed?
 
I managed to make the changes but unfortunately it is not seen.

It is odd that it is detected when the bootloader button is pressed. Does that run at a different speed?

It’s not about different speeds, it’s about different profiles. Before going into deeper details, you should acquire more basic knowledge by googling and studying the USB specifications, profiles and protocols. To make it somewhat simpler: An USB device can present itself in different ways to its host, like a guy using different business cards. Then, not every host is able to read all possible variants of business cards depending on his firmware, and even if he reads, there is no warranty that he will let you in.
That’s a complex thing of fitting key and lock on both sides.
To diagnose and debug such USB communication problems, you need a bunch of theoretical knowledge and an USB protocol sniffer, too.
 
Thanks for the reply and advice - it is very helpful. I will use a protocol sniffer to compare the startup sequence of a keyboard (which is detected) and the Teensy (which is not).
 
I managed to get it working. I got an analayzer and saw that I had to simplify the descriptor to remove the "KEYMEDIA_INTERFACE". I had to fix up a missing ifdef in usb_keyboard.h but after that it worked like a dream.

Thanks again for your help and advice.
 
Status
Not open for further replies.
Back
Top