Trouble with Arduino - "Please select a port before upload"

Hi Jonathan,

Thanks for the response.

Sadly, I don’t think this is the solution. I had already installed exactly that driver from Adafruit. I reinstalled it nonetheless from the link you included above but it has not solved the issue. We need to keep digging.

Whilst we’re here talking about it, I’ve been trying to debug the issue myself. I’m not greatly familiar with the Arduino ecosystem but I’ve been digging into this for the last couple of hours and I’m following a definite line of enquiry. Here are some assumptions I’m making; you can tell me if I’m on the right track or not:

  • The Arduino IDE forks avrdude to upload the compiled sketch to the connected device; a Blink tile in this case.
  • The command line pattern used to fork avrdude is specified in platform.txt
  • When I attempt to upload the compiled sketch, the error I’m getting is “Please select a Port before Upload.” This suggests to me that the command line argument value for specifying the port to use is not being supplied to avrdude, such that a “-P” or “-p” without a port value is being passed to avrdude and avrdude is choking on it. So I’m guessing, if no -P (or -p) argument were passed to avrdude, it would default to using USB and just work. Either that or we should supply “-Pusb” or similar on the command line. If I’m right, we should be able to make this work by just tweaking the command line patterns in platform.txt
  • Bottom line; I’m guessing this problem only occurs on machines with no COM ports. On a machine with a COM port, the first time the IDE runs, it finds the first COM port and subsequently that always gets passed to avrdude in the {serial.port} variable, even though it’s not needed for USB comms. On a machine with no COM ports, {serial.port} never gets populated so avrdude chokes on a -P command line argument with no value.

Does any of this make sense or am I WAAAAY off track here?