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

Thread: Why does COM Port change with different Teensy?

  1. #1
    Member BradleyC's Avatar
    Join Date
    Mar 2018
    Location
    Houston Area
    Posts
    27

    Why does COM Port change with different Teensy?

    I'm using Windows 7-64. I have 2 Teensy 3.2 systems. When I plug in the first one, I get COM 4 for the Monitor. When I plug in the second one I get COM 6. The actual USB port in the Notebook never changes. Just the target. The port number is 'sticky' across restarts of Arduino.

    Therefore, I'm assuming that this behavior is intentional and beneficial so I expected to be able to see it discussed in the forum or documentation but search as I do, I have not found the explanation of the intended behavior to confirm it matches the observed behavior.

    My hypothesis: If both are connected at the same time (if this is even possible?) then it would be useful for them to have different ports so that two monitor screens could be used simultaneously, for example to debug a processor to processor communication (such as using CAN bus between them).

    So I'm hoping you can share the documentation URL or suggest where I can read about this.

    I'm new (~ 1 month part time experience) to both Teensy and Arduino but I'm an experienced (grey haired) software engineer.

    So forgive the noob question.

  2. #2
    What you see is a "Windows behavior" that has not much to do with Arduino or Teensy. Information about the Teensys is stored in the registry, I believe.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,350
    Paul posted a note about this it seems in the last week - maybe two. Maybe in relation to td 1.42 beta or another related question.

    Indeed Windows ( others? ) see a device and associate it with a given 'virtual' port name for future use so that device once known will have some consistent reference point no matter where it plugs in.

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,620
    Standard windows behavior. That is when you plug in the Teensy, the USB subsystem, grabs the Serial# of the Teensy and more or less looks this up in it's tables and finds out what COM port to assign to it. That way you can plug in multiple such devices and have different programs configured for different com ports and the system will keep track of it for you...

    On the MAC I believe it creates a Serial device with the Serial# as part of it.

    On Linux, it creates a device /dev/ttyACMx where the x is a number starting at 0. So the first device you plug in (or is enumerated) that uses the ACM driver is assigned /dev/ttyACM0 the next /dev/ttyACM1... So if you plug in two Teensy boards it is sort of pot luck on which one is assigned 0 or 1 or 2... Normally I work around this on linux by using the udev rules stuff, but that is side issue...

  5. #5
    Junior Member
    Join Date
    Feb 2020
    Posts
    19
    I'm not getting the expected behaviour. I have two teensies connected, and they both show the same port:

    "hid#vid_16c&pid_0485 MIDI (teensy LC)"
    So when I upload a sketch to either one, it is going to both. Thoughts? Can I change these port names myself somehow?

    This is Windows 10....

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,661
    Quote Originally Posted by woodslanding View Post
    I have two teensies connected, and they both show the same port:

    "hid#vid_16c&pid_0485 MIDI (teensy LC)"
    That's HID emulating serial, used together with MIDI. It's not a COM port at all.

    When you choose "MIDI" (without Serial), the USB support is build with this HID interface, so use of Serial.print() in your program can still be seen in the Arduino Serial Monitor. It's HID, which is identified by these arcane ID numbers but not a normal COM port number. That's how HID works.


    So when I upload a sketch to either one, it is going to both. Thoughts?
    Teensy Loader can only upload to 1 board at a time.

    If you don't believe this, before you go any further I'd recommend doing a few experiments with the LED blink example (File > Examples > 01.Basics > Blink). Change the delays to 100, so you get a visually distinct fast LED blink. Upload it. You'll be able to easily see it was uploaded to only 1 board.


    Can I change these port names myself somehow?
    The simplest way: click Tools > USB Type and choose Serial+MIDI. Then when you upload to each Teensy, it will become an actual COM port where Windows assigns a distinct COM number.

  7. #7
    Junior Member
    Join Date
    Feb 2020
    Posts
    19
    Quote Originally Posted by PaulStoffregen View Post
    That's HID emulating serial, used together with MIDI. It's not a COM port at all.

    When you choose "MIDI" (without Serial), the USB support is build with this HID interface, so use of Serial.print() in your program can still be seen in the Arduino Serial Monitor. It's HID, which is identified by these arcane ID numbers but not a normal COM port number. That's how HID works.




    Teensy Loader can only upload to 1 board at a time.

    If you don't believe this, before you go any further I'd recommend doing a few experiments with the LED blink example (File > Examples > 01.Basics > Blink). Change the delays to 100, so you get a visually distinct fast LED blink. Upload it. You'll be able to easily see it was uploaded to only 1 board.

    The simplest way: click Tools > USB Type and choose Serial+MIDI. Then when you upload to each Teensy, it will become an actual COM port where Windows assigns a distinct COM number.
    Okay thanks for the quick response! My solution was to upload from two different computers.... unfortunately, the teensies are installed where I cannot see their leds, and one is very difficult to disconnect. But this has worked, and now each is named uniquely, and I can test them independently. Before, I'd end up with Drawbars(1) and Drawbars(2) or Pedals(1) and Pedals(2) in my host. Now I have Drawbars and Pedals as desired.

    Other problems now, but I'll put those in a different thread with an appropriate title.

Posting Permissions

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