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

Thread: Serial Port teensy Identification/Recognize

Hybrid View

  1. #1
    Junior Member
    Join Date
    Mar 2020
    Location
    Italy
    Posts
    17

    Serial Port teensy Identification/Recognize

    Hi,
    i'm working on a project using teensy3.2 and teensy4.0 that comminicate with a PC, i'm trying with Windows 10.

    Everything work fine but I would to improve the Serial port identification.
    I'm using this project to conenct a VST to my teensy:
    https://github.com/cpr2323/juce_serialport

    I would to recognize which port is used by my Teensy. Now on my laptop I can use COM15 for teensy3.2 and COM5 for teensy4, but I guess that in other pc with other connected device these port could be different.
    Now my teensy3.2 PORT for example seems to have just these information COM15 and USBSER000.

    So i'm looking for how to identify that on COM5 there is a teensy with my code!!

    Is it possibile? It's about Windows-side code or something else?

    Sorry but i'm not familiar with Serial Communication.

    Thk!!

  2. #2
    Senior Member
    Join Date
    Jan 2020
    Location
    Toscana
    Posts
    130
    I have no idea of Juce, but this could be a hint to search for the information:
    You could change the name of USB by usb_names.h and then use the Device Friendly Name https://docs.microsoft.com/en-us/win...ce-setup-class

  3. #3
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,118
    This is certainly possible see e.g. TeensySharp https://github.com/luni64/TeensySharp which is a c# library you can use to find all connected Teensies. It returns Board, Serialnumber and COM port of the found boards and detects newly connected or removed Teensies. However, it is not quite clear from your question if you

    1. want to do a stand alone tool spitting out that information or if you
    2. want to integrate the code into your juce framework which seems to be writtten in c++.


    1) can be done with TeensySharp in a couple of lines. If you head for 2) you probably need to dive into the SetupDI API. You'll find a lot of examples in the web. Here a pointer to the documentation: https://docs.microsoft.com/en-us/win...e-functions-dg. Basically you want to read the device properties (HardwareID / DeviceID) with SetupDiGetDeviceProperty. The IDs contain the VID/PID which you can use to identify the Teensy Boards. It also contains its serialnumber which can come in handy if you have more than one board connected.

    All in all this is quite tedious if you are not used to this kind of low level programming -> If possible use the high level approach with TeenySharp or any other library

  4. #4
    Junior Member
    Join Date
    Mar 2020
    Location
    Italy
    Posts
    17
    Thank you guys, your advices are really interesting.

    After a couple of day of study I decide to move to a more complete c++ serial lib that use friendly name.
    Similar to teensySharp.

    Thank

Posting Permissions

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