Mastodon Politics, Power, and Science

Saturday, November 21, 2026

Ditch the Heavy IDE: Setting Up arduino-cli and tio on Arch Linux / Omarchy Arm64


If you spend your day in a terminal—or you are running Linux on an ARM64 machine like a Snapdragon X Elite where the official Electron-based Arduino IDE 2 doesn't publish native builds—you don't need a bulky graphical editor to build, flash, and debug microcontrollers.
By pairing arduino-cli (Arduino’s official standalone command-line compiler and board manager) with tio (a lightweight, auto-reconnecting serial terminal), you get a fast, scriptable microcontroller workflow that fits right into Neovim, tmux, or a Makefile.
Here is how to install, configure, and use both tools on Arch Linux / Omarchy—including support for classic Arduino boards and the Raspberry Pi Pico (RP2040 / RP2350).

Step 1: Install arduino-cli and tio
Both packages are available directly in the official Arch repositories:
bash
sudo pacman -S arduino-cli
yay -S --noconfirm tio
Use code with caution.
  • arduino-cli handles board cores, library installation, compiling sketches, and flashing firmware over USB.
  • tio is a modern serial terminal built specifically for embedded development. Unlike screen or minicom, tio automatically reconnects the split second your microcontroller reboots after a flash—so you never lose early boot logs or have to restart your serial monitor.

Step 2: Grant USB Serial Port Permissions (uucp Group)
On Arch-based distributions, USB serial devices (/dev/ttyACM0, /dev/ttyUSB0) belong to the uucp group (rather than dialout as on Debian/Ubuntu). Add your user to uucp so you can flash boards without sudo:
bash
sudo usermod -aG uucp $USER
Use code with caution.
Log out and back in—or run newgrp uucp in your current terminal—to activate the group membership immediately.

Step 3: Initialize arduino-cli and Install Board Cores
Generate the default configuration file and update the package index:
bash
arduino-cli config init
arduino-cli core update-index
Use code with caution.
For Classic Arduino Boards (Uno, Nano, Mega)
Install the standard AVR toolchain:
bash
arduino-cli core install arduino:avr
Use code with caution.
For Raspberry Pi Pico / Pico W (RP2040 & RP2350)
Add Earle Philhower’s arduino-pico board manager URL, update the index, and install the core:
bash
arduino-cli config add board_manager.additional_urls \
  https://github.com

arduino-cli core update-index
arduino-cli core install rp2040:rp2040
Use code with caution.
(Tip: If you ever need to install third-party libraries, search and install them straight from the terminal with arduino-cli lib search <name> and arduino-cli lib install "<Exact Library Name>".)

Step 4: Detect Your Board, Compile, and Upload
Plug your microcontroller into USB and check which port and FQBN (Fully Qualified Board Name) it shows up under:
bash
arduino-cli board list
Use code with caution.
You will see output showing the serial port (such as /dev/ttyACM0) and the board's FQBN (for example, arduino:avr:uno or rp2040:rp2040:rpipicow).
Compile Your Sketch
bash
# For an Arduino Uno:
arduino-cli compile --fqbn arduino:avr:uno ./MySketch

# For a Raspberry Pi Pico W:
arduino-cli compile --fqbn rp2040:rp2040:rpipicow ./MyPicoProject
Use code with caution.
Flash Over USB
bash
# For an Arduino Uno:
arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:uno ./MySketch

# For a Raspberry Pi Pico W:
arduino-cli upload -p /dev/ttyACM0 --fqbn rp2040:rp2040:rpipicow ./MyPicoProject
Use code with caution.
(Note for first-time Raspberry Pi Pico flashes: Hold down the BOOTSEL button while plugging in the USB cable the very first time so it mounts as a mass-storage bootloader. Once flashed with an arduino-pico sketch, subsequent uploads reset and flash automatically over USB without touching the button.)

Step 5: Monitor Serial Output with tio
Once flashed, connect to the board’s serial console using tio:
bash
tio /dev/ttyACM0
Use code with caution.
(By default, tio connects at 115200 baud—which matches most modern serial sketches. If your sketch uses 9600 baud, pass -b 9600: tio -b 9600 /dev/ttyACM0.)
Essential tio Keyboard Shortcuts
All tio commands start with Ctrl + T:
  • Ctrl + T then Q — Quit tio cleanly and release the serial port.
  • Ctrl + T then L — Toggle logging serial output straight to a text file.
  • Ctrl + T then C — Clear the terminal screen.
  • Ctrl + T then ? — Show all built-in shortcuts.
The Two-Pane Workflow
The cleanest way to work is keeping tio /dev/ttyACM0 running continuously in one terminal pane while running arduino-cli compile and arduino-cli upload in a second pane (or from a Makefile). Every time you upload new firmware, tio briefly pauses while the USB port resets and immediately reconnects the moment your board boots—capturing your very first Serial.println() line every single time.

Bonus: Drop-In Makefile Template
Save this Makefile inside any sketch folder so building and flashing is just make upload:
makefile
FQBN = rp2040:rp2040:rpipicow
PORT = /dev/ttyACM0
SKETCH = .

build:
	arduino-cli compile --fqbn $(FQBN) $(SKETCH)

upload: build
	arduino-cli upload -p $(PORT) --fqbn $(FQBN) $(SKETCH)

monitor:
	tio $(PORT)
Use code with caution.

How to Tame a Folder Full of Accumulated Coding Projects on a New Machine

J. Rogers, SE Ohio

If you have been coding for a few years, you probably have a graveyard—or treasure chest—of dozens of repositories sitting on GitHub. Everything from weekend physics simulations and 3D mesh converters to half-finished web servers and IoT experiments.
Then you get a new laptop, clone all 30 repos into a fresh folder, and hit a wall:
  • Which version of Python did that project from three years ago use?
  • Which repos actually have a requirements.txt?
  • How do you set up isolated virtual environments for dozens of projects without spending your entire weekend typing python -m venv .venv and pip install over and over?
Here is a fast, modern workflow (using mise and uv) to audit, standardize, and spin up an entire directory of accumulated Python projects cleanly—so every project stays self-contained and reproducible on any machine.

Step 1: Give Every Project a .python-version File
A requirements.txt file tells Python which packages to install, but it doesn't tell your system which Python interpreter version the code expects. An older script might rely on Python 3.10 behavior, while a newer AI workflow wants Python 3.12 or 3.13.
The cleanest standard across modern developer tools is dropping a tiny .python-version file inside each project root. It is just a plain text file containing a single version number:
text
3.11
Use code with caution.
If you use mise (a modern runtime version manager), you can generate this file and install that exact Python version in one command inside any project folder:
bash
mise use python@3.11
Use code with caution.
Now, anytime you (or your tools) enter that folder, your environment immediately knows which Python version belongs there.

Step 2: Auto-Generate Missing requirements.txt Files
If you have older weekend projects that never got a requirements.txt, you don't need to manually read through dozens of .py files to figure out what you imported.
You can use pipreqs via uvx (which runs the tool temporarily without cluttering your global system) to scan a project's actual import statements and generate a clean requirements.txt automatically:
bash
cd ~/projects/MyOldProject
uvx pipreqs .
Use code with caution.
Do a quick sanity check on the generated requirements.txt to make sure package names look right (for example, ensuring cv2 mapped to opencv-python or PIL mapped to pillow), and commit both .python-version and requirements.txt to your repo. Once those two files live in Git, setting up that repo on any future computer takes seconds.

Step 3: Batch-Build Virtual Environments Across All Projects at Once
Once your projects have .python-version and requirements.txt files, you don't need to set up virtual environments one by one. Using uv (an ultra-fast Rust-based Python package and environment manager), you can loop through your entire projects folder and build every single .venv in one shot.
Run this from the parent directory holding all your repositories:
bash
for dir in */; do
  if [ -f "$dir/requirements.txt" ]; then
    echo "=== Setting up $dir ==="
    (cd "$dir" && uv venv && uv pip install -r requirements.txt)
  elif [ -f "$dir/pyproject.toml" ]; then
    echo "=== Syncing $dir ==="
    (cd "$dir" && uv sync)
  fi
done
Use code with caution.
What this loop actually does:
  1. Enters each folder safely: Wrapping the command in (cd "$dir" && ...) runs it in a subshell so it never loses its place in your parent directory.
  2. Reads .python-version automatically: uv venv detects the .python-version file inside each folder, fetches that exact Python interpreter if needed, and creates a standalone .venv/ directory.
  3. Installs dependencies at warp speed: uv pip install resolves and installs packages 10–50x faster than traditional pip, keeping every project completely isolated.
  4. Skips non-Python repos: Any C, Rust, or Go folders without a requirements.txt or pyproject.toml are safely skipped.

Step 4: Make .venv Activate Automatically When You cd
Having 30 isolated .venv folders is great, until you get tired of typing source .venv/bin/activate every time you jump between projects.
You can automate that too. Add this lightweight hook to your ~/.bashrc or ~/.zshrc:
bash
auto_venv() {
  if [[ -n "$VIRTUAL_ENV" && "$PWD" != "$(dirname "$VIRTUAL_ENV")"* ]]; then
    deactivate
  fi
  if [[ -z "$VIRTUAL_ENV" && -f ".venv/bin/activate" ]]; then
    source .venv/bin/activate
  fi
}

cd() {
  builtin cd "$@" && auto_venv
}
Use code with caution.
Now, the moment you cd into any project folder, its isolated virtual environment activates automatically—and deactivates the second you leave.

The Payoff
Spending 20 minutes adding .python-version and requirements.txt to your accumulated projects turns a messy folder of "stuff that only worked on my old laptop" into a clean, portable portfolio. Next time you switch machines, spin up a server, or revisit a project two years later, everything works on the first run.

Ditch the Heavy IDE: Setting Up arduino-cli and tio on Arch Linux / Omarchy Arm64

If you spend your day in a terminal—or you are running Linux on an ARM64 machine like a Snapdragon X Elite where the official Electron-based...