neulab/tldr huggingface dataset:
Example > platformio remote run --environment uno --target upload
platformio remote test Helper command for remote unit_testing.
Contents • platformio remote test
Usage platformio remote test [OPTIONS] pio remote test [OPTIONS]
# run tests on specified PIO Remote Agent platformio remote --agent NAME test [OPTIONS]
Description Run remotely tests from PlatformIO based project. More details about PlatformIO unit_testing.
This command allows you to apply the tests for the environments specified in projectconf.
Process specified environments. More details platformio run --environment
-i, --ignore
Ignore tests where the name matches specified patterns. More than one pattern is allowed. If you need to ignore some tests for the specific environment, please take a look at projectconf_test_ignore option from projectconf.
┌────────┬───────────────────────────┐ │Pattern │ Meaning                   │ ├────────┼───────────────────────────┤ │*       │ matches everything        │ ├────────┼───────────────────────────┤ │?       │ matches any single        │ │        │ character                 │ ├────────┼───────────────────────────┤ │[seq]   │ matches any character in  │ │        │ seq                       │ ├────────┼───────────────────────────┤ │[!seq]  │ matches any character not │ │        │ in seq                    │ └────────┴───────────────────────────┘
For example, platformio remote test --ignore "mytest*" -i "test[13]"
A port that is intended for firmware uploading. To list available ports please use cmd_device_list command.
--test-port
A Serial/UART port that PlatformIO uses as communication interface between PlatformIO Unit Test Engine and target device. To list available ports please use cmd_device_list command.
If test port is not specified, PlatformIO will try to detect it automatically.
By default, pioremote processes project on a host machine and deploy final testing firmware (program) to remote device (embedded board).
If you need to process project on remote machine, please use platformio remote test --force-remote option. In this case, pioremote will automatically synchronize your project with remote machine, install required toolchains, frameworks, SDKs, etc., and process project.
--without-building
Skip building stage.
--without-uploading
Skip uploading stage
Examples For the examples please follow to unit_testing page.
platformio remote update Contents • platformio remote update
Usage platformio remote update [OPTIONS] pio remote update [OPTIONS]
# start update process on the specified agents/machines platformio remote --agent NAME update [OPTIONS]
Description Check or update installed platforms and global Libraries on the remote machine.
Examples > platformio remote update
Platform Manager ================ Platform timsp430 -------- Updating timsp430 @ 0.0.0:  [Up-to-date] Updating toolchain-timsp430 @ 1.40603.0:    [Up-to-date] Updating framework-energiamsp430 @ 1.17.0:  [Up-to-date] Updating framework-arduinomsp430 @ 1.10601.0:   [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform freescalekinetis -------- Updating freescalekinetis @ 0.0.0:  [Up-to-date] Updating framework-mbed @ 1.121.1:  [Up-to-date] Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform ststm32 -------- Updating ststm32 @ 0.0.0:   [Up-to-date] Updating framework-libopencm3 @ 1.1.0:  [Up-to-date] Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date] Updating tool-stlink @ 1.10200.0:   [Up-to-date] Updating framework-spl @ 1.10201.0:     [Up-to-date] Updating framework-cmsis @ 1.40300.0:   [Up-to-date] Updating framework-mbed @ 1.121.1:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform lattice_ice40 -------- Updating lattice_ice40 @ 0.0.0:     [Up-to-date] Updating toolchain-icestorm @ 1.7.0:    [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform espressif8266 -------- Updating espressif8266 @ 0.0.0:     [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date] Updating toolchain-xtensa @ 1.40802.0:  [Up-to-date] Updating tool-esptool @ 1.409.0:    [Up-to-date] Updating tool-mkspiffs @ 1.102.0:   [Up-to-date] Updating framework-arduinoespressif8266 @ 1.20300.0:    [Up-to-date] Updating sdk-esp8266 @ 1.10502.0:   [Up-to-date]
Platform linux_x86_64 -------- Updating linux_x86_64 @ 0.0.0:  [Up-to-date] Updating toolchain-gcclinux64 @ 1.40801.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform windows_x86 -------- Updating windows_x86 @ 0.0.0:   [Up-to-date] Updating toolchain-gccmingw32 @ 1.40800.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform teensy -------- Updating teensy @ 0.0.0:    [Up-to-date] Updating framework-arduinoteensy @ 1.128.0:     [Up-to-date] Updating tool-teensy @ 1.1.0:   [Up-to-date] Updating framework-mbed @ 1.121.1:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date] Updating toolchain-atmelavr @ 1.40801.0:    [Up-to-date] Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date]
Platform nordicnrf51 -------- Updating nordicnrf51 @ 0.0.0:   [Up-to-date] Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date] Updating framework-arduinonordicnrf51 @ 1.20302.0:  [Up-to-date] Updating framework-mbed @ 1.121.1:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform titiva -------- Updating titiva @ 0.0.0:    [Up-to-date] Updating framework-libopencm3 @ 1.1.0:  [Up-to-date] Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date] Updating framework-energiativa @ 1.17.0:    [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform atmelsam -------- Updating atmelsam @ 0.0.0:  [Up-to-date] Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date] Updating tool-openocd @ 1.900.0:    [Up-to-date] Updating framework-mbed @ 1.121.1:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date] Updating tool-avrdude @ 1.60001.1:  [Up-to-date] Updating tool-bossac @ 1.10601.0:   [Up-to-date]
Platform siliconlabsefm32 -------- Updating siliconlabsefm32 @ 0.0.0:  [Up-to-date] Updating framework-mbed @ 1.121.1:  [Up-to-date] Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform microchippic32 -------- Updating microchippic32 @ 0.0.0:    [Up-to-date] Updating framework-arduinomicrochippic32 @ 1.10201.0:   [Up-to-date] Updating toolchain-microchippic32 @ 1.40803.0:  [Up-to-date] Updating tool-pic32prog @ 1.200200.0:   [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform linux_i686 -------- Updating linux_i686 @ 0.0.0:    [Up-to-date] Updating toolchain-gcclinux32 @ 1.40801.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform intel_arc32 -------- Updating intel_arc32 @ 0.0.0:   [Up-to-date] Updating framework-arduinointel @ 1.10006.0:    [Up-to-date] Updating tool-arduino101load @ 1.124.0:     [Up-to-date] Updating toolchain-intelarc32 @ 1.40805.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform nxplpc -------- Updating nxplpc @ 0.0.0:    [Up-to-date] Updating framework-mbed @ 1.121.1:  [Up-to-date] Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform linux_arm -------- Updating linux_arm @ 0.0.0:     [Up-to-date] Updating toolchain-gccarmlinuxgnueabi @ 1.40802.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Platform native -------- Updating native @ 0.0.0:    [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
Library Manager =============== Updating Adafruit-GFX @ 334e815bc1:     [Up-to-date] Updating Adafruit-ST7735 @ d53d4bf03a:  [Up-to-date] Updating Adafruit-DHT @ 09344416d2:     [Up-to-date] Updating Adafruit-Unified-Sensor @ f2af6f4efc:  [Up-to-date] Updating ESP8266_SSD1306 @ 3.2.3:   [Up-to-date] Updating EngduinoMagnetometer @ 3.1.0:  [Up-to-date] Updating IRremote @ 2.2.1:  [Up-to-date] Updating Json @ 5.6.4:  [Up-to-date] Updating MODSERIAL @ d8422efe47:    [Up-to-date] Updating PJON @ 1fb26fd:    [Checking] git version 2.7.4 (Apple Git-66) Already up-to-date. Updating Servo @ 36b69a7ced07:  [Checking] Mercurial Distributed SCM (version 3.8.4) (see https://mercurial-scm.org for more information)
Copyright (C) 2005-2016 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. pulling from https://developer.mbed.org/users/simon/code/Servo/ searching for changes no changes found Updating TextLCD @ 308d188a2d3a:    [Checking] Mercurial Distributed SCM (version 3.8.4) (see https://mercurial-scm.org for more information)
platformio run Contents • platformio run
Usage platformio run [OPTIONS] pio run [OPTIONS]
Description Process environments which are defined in projectconf file
NOTE: You can configure default targets per project environment using projectconf_targets option in projectconf.
• Processing
• debug build using Debug Configuration
• fuses set fuse bits (available only for platform_atmelavr)
• checkprogsize check maximum allowed firmware size for uploading
• erase erase device flash (not available on the all platforms)
• compiledb build compilation_db
• Device
• monitor automatically start cmd_device_monitor after success build operation. You can configure monitor using projectconf_section_env_monitor.
• Service
• idedata export build environment for IDE (defines, build flags, CPPPATH, etc.)
Custom upload port of embedded board. To print all available ports use cmd_device_list command.
-j, --jobs
Control a number of parallel build jobs. Default is a number of CPUs in a system.
Examples 1. Process Wiring Blink Example
> platformio run
[Wed Sep  7 15:48:58 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino) ----------------------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option Collected 36 compatible libraries Looking for dependencies... Project does not have dependencies Compiling .pio/build/uno/src/main.o Archiving .pio/build/uno/libFrameworkArduinoVariant.a Indexing .pio/build/uno/libFrameworkArduinoVariant.a Compiling .pio/build/uno/FrameworkArduino/CDC.o ... Compiling .pio/build/uno/FrameworkArduino/wiring_shift.o Archiving .pio/build/uno/libFrameworkArduino.a Indexing .pio/build/uno/libFrameworkArduino.a Linking .pio/build/uno/firmware.elf Building .pio/build/uno/firmware.hex Calculating size .pio/build/uno/firmware.elf AVR Memory Usage ---------------- Device: atmega328p
Program:    1034 bytes (3.2% Full) (.text + .data + .bootloader)
Data:          9 bytes (0.4% Full) (.data + .bss + .noinit)
=========================== [SUCCESS] Took 2.47 seconds ===========================
[Wed Sep  7 15:49:01 2016] Processing nodemcu (platform: espressif8266, board: nodemcu, framework: arduino) ----------------------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option Collected 34 compatible libraries Looking for dependencies... Project does not have dependencies Compiling .pio/build/nodemcu/src/main.o Archiving .pio/build/nodemcu/libFrameworkArduinoVariant.a Indexing .pio/build/nodemcu/libFrameworkArduinoVariant.a Compiling .pio/build/nodemcu/FrameworkArduino/Esp.o Compiling .pio/build/nodemcu/FrameworkArduino/FS.o Compiling .pio/build/nodemcu/FrameworkArduino/HardwareSerial.o ... Archiving .pio/build/nodemcu/libFrameworkArduino.a Indexing .pio/build/nodemcu/libFrameworkArduino.a Linking .pio/build/nodemcu/firmware.elf Calculating size .pio/build/nodemcu/firmware.elf text       data     bss     dec     hex filename 221240      888   29400  251528   3d688 .pio/build/nodemcu/firmware.elf Building .pio/build/nodemcu/firmware.bin =========================== [SUCCESS] Took 6.43 seconds ===========================
[Wed Sep  7 15:49:07 2016] Processing teensy31 (platform: teensy, board: teensy31, framework: arduino) ----------------------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option Collected 96 compatible libraries Looking for dependencies... Project does not have dependencies Compiling .pio/build/teensy31/src/main.o Compiling .pio/build/teensy31/FrameworkArduino/AudioStream.o Compiling .pio/build/teensy31/FrameworkArduino/DMAChannel.o ... Compiling .pio/build/teensy31/FrameworkArduino/yield.o Archiving .pio/build/teensy31/libFrameworkArduino.a Indexing .pio/build/teensy31/libFrameworkArduino.a Linking .pio/build/teensy31/firmware.elf Calculating size .pio/build/teensy31/firmware.elf text       data     bss     dec     hex filename 11288       168    2288   13744    35b0 .pio/build/teensy31/firmware.elf Building .pio/build/teensy31/firmware.hex =========================== [SUCCESS] Took 5.36 seconds ===========================
[Wed Sep  7 15:49:12 2016] Processing lpmsp430g2553 (platform: timsp430, build_flags: -D LED_BUILTIN=RED_LED, board: lpmsp430g2553, framework: arduino) ----------------------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option Collected 29 compatible libraries Looking for dependencies... Project does not have dependencies Compiling .pio/build/lpmsp430g2553/src/main.o Compiling .pio/build/lpmsp430g2553/FrameworkAnergia/HardwareSerial.o Compiling .pio/build/lpmsp430g2553/FrameworkAnergia/IPAddress.o ... Compiling .pio/build/lpmsp430g2553/FrameworkAnergia/wiring_digital.o Compiling .pio/build/lpmsp430g2553/FrameworkAnergia/wiring_pulse.o Compiling .pio/build/lpmsp430g2553/FrameworkAnergia/wiring_shift.o Archiving .pio/build/lpmsp430g2553/libFrameworkAnergia.a Indexing .pio/build/lpmsp430g2553/libFrameworkAnergia.a Linking .pio/build/lpmsp430g2553/firmware.elf Calculating size .pio/build/lpmsp430g2553/firmware.elf text       data     bss     dec     hex filename 820           0      20     840     348 .pio/build/lpmsp430g2553/firmware.elf Building .pio/build/lpmsp430g2553/firmware.hex =========================== [SUCCESS] Took 2.34 seconds ===========================
2. Process specific environment
> platformio run -e nodemcu -e teensy31
3. Process specific target (clean project)
> platformio run -t clean [Wed Sep  7 15:53:26 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino) ----------------------------------------------------------------------------------------------------- Removed .pio/build/uno/firmware.elf Removed .pio/build/uno/firmware.hex Removed .pio/build/uno/libFrameworkArduino.a Removed .pio/build/uno/libFrameworkArduinoVariant.a Removed .pio/build/uno/FrameworkArduino/_wiring_pulse.o Removed .pio/build/uno/FrameworkArduino/abi.o Removed .pio/build/uno/FrameworkArduino/CDC.o Removed .pio/build/uno/FrameworkArduino/HardwareSerial.o Removed .pio/build/uno/FrameworkArduino/HardwareSerial0.o Removed .pio/build/uno/FrameworkArduino/HardwareSerial1.o Removed .pio/build/uno/FrameworkArduino/HardwareSerial2.o Removed .pio/build/uno/FrameworkArduino/HardwareSerial3.o Removed .pio/build/uno/FrameworkArduino/hooks.o Removed .pio/build/uno/FrameworkArduino/IPAddress.o Removed .pio/build/uno/FrameworkArduino/main.o Removed .pio/build/uno/FrameworkArduino/new.o Removed .pio/build/uno/FrameworkArduino/PluggableUSB.o Removed .pio/build/uno/FrameworkArduino/Print.o Removed .pio/build/uno/FrameworkArduino/Stream.o Removed .pio/build/uno/FrameworkArduino/Tone.o Removed .pio/build/uno/FrameworkArduino/USBCore.o Removed .pio/build/uno/FrameworkArduino/WInterrupts.o Removed .pio/build/uno/FrameworkArduino/wiring.o Removed .pio/build/uno/FrameworkArduino/wiring_analog.o Removed .pio/build/uno/FrameworkArduino/wiring_digital.o Removed .pio/build/uno/FrameworkArduino/wiring_pulse.o Removed .pio/build/uno/FrameworkArduino/wiring_shift.o Removed .pio/build/uno/FrameworkArduino/WMath.o Removed .pio/build/uno/FrameworkArduino/WString.o Removed .pio/build/uno/src/main.o Done cleaning ======================= [SUCCESS] Took 0.49 seconds =======================
[Wed Sep  7 15:53:27 2016] Processing nodemcu (platform: espressif8266, board: nodemcu, framework: arduino) ----------------------------------------------------------------------------------------------------- Removed .pio/build/nodemcu/firmware.bin Removed .pio/build/nodemcu/firmware.elf Removed .pio/build/nodemcu/libFrameworkArduino.a Removed .pio/build/nodemcu/libFrameworkArduinoVariant.a ... Removed .pio/build/nodemcu/FrameworkArduino/spiffs/spiffs_nucleus.o Removed .pio/build/nodemcu/FrameworkArduino/umm_malloc/umm_malloc.o Removed .pio/build/nodemcu/src/main.o Done cleaning ======================= [SUCCESS] Took 0.50 seconds =======================
[Wed Sep  7 15:53:27 2016] Processing teensy31 (platform: teensy, board: teensy31, framework: arduino) ----------------------------------------------------------------------------------------------------- Removed .pio/build/teensy31/firmware.elf Removed .pio/build/teensy31/firmware.hex Removed .pio/build/teensy31/libFrameworkArduino.a Removed .pio/build/teensy31/FrameworkArduino/analog.o Removed .pio/build/teensy31/FrameworkArduino/AudioStream.o ... Removed .pio/build/teensy31/FrameworkArduino/WString.o Removed .pio/build/teensy31/FrameworkArduino/yield.o Removed .pio/build/teensy31/src/main.o Done cleaning ======================= [SUCCESS] Took 0.50 seconds =======================
[Wed Sep  7 15:53:28 2016] Processing lpmsp430g2553 (platform: timsp430, build_flags: -D LED_BUILTIN=RED_LED, board: lpmsp430g2553, framework: energia) ----------------------------------------------------------------------------------------------------- Removed .pio/build/lpmsp430g2553/firmware.elf Removed .pio/build/lpmsp430g2553/firmware.hex Removed .pio/build/lpmsp430g2553/libFrameworkAnergia.a Removed .pio/build/lpmsp430g2553/FrameworkAnergia/atof.o ... Removed .pio/build/lpmsp430g2553/FrameworkAnergia/avr/dtostrf.o Removed .pio/build/lpmsp430g2553/src/main.o Done cleaning ======================= [SUCCESS] Took 0.49 seconds =======================
4. Mix environments and targets
> platformio run -e uno -t upload
[Wed Sep  7 15:55:11 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino) -------------------------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option Collected 36 compatible libraries Looking for dependencies... Project does not have dependencies Compiling .pio/build/uno/src/main.o Archiving .pio/build/uno/libFrameworkArduinoVariant.a Indexing .pio/build/uno/libFrameworkArduinoVariant.a Compiling .pio/build/uno/FrameworkArduino/CDC.o ... Compiling .pio/build/uno/FrameworkArduino/wiring_shift.o Archiving .pio/build/uno/libFrameworkArduino.a Indexing .pio/build/uno/libFrameworkArduino.a Linking .pio/build/uno/firmware.elf Checking program size .pio/build/uno/firmware.elf text       data     bss     dec     hex filename 1034          0       9    1043     413 .pio/build/uno/firmware.elf Building .pio/build/uno/firmware.hex Looking for upload port... Auto-detected: /dev/cu.usbmodemFA141 Uploading .pio/build/uno/firmware.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e950f avrdude: reading input file ".pio/build/uno/firmware.hex" avrdude: writing flash (1034 bytes):
Writing | ################################################## | 100% 0.18s
avrdude: 1034 bytes of flash written avrdude: verifying flash memory against .pio/build/uno/firmware.hex: avrdude: load data flash data from input file .pio/build/uno/firmware.hex: avrdude: input file .pio/build/uno/firmware.hex contains 1034 bytes avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.15s
avrdude: verifying ... avrdude: 1034 bytes of flash verified
avrdude: safemode: Fuses OK (H:00, E:00, L:00)
avrdude done.  Thank you.
======================== [SUCCESS] Took 4.14 seconds ========================
platformio settings Manage PlatformIO settings
Contents • platformio settings
• platformio settings get
• Settings
• auto_update_libraries
• auto_update_platforms
• check_libraries_interval
• check_platformio_interval
• check_platforms_interval
• enable_cache
• strict_ssl
• enable_telemetry
• force_verbose
• projects_dir
• platformio settings set
• platformio settings reset
platformio settings get Usage platformio settings get [NAME] pio settings get [NAME]
Description NOTE:
• The Yes value is equal to: True, Y, 1 and is not case sensitive.
• You can override these settings using envvars.
Get/List existing settings
Settings auto_update_libraries Default No
Values Yes/No
Automatically update libraries.
auto_update_platforms Default No
Automatically update platforms.
check_libraries_interval Default 7
Values Days (Number)
Check for the library updates interval.
check_platformio_interval Default 3
Check for the new PlatformIO interval.
check_platforms_interval Default 7
Check for the platform updates interval.
enable_cache Default Yes
Enable caching for API requests and Library Manager
strict_ssl Default No
Strict SSL for PlatformIO Services
enable_telemetry Default Yes
Share minimal diagnostics and usage information to help us make PlatformIO better.
The source code of telemetry service is open source.  You can make sure that we DO NOT SHARE PRIVATE information or source code of your project. All information shares ANONYMOUSLY.
Which data do we collect and why?
• A version of Python Interpreter. piocore is written in Python language, including development platforms. We need to know which Python version produces such type of exceptions (see below), which is more popular, which version we should drop and focus on a new one
• piocore errors/exceptions. We report automatically fatal exceptions raised by PlatformIO Core source code but NOT by your project
• The name of the used platform, board, framework. We collect this type of information to have a clear picture which software products are the most widely used by our Community and for the which we should provide frequent updates and add new features ( for example, "atmelavr", "arduino", "uno", etc.)
• The name of CLI command. It helps us to improve our CLI. For example, "run", "lib list")
• The name of ide. This is very important information for us. We create native extensions based on the popularity of IDEs (for example, ide_vscode, ide_clion)
Thanks a lot that you keep this setting enabled!
force_verbose Default No
Force verbose output when processing environments. This setting overrides
• platformio run --verbose
• platformio ci --verbose
• platformio test --verbose
projects_dir Default ~/Documents/PlatformIO/Projects
Values Path to folder
Default location for PlatformIO projects (PIO Home)
Examples 1. List all settings and theirs current values
> platformio settings get
Name                            Value [Default]   Description ------------------------------------------------------------------------------------------ auto_update_libraries           No                Automatically update libraries (Yes/No) auto_update_platforms           No                Automatically update platforms (Yes/No) check_libraries_interval        7                 Check for the library updates interval (days) check_platformio_interval       3                 Check for the new PlatformIO interval (days) check_platforms_interval        7                 Check for the platform updates interval (days) enable_cache                    Yes               Enable caching for API requests and Library Manager strict_ssl                      No                Strict SSL for PlatformIO Services enable_telemetry                Yes               Telemetry service?#enable-telemetry> (Yes/No) force_verbose                   No                Force verbose output when processing environments projects_dir                    ~/Documents/PlatformIO/Projects Default location for PlatformIO projects (PIO Home)
2. Show specified setting
$ platformio settings get auto_update_platforms Name                            Value [Default]   Description ------------------------------------------------------------------------------------------ auto_update_platforms           Yes               Automatically update platforms (Yes/No)
platformio settings set Usage platformio settings set NAME VALUE
Description Set new value for the setting
Examples Change to check for the new PlatformIO each day
$ platformio settings set check_platformio_interval 1 The new value for the setting has been set! Name                            Value [Default]   Description ------------------------------------------------------------------------------------------ check_platformio_interval       1 [3]             Check for the new PlatformIO interval (days)
platformio settings reset Usage platformio settings reset
Description Reset settings to default
Examples $ platformio settings reset The settings have been reset!
Name                            Value [Default]   Description ------------------------------------------------------------------------------------------ auto_update_libraries           No                Automatically update libraries (Yes/No) auto_update_platforms           No                Automatically update platforms (Yes/No) check_libraries_interval        7                 Check for the library updates interval (days) check_platformio_interval       3                 Check for the new PlatformIO interval (days) check_platforms_interval        7                 Check for the platform updates interval (days) enable_cache                    Yes               Enable caching for API requests and Library Manager strict_ssl                      No                Enable SSL for PlatformIO Services enable_telemetry                Yes               Telemetry service?#enable-telemetry> (Yes/No) force_verbose                   No                Force verbose output when processing environments projects_dir                    ~/Documents/PlatformIO/Projects Default location for PlatformIO projects (PIO Home)
platformio system Miscellaneous system commands.
platformio system --help platformio system COMMAND --help pio system --help
PlatformIO Shell Completion Shell completion support for
• Fish
• Zsh
• Bash
• PowerShell
platformio misc completion --help platformio misc completion COMMAND --help pio misc completion --help
platformio misc completion install Contents • platformio misc completion install
Usage platformio misc completion install [OPTIONS] pio misc completion install [OPTIONS]
Description Install shell completion files or code.
Options --shell
The shell type, default is auto and will be detected from a current shell session.
Supported shells are:
• fish
• zsh
• bash
• powershell
--path
Custom installation path of the code to be evaluated by the shell.  The standard installation path is used by default.
Examples > pio misc completion install
PlatformIO CLI completion has been installed for fish shell to ~/.config/fish/completions/pio.fish Please restart a current shell session
platformio misc completion uninstall Contents • platformio misc completion uninstall
Usage platformio misc completion uninstall [OPTIONS] pio misc completion uninstall [OPTIONS]
Description Uninstall shell completion files or code.
Examples > pio misc completion uninstall
PlatformIO CLI completion has been uninstalled for fish shell from ~/.config/fish/completions/pio.fish Please restart a current shell session.
platformio test Helper command for local unit_testing.
Contents • platformio test
Usage platformio test [OPTIONS] pio test [OPTIONS]
Description Run locally tests from PlatformIO based project. More details about PlatformIO unit_testing.
Process only the tests where the name matches specified patterns. More than one pattern is allowed. If you need to filter some tests for a specific environment, please take a look at projectconf_test_filter option from projectconf.
For example, platformio test --filter "mytest*" -i "test[13]"
Ignore tests where the name matches specified patterns. More than one pattern is allowed. If you need to ignore some tests for a specific environment, please take a look at projectconf_test_ignore option from projectconf.
For example, platformio test --ignore "mytest*" -i "test[13]"
--no-reset
Disable software reset via Serial.DTR/RST before test running. In this case, need to press "reset" button manually after firmware uploading.
WARNING: If board does not support software reset via Serial.DTR/RTS you should add >2 seconds delay before UNITY_BEGIN()`.  We need that time to establish a ``Serial communication between host machine and target device. See unit_testing.
--monitor-rts
Set initial RTS line state for Serial Monitor (0 or 1), default 1. We use it to gather test results via Serial connection.
--monitor-dtr
Set initial DTR line state for Serial Monitor (0 or 1), default 1. We use it to gather test results via Serial connection.
platformio update Contents • platformio update
Usage platformio update [OPTIONS] pio update [OPTIONS]
Description Check or update installed PIO Core packages, platforms and global Libraries. This command is combination of 2 sub-commands:
• cmd_platform_update
• cmd_lib_update
Options --core-packages
Update only the core packages
Examples > platformio update
Platform Manager ================ Platform timsp430 -------- Updating timsp430 @ 0.0.0:  [Up-to-date] Updating toolchain-timsp430 @ 1.40603.0:    [Up-to-date] Updating framework-energiamsp430 @ 1.17.0:  [Up-to-date] Updating tool-scons @ 2.4.1:    [Up-to-date]
platformio upgrade Contents • platformio upgrade
Usage platformio upgrade pio upgrade
Description Check or upgrade PlatformIO to the latest version
Options --dev
Use development branch.
Examples > platformio upgrade
You are up-to-date! PlatformIO x.x.x is currently the newest version available.
# If you have problem with permissions try: > sudo platformio upgrade
PlatformIO Home PlatformIO Home allows you to interact with PlatformIO ecosystem using modern and cross-platform GUI:
• Project Manager
• pioaccount
• platforms
• Library and development platform updates
• frameworks
• boards
• Device Manager: serial, logical, and multicast DNS services
• Static Code Analysis
• Firmware File Explorer
• Firmware Memory Inspection
• Firmware Sections & Symbols Viewer.
Contents • Installation
• Quick Start
• PlatformIO IDE
• PlatformIO Core
• Demo
• Welcome & Project Manager
• Project Inspect
• Statistics
• Firmware Symbols
• Firmware Sections
• Board Explorer
Installation You do not need to install PlatformIO Home separately, it's already built-in in pioide and piocore.
Quick Start PlatformIO IDE Please open PlatformIO Home using (HOME) button on PIO Toolbar:
• Atom: atom_ide_platformio_toolbar
• VSCode: ide_vscode_toolbar
PlatformIO Core Please launch PlatformIO Home Web-server using cmd_home command and open in your browser http://127.0.0.1:8008.
You can change host and port. Please check cmd_home command for details.
Demo Welcome & Project Manager [image]
Project Inspect Statistics [image]
Only code analysis (piocheck) [image]
Firmware File Explorer [image]
File Symbols [image]
Firmware Symbols [image]
Firmware Sections [image]
Static Code Analysis [image]
Board Explorer [image]
Tutorials and Examples Tutorials Unit Testing of a Blink Project The goal of this tutorial is to demonstrate how simple it is to use unit_testing.
• Level: Beginner
• Platforms: Windows, macOS, Linux
Contents • Setting Up the Project
• Project structure
• Source files
• Test results
Setting Up the Project 1. Please navigate to the core_quickstart section and create the "Blink Project".
2. Create a test directory in the project (on the same level as src) and place a test_main.cpp file in it (the source code is located below).
3. Run tests using the cmd_test command.
Project structure project_dir ├── lib │   └── README ├── platformio.ini ├── src │   └── ... └── test └── test_main.cpp
Source files • platformio.ini
• test/test_main.cpp
#include <Arduino.h> #include <unity.h>
// void setUp(void) { // // set stuff up here // }
// void tearDown(void) { // // clean stuff up here // }
void test_led_builtin_pin_number(void) { TEST_ASSERT_EQUAL(13, LED_BUILTIN); }
void test_led_state_high(void) { digitalWrite(LED_BUILTIN, HIGH); TEST_ASSERT_EQUAL(HIGH, digitalRead(LED_BUILTIN)); }
void test_led_state_low(void) { digitalWrite(LED_BUILTIN, LOW); TEST_ASSERT_EQUAL(LOW, digitalRead(LED_BUILTIN)); }
void setup() { // NOTE!!! Wait for >2 secs // if board doesn't support software reset via Serial.DTR/RTS delay(2000);
UNITY_BEGIN();    // IMPORTANT LINE! RUN_TEST(test_led_builtin_pin_number);
pinMode(LED_BUILTIN, OUTPUT); }
uint8_t i = 0; uint8_t max_blinks = 5;
void loop() { if (i < max_blinks) { RUN_TEST(test_led_state_high); delay(500); RUN_TEST(test_led_state_low); delay(500); i++; } else if (i == max_blinks) { UNITY_END(); // stop unit testing } }
Test results > platformio test -e uno --verbose
Verbose mode can be enabled via `-v, --verbose` option Collected 1 items
===================== [test/*] Building... (1/3) ======================= Processing uno (platform: atmelavr; board: uno; framework: arduino) ------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option PLATFORM: Atmel AVR > Arduino Uno SYSTEM: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash) Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF MODES: FINDER(chain) COMPATIBILITY(soft) Collected 24 compatible libraries Scanning dependencies... No dependencies Compiling .pio\build\uno\test\output_export.cpp.o Compiling .pio\build\uno\test\test_main.cpp.o Archiving .pio\build\uno\libFrameworkArduinoVariant.a Compiling .pio\build\uno\FrameworkArduino\CDC.cpp.o Indexing .pio\build\uno\libFrameworkArduinoVariant.a Compiling .pio\build\uno\FrameworkArduino\HardwareSerial.cpp.o Compiling .pio\build\uno\FrameworkArduino\HardwareSerial0.cpp.o Compiling .pio\build\uno\FrameworkArduino\HardwareSerial1.cpp.o Compiling .pio\build\uno\FrameworkArduino\HardwareSerial2.cpp.o Compiling .pio\build\uno\FrameworkArduino\HardwareSerial3.cpp.o Compiling .pio\build\uno\FrameworkArduino\IPAddress.cpp.o Compiling .pio\build\uno\FrameworkArduino\PluggableUSB.cpp.o Compiling .pio\build\uno\FrameworkArduino\Print.cpp.o Compiling .pio\build\uno\FrameworkArduino\Stream.cpp.o Compiling .pio\build\uno\FrameworkArduino\Tone.cpp.o Compiling .pio\build\uno\FrameworkArduino\USBCore.cpp.o Compiling .pio\build\uno\FrameworkArduino\WInterrupts.c.o Compiling .pio\build\uno\FrameworkArduino\WMath.cpp.o Compiling .pio\build\uno\FrameworkArduino\WString.cpp.o Compiling .pio\build\uno\FrameworkArduino\abi.cpp.o Compiling .pio\build\uno\FrameworkArduino\hooks.c.o Compiling .pio\build\uno\FrameworkArduino\main.cpp.o Compiling .pio\build\uno\FrameworkArduino\new.cpp.o Compiling .pio\build\uno\FrameworkArduino\wiring.c.o Compiling .pio\build\uno\FrameworkArduino\wiring_analog.c.o Compiling .pio\build\uno\FrameworkArduino\wiring_digital.c.o Compiling .pio\build\uno\FrameworkArduino\wiring_pulse.S.o Compiling .pio\build\uno\FrameworkArduino\wiring_pulse.c.o Compiling .pio\build\uno\FrameworkArduino\wiring_shift.c.o Compiling .pio\build\uno\UnityTestLib\unity.o Archiving .pio\build\uno\libFrameworkArduino.a Indexing .pio\build\uno\libFrameworkArduino.a Archiving .pio\build\uno\libUnityTestLib.a Indexing .pio\build\uno\libUnityTestLib.a Linking .pio\build\uno\firmware.elf Checking size .pio\build\uno\firmware.elf Building .pio\build\uno\firmware.hex Memory Usage -> http://bit.ly/pio-memory-usage DATA:    [==        ]  20.0% (used 410 bytes from 2048 bytes) PROGRAM: [=         ]  12.6% (used 4060 bytes from 32256 bytes)
========================================== [SUMMARY] ========================================== Environment uno                 [SUCCESS] Environment teensy31            [SKIP] ================================= [SUCCESS] Took 2.54 seconds =================================
================================= [test/*] Uploading... (2/3) ================================= Processing uno (platform: atmelavr; board: uno; framework: arduino) ------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option PLATFORM: Atmel AVR > Arduino Uno SYSTEM: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash) Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF MODES: FINDER(chain) COMPATIBILITY(soft) Collected 24 compatible libraries Scanning dependencies... No dependencies Checking size .pio\build\uno\firmware.elf Memory Usage -> http://bit.ly/pio-memory-usage DATA:    [==        ]  20.0% (used 410 bytes from 2048 bytes) PROGRAM: [=         ]  12.6% (used 4060 bytes from 32256 bytes) Configuring upload protocol... AVAILABLE: arduino CURRENT: upload_protocol = arduino Looking for upload port... Auto-detected: COM18 Uploading .pio\build\uno\firmware.hex
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p) avrdude: reading input file ".pio\build\uno\firmware.hex" avrdude: writing flash (4060 bytes):
Writing | ################################################## | 100% 0.76s
avrdude: 4060 bytes of flash written avrdude: verifying flash memory against .pio\build\uno\firmware.hex: avrdude: load data flash data from input file .pio\build\uno\firmware.hex: avrdude: input file .pio\build\uno\firmware.hex contains 4060 bytes avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.48s
avrdude: verifying ... avrdude: 4060 bytes of flash verified
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
=============================== [SUMMARY] ================================ Environment uno                 [SUCCESS] Environment teensy31            [SKIP] ====================== [SUCCESS] Took 4.45 seconds ======================
================================== [test/*] Testing... (3/3) ================================== If you don't see any output for the first 10 secs, please reset board (press reset button)
test\test_main.cpp:30:test_led_builtin_pin_number       [PASSED] test\test_main.cpp:41:test_led_state_high       [PASSED] test\test_main.cpp:43:test_led_state_low        [PASSED] test\test_main.cpp:41:test_led_state_high       [PASSED] test\test_main.cpp:43:test_led_state_low        [PASSED] test\test_main.cpp:41:test_led_state_high       [PASSED] test\test_main.cpp:43:test_led_state_low        [PASSED] test\test_main.cpp:41:test_led_state_high       [PASSED] test\test_main.cpp:43:test_led_state_low        [PASSED] test\test_main.cpp:41:test_led_state_high       [PASSED] test\test_main.cpp:43:test_led_state_low        [PASSED] ----------------------- 11 Tests 0 Failures 0 Ignored
============================ [TEST SUMMARY] ============================== test/*/env:uno  [PASSED] test/*/env:teensy31     [IGNORED] ==================== [PASSED] Took 12.99 seconds =========================
Get started with Arduino and ESP32-DevKitC: debugging and unit testing The goal of this tutorial is to demonstrate how simple it is to use ide_vscode to develop, run and debug a simple project with the framework_arduino framework for the ESP32-DevKitC board.
• Platforms: Windows, Mac OS X, Linux
• Downloaded and installed ide_vscode
• ESP32-DevKitC development board
• debugging_tool_olimex-arm-usb-ocd or debugging_tool_olimex-jtag-tiny adapter for debugging
• Adding Code to the Generated Project
• Compiling and Uploading the Firmware
• Debugging the Firmware
• Setting Up the Hardware
• Writing Unit Tests
• Adding Bluetooth LE features
• Conclusion
Setting Up the Project First, we need to create a new project using the PlatformIO Home Page (to open this page, just press the Home icon on the toolbar): [image]
Next, we need to select ESP32-DevKitC as a development board, framework_arduino as a framework and a path to the project location (or use the default one): [image]
Processing the selected project may take some time (PlatformIO will download and install all required packages).  After that, we have a fully configured project that is ready for developing code with the framework_arduino framework.
Adding Code to the Generated Project Let's add some actual code to the project. Firstly, we open a default main file named main.cpp in the projectconf_pio_src_dir folder and replace its content with following:
#include <Arduino.h>
void setup() { Serial.begin(9600); }
void loop() { Serial.println("Hello world!"); delay(1000); } [image]
We have now created a basic project ready for compiling and uploading.
Compiling and Uploading the Firmware Now we can build the project. There are several ways to compile firmware:
• Build option in the Project Tasks menu,
• Build button in ide_vscode_toolbar,
• Task Menu: Tasks: Run Task... > PlatformIO: Build, or in the ide_vscode_toolbar,
• Command Palette: View: Command Palette > PlatformIO: Build, or
• via hotkeys cmd-alt-b / ctrl-alt-b
Marked in red: [image]
If everything went well, we should see a Success message in the terminal window: [image]
There are also several ways to upload the firmware to the board:
• Upload option in the Project Tasks menu,
• Upload button in ide_vscode_toolbar,
• Command Palette: View: Command Palette > PlatformIO: Upload,
• using the Task Menu: Tasks: Run Task... > PlatformIO: Upload, or
• via hotkeys: cmd-alt-u / ctrl-alt-u: [image]
After uploading, we need to check if the firmware is uploaded correctly. To do this, open the serial monitor and check that the message from the board is received. To open the serial monitor, we can use the following options:
• Monitor option in the Project Tasks menu,
• Serial Monitor button in the ide_vscode_toolbar,
• Command Palette: View: Command Palette > PlatformIO: Monitor, or
• Task Menu: Tasks: Run Task... > PlatformIO: Monitor: [image]
If the firmware works as expected, the message from the board can be observed in the terminal window: [image]
Debugging the Firmware Setting Up the Hardware In order to use a JTAG probe with an ESP32, we need to connect the following pins:
┌──────────────┬────────────────┐ │ESP32 pin     │ JTAG probe pin │ ├──────────────┼────────────────┤ │3.3V          │ Pin 1(VTref)   │ ├──────────────┼────────────────┤ │GPIO 9 (EN)   │ Pin 3 (nTRST)  │ ├──────────────┼────────────────┤ │GND           │ Pin 4 (GND)    │ ├──────────────┼────────────────┤ │GPIO 12 (TDI) │ Pin 5 (TDI)    │ ├──────────────┼────────────────┤ │GPIO 14 (TMS) │ Pin 7 (TMS)    │ ├──────────────┼────────────────┤ │GPIO 13 (TCK) │ Pin 9 (TCK)    │ ├──────────────┼────────────────┤ │GPIO 15 (TDO) │ Pin 13 (TDO)   │ └──────────────┴────────────────┘
piodebug offers the easiest way to debug the board. Firstly, we need to specify projectconf_debug_tool in projectconf. In this tutorial, an debugging_tool_olimex-arm-usb-ocd-h debug probe is used:
[env:esp32dev] platform = espressif32 board = esp32dev framework = arduino debug_tool = olimex-arm-usb-ocd-h
To start the debug session we can use the following methods:
• Debug: Start debugging in the top menu,
• Start Debugging option in the Quick Access menu, or
• hotkey button F5: [image]
We need to wait some time while PlatformIO initializes the debug session, and are ready to debug when the first line after the main function is highlighted.
1. Please wait when debugging session is stopped at the first line of app_main() function
2. WARNING! Please set a breakpoint at void loopTask(void *pvParameters) (line 13 in the screenshot below - this line can change between releases)
3. Now, please press CONTINUE/RUN button on debugging toolbar (right arrow icon)
4. The debugging session should stop at the first line of the void loopTask(void *pvParameters) function
5. Now, navigate to your Arduino setup/loop code and do classic debugging. [image]
We can walk through the code using control buttons, set breakpoints, and add variables to the Watch window: [image]
Writing Unit Tests Test cases can be added to a single file that may include multiple tests. First of all, in this file, we need to add four default functions: setUp, tearDown, setup and loop. Functions setUp and tearDown are used to initialize and finalize test conditions. Implementations of these functions are not required for running tests, but if you need to initialize some variables before you run a test, use the setUp function. Likewise, if you need to clean up variables, use tearDown function. In our example we will use these functions to respectively initialize and deinitialize LED states.  The setup and loop functions act as a simple Arduino program where we describe our test plan.
Let's create a test folder in the root of the project and add a new file, test_main.cpp, to this folder. Next, basic tests for String class will be implemented in this file:
• test_string_concat tests the concatenation of two strings
• test_string_substring tests the correctness of the substring extraction
• test_string_index_of ensures that the string returns the correct index of the specified symbol
• test_string_equal_ignore_case tests case-insensitive comparison of two strings
• test_string_to_upper_case tests conversion of the string to upper-case
• test_string_replace tests the correctness of the replacing operation
String STR_TO_TEST;
void setUp(void) { // set stuff up here STR_TO_TEST = "Hello, world!"; }
void tearDown(void) { // clean stuff up here STR_TO_TEST = ""; }
void test_string_concat(void) { String hello = "Hello, "; String world = "world!"; TEST_ASSERT_EQUAL_STRING(STR_TO_TEST.c_str(), (hello + world).c_str()); }
void test_string_substring(void) { TEST_ASSERT_EQUAL_STRING("Hello", STR_TO_TEST.substring(0, 5).c_str()); }
void test_string_index_of(void) { TEST_ASSERT_EQUAL(7, STR_TO_TEST.indexOf('w')); }
void test_string_equal_ignore_case(void) { TEST_ASSERT_TRUE(STR_TO_TEST.equalsIgnoreCase("HELLO, WORLD!")); }
void test_string_to_upper_case(void) { STR_TO_TEST.toUpperCase(); TEST_ASSERT_EQUAL_STRING("HELLO, WORLD!", STR_TO_TEST.c_str()); }
void test_string_replace(void) { STR_TO_TEST.replace('!', '?'); TEST_ASSERT_EQUAL_STRING("Hello, world?", STR_TO_TEST.c_str()); }
void setup() { delay(2000); // service delay UNITY_BEGIN();
RUN_TEST(test_string_concat); RUN_TEST(test_string_substring); RUN_TEST(test_string_index_of); RUN_TEST(test_string_equal_ignore_case); RUN_TEST(test_string_to_upper_case); RUN_TEST(test_string_replace);
UNITY_END(); // stop unit testing }
void loop() { }
Now we are ready to upload tests to the board. To do this we can use the following:
• Test button on ide_vscode_toolbar,
• Test option in the Project Tasks menu, or
• Tasks: Run Task... > PlatformIO Test in the top menu: [image]
After processing, we should see a detailed report about the testing results: [image]
As we can see from the report, all our tests were successful!
Adding Bluetooth LE features Now let's create a basic application that can interact with other BLE devices (e.g phones).  For example, the following code declares a BLE characteristic whose value can be printed to the serial port:
#include <Arduino.h> #include <BLEDevice.h> #include <BLEUtils.h> #include <BLEServer.h>
#define SERVICE_UUID        "4fafc201-1fb5-459e-8fcc-c5c9c331914b" #define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"
class MyCallbacks: public BLECharacteristicCallbacks { void onWrite(BLECharacteristic *pCharacteristic) { std::string value = pCharacteristic->getValue(); if (value.length() > 0) { Serial.print("\r\nNew value: "); for (int i = 0; i < value.length(); i++) Serial.print(value[i]); Serial.println(); } } };
void setup() { Serial.begin(9600);
BLEDevice::init("ESP32 BLE example"); BLEServer *pServer = BLEDevice::createServer(); BLEService *pService = pServer->createService(SERVICE_UUID); BLECharacteristic *pCharacteristic = pService->createCharacteristic( CHARACTERISTIC_UUID, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE );
pCharacteristic->setCallbacks(new MyCallbacks());
pCharacteristic->setValue("Hello World"); pService->start();
BLEAdvertising *pAdvertising = pServer->getAdvertising(); pAdvertising->start(); }
void loop() { delay(2000); }
Now we can compile and upload this program to the board as described in the previous sections.  To verify that our application works as expected, we can use any Android smartphone with the BLE feature and Nordic nRF Connect tool.
At first, we need to scan all advertising BLE devices and connect to the device called ESP32 BLE example.  After successful connection to the board, we should see one "Unknown Service" with one "Unknown Characteristic" field: [image]
To set the value, we need to send new text to the BLE characteristic: [image]
The change of the value is printed to the serial monitor: [image]