Need to understand Teensy ports.

Status
Not open for further replies.

jsureke

Member
Hi,

I don't really know how to correctly explain this or the right question(s) to ask.
Hopefully, there's someone smarter than me who knows what I'm trying to figure out.

I am having issues getting my different XPlane controllers to play nice together.
There seems to be a COM port conflict somewhere, because I have a device that won't properly initialize when my Teensy 3.5 boards are active.

From what I can tell, it reaches out for whatever com port is available. It generally grabs something like COM 19 or COM 21.

If I launch XPlane and allow it to find this device, I can then connect my Teensy controllers and all is fine.
I would very much like to not have to do that. I just want to turn on the USB hub that everything plugs into and be done with it.

When I look in the Arduino IDE, I see that both of my Teensy boards reference the same Teensy port name.
(There are also 3 lines that say COM 16 which is quite curious.)
What I don't understand is how to tell what hid#vid_16c0&pid_0488 is or what serial port it is on.


Thanks,
John
 
When I look in the Arduino IDE, I see that both of my Teensy boards reference the same Teensy port name.
(There are also 3 lines that say COM 16 which is quite curious.)
What I don't understand is how to tell what hid#vid_16c0&pid_0488 is or what serial port it is on.

Any chance you could take a screenshot of the Tools & Ports menu, so we can see the same thing you're seeing? Small details sometimes matter...
 
This is what the Tools & Ports menu looks like:
temp.png
As I mentioned, everything works fine, but I have to wait until the other device gets recognized before connecting these.
 
These ports are HID protocol. They're not serial protocol.

If you're accustomed to Arduino's "everything must be a serial port" model, well, this can seem a little foreign. There are lots of different types of hardware other than serial ports, and Teensy can act as those depending on what you've selected in the Tools > USB Type menu.

HID means Human Interface Device. It's meant for things like your keyboard, mouse, joystick, and pretty much anything else which takes human input and sends it to your computer. HID doesn't use port numbers like serial. The intended model is it's all just human input. For example, if you plug 2 keyboards into your PC, you can type on either and programs just see a stream of keystrokes without concern for which device actually transmitted them.

The TeensyControls plugin for X-Plane follows this general model. It opens every HID device which identifies itself as the Teensyduino flight controls. All X-Plane datarefs they publish are treated equally, without regard for which device.

Those numbers you see in the Tools > Ports menu are the USB vendor and product ID numbers. They don't uniquely describe a port. Windows doesn't give any concise name or number for each HID interface (as Linux does) so there simply isn't much Teensyduino can do to show you anything uniquely identifying about each device. The best it can do is show you 2 devices were detected, with those identifying ID numbers which indicate what the device is, but don't give any distinction about which is which instance.

If you select one, or anything else in the "Teensy Ports" part of the Tools > Port menu, you may notice the info in the lower right corner of the Arduino window changes. You ought to see something ending in a path-like list of numbers, such as "10431/0/3/2/1". Then if you select something from the "Serial ports" part of the Tools > Ports menu, you'll see if ends with a traditional serial port name like COM16. Because Teensy implements by Serial and non-Serial protocols, starting with Teensyduino 1.42 we began using that path-like list (on Windows - other ways on done on MacOS and Linux where the operating system provides better mechanisms to reference hardware). The list of numbers represents a physical USB port. The first number represents a PCI location for the USB host controller in your PC, then each number is the port on that controller or a connected USB hub. This is done so you can select a port in that menu and you really are selecting the physical location on your PC. Then if you change Tools > USB Type and reprogram Teensy to become a completely different kind of USB device, it stays properly selected because we're referencing the physical location.

FWIW, before Teensyduino 1.42, if your Teensy was running in a non-serial mode, it wouldn't show up in the Tools > Ports menu at all. But the upload process would automatically search for any Teensy it could find. If you had more than one, you couldn't choose which to upload. Back then, using more than 1 Teensy in non-serial mode required using Verify and then pressing the pushbutton on the board you meant to program. A lot of work went into Teensyduino 1.42 to make Arduino's menu handle non-serial devices. But ultimately we're limited by whatever the underlying operating system provides, and I'm sad to say Microsoft Windows just doesn't give nice concise and clear device instance names or numbers for modern things like HID.

Maybe that's more than you ever wanted to know about USB device identification?
 
Status
Not open for further replies.
Back
Top