LinuxCommandLibrary

pio

TLDR

Initialize new project

$ pio project init --board [uno]
copy
Build project
$ pio run
copy
Upload to board
$ pio run --target upload
copy
Monitor serial port
$ pio device monitor
copy
List boards
$ pio boards [search_term]
copy
Install library
$ pio pkg install --library "[library_name]"
copy
Run tests
$ pio test
copy
Check for updates
$ pio pkg update
copy

SYNOPSIS

pio [project] [run] [device] [pkg] [boards] [options] [args]

DESCRIPTION

pio (PlatformIO Core CLI) is a development platform for embedded systems. It supports hundreds of boards including Arduino, ESP32, STM32, and more.
Project initialization creates the directory structure and configuration. The platformio.ini file defines boards, frameworks, and dependencies.
Building compiles code for target platforms. Multiple environments can be defined for different boards or configurations.
Upload transfers firmware to connected devices. Serial monitor provides interactive communication for debugging.
Library management handles dependencies. Libraries are installed globally or per-project. The registry contains thousands of libraries.
Unit testing runs on embedded devices or host machines. This enables test-driven development for firmware.
VS Code integration through the PlatformIO IDE extension provides a full development environment.

PARAMETERS

project init

Initialize project.
run
Build project.
run -t upload
Upload firmware.
run -t clean
Clean build.
device monitor
Serial monitor.
device list
List devices.
boards [QUERY]
Search boards.
pkg install
Install package.
pkg update
Update packages.
pkg list
List packages.
test
Run unit tests.
-e ENV
Target environment.
-d DIR
Project directory.
-v
Verbose output.

CAVEATS

Large download for platform support. First build downloads toolchains. Some obscure boards may lack support. Configuration can be complex for advanced use.

HISTORY

PlatformIO was created by Ivan Kravets starting around 2014. It unified fragmented embedded development tooling, providing cross-platform, vendor-independent infrastructure for IoT development.

SEE ALSO

Copied to clipboard