arduino / arduino/Arduino

Command line upload port option does not support symlinks

Open
#6,776 8 comments 1 reaction 0 assignees View on GitHub
Component: Uploading Type: Bug
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

- Arduino 1.8.4
- Linux (ARM ,Raspberry Pi 3)

Arduino is plugged in on the RPi:
```bash
$ ls -l /dev/serial/by-id/usb-Arduino*
lrwxrwxrwx 1 root root 13 sept. 30 23:51 /dev/serial/by-id/usb-Arduino_LLC_Arduino_Micro-if00 -> ../../ttyACM1
```

Compiling/upload with port = `/dev/ttyACM1` works:
```bash
arduino sketch.ino --port /dev/ttyACM1
Picked up JAVA_TOOL_OPTIONS:
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
Archiving built core (caching) in: /tmp/arduino_cache_94254/core/core_arduino_avr_micro_80d002210ad4f4c4b138a75ac18d4048.a
Sketch uses 6202 bytes (21%) of program storage space. Maximum is 28672 bytes.
Global variables use 396 bytes (15%) of dynamic memory, leaving 2164 bytes for local variables. Maximum is 2560 bytes.
Uploading...
$
```

But with port = `/dev/serial/by-id/usb-Arduino_LLC_Arduino_Micro-if00` it fails:
```bash
$ arduino sketch.ino --port /dev/serial/by-id/usb-Arduino_LLC_Arduino_Micro-if00
Picked up JAVA_TOOL_OPTIONS:
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
Archiving built core (caching) in: /tmp/arduino_cache_377862/core/core_arduino_avr_micro_80d002210ad4f4c4b138a75ac18d4048.a
Sketch uses 6202 bytes (21%) of program storage space. Maximum is 28672 bytes.
Global variables use 396 bytes (15%) of dynamic memory, leaving 2164 bytes for local variables. Maximum is 2560 bytes.
Uploading...
An error occurred while uploading the sketch
$
```

Seems to me that the problem is the port being a symbolic link.

Alternative
==

```bash
arduino sketch.ino --port $(readlink -f /dev/serial/by-id/usb-Arduino_LLC_Arduino_Micro-if00)
```

Contributor guide

Open the contributing guide

Research direction

Start with the command-line upload path exercised by `arduino sketch.ino --port`, comparing behavior for `/dev/ttyACM1` and the `/dev/serial/by-id/` symlink shown in the report. Reproduce on Linux with the Arduino Micro setup; done means uploads succeed when the port option is a symlink as well as when it is the resolved device path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli, embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.