1

I'm currently writing a tool that automatically detects connected arduinos and provides a one-button solution for flashing new firmware. I've got a couple of arduinos at home (Diecimilla, Uno R3 SMD and some nanos from china) and each type presents with a different serial port name.

Questions

  • Can someone explain where these port names come from?
  • Can I assume that /dev/cu.usbserial-A9UPDRZB is, atleast in most cases, an arduino nano?
  • Are there other ways to identify the type of the board?
  • Is the name of the serial port some kind of hash generated from informations retrieved from the device?
7
  • 2
    They come from your OS. Commented Dec 16, 2014 at 7:00
  • You might get a lot of useful information from this question arduino.stackexchange.com/questions/3680/… Commented Dec 16, 2014 at 7:05
  • Thanks, but this doesn't really answer my questions. Commented Dec 16, 2014 at 7:28
  • It does tell you where you can find them though. Commented Dec 16, 2014 at 8:12
  • It doesn't. It tells me where to get more information about the connected hardware. But that doesn't answer the questions about how the names are generated. Commented Dec 16, 2014 at 8:16

1 Answer 1

4

You cannot assume anything about serial port names. It's a choice of the operating system, and even if you find the algorithm, there's no guarantee it won't change in the future.

As a reference implementation, the Arduino IDE 1.5.x uses VID (Vendor ID) and PID (Product ID) to identify a board.

Because accessing such information depends on the underlying operating system, the IDE uses three strategies: on windows, it runs a program called ListComPorts.exe, on macosx it uses CLI tool /usr/sbin/system_profiler, on linux CLI tool udevadm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.