Reputation: 21
On a Mac, Arduino devices like the Uno are identified as network interfaces, and are assigned a serial address of the form /dev/tty.usbmodem*. I am using a Java program that requires me to save in my file the address of the serial device I want to use. However, when I reboot my computer with the identical device connected, it sometimes assign the device a different serial address. Is there any way to specify either on my computer or my Arduino board that a specific board needs to always be assigned to the same serial address?
(Additionally, I can't simply use the address of whatever the first serial device connected to the system is, as I have multiple Arduino boards that do not stay in a consistent order when I list serial devices).
Thanks!
Upvotes: 2
Views: 386
Reputation: 3189
I've solved this problem by having a program (in my case C#) loop over all the available ports and send a handshake message ("HELLO').
Then On the arduino side I make my sketch respond with a "HELLO FROM ARDUINO01" message.
My program on the PC stops when if finds the arduino it is looking for and continues using that port.
Upvotes: 1