Skip to content

Commit 25e7899

Browse files
committed
Improvements to arduino setup
1 parent e302978 commit 25e7899

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

arduino/.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"--network", "host",
3636
"-v", "/tmp/.X11-unix:/tmp/.X11-unix",
3737
"-e", "DISPLAY=unix${localEnv:DISPLAY}",
38-
"--device", "/dev/ttyACM0"
38+
"--device-cgroup-rule", "c *:* rmw"
3939
],
4040

4141
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.

arduino/Dockerfile.dev

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ RUN apt-get install -y build-essential
3333
ARG USER_UID
3434
ARG USER_GID
3535

36-
RUN groupadd --gid $USER_GID arduino && useradd --uid $USER_UID --gid $USER_GID --groups dialout --create-home arduino
36+
RUN groupadd --gid $USER_GID arduino && useradd --uid $USER_UID --gid $USER_GID --groups dialout,sudo --create-home arduino
37+
RUN echo "arduino:Mb921" | chpasswd
3738

3839
RUN wget -O /home/arduino/arduino-ide.AppImage https://downloads.arduino.cc/arduino-ide/arduino-ide_2.0.0-rc9.2_Linux_64bit.AppImage
3940
RUN chmod +x /home/arduino/arduino-ide.AppImage
@@ -42,7 +43,9 @@ COPY ./arduino-ide-initial-settings.json /home/arduino/.arduinoIDE/settings.json
4243
RUN chown -R arduino:arduino /home/arduino/.arduinoIDE
4344

4445
# https://github.com/Rahix/avr-hal
45-
RUN apt-get install -y avr-libc gcc-avr pkg-config avrdude libudev-dev
46+
RUN apt-get update && apt-get install -y avr-libc gcc-avr pkg-config avrdude libudev-dev
47+
48+
RUN apt-get install -y sudo
4649

4750
USER arduino
4851
WORKDIR /home/arduino

arduino/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Notes
2+
3+
- Arduino devices are usually mapped to `/dev/ttyACM0`
4+
5+
## Commands
6+
7+
- Add Arduino device after container has started
8+
- `sudo mknod /dev/ttyACM0 c 0 166`

0 commit comments

Comments
 (0)