### Get Help for Installer Script Source: https://github.com/platformio/platformio-docs/blob/develop/core/installation/integration.md Run this command to view all available arguments and options for the PlatformIO Core Installer Script. ```bash python get-platformio.py --help ``` -------------------------------- ### PlatformIO Core Installation State Example Source: https://github.com/platformio/platformio-docs/blob/develop/core/installation/integration.md An example of the JSON output generated by the `--dump-state` option, showing details about the PlatformIO Core installation. ```json { "cache_dir": "/Users/Freedom/.platformio/.cache", "core_dir": "/Users/Freedom/.platformio", "core_version": "4.3.1", "installer_version": "0.2.0", "is_develop_core": false, "penv_bin_dir": "/Users/Freedom/.platformio/penv/bin", "penv_dir": "/Users/Freedom/.platformio/penv", "platformio_exe": "/Users/Freedom/.platformio/penv/bin/platformio", "python_exe": "/Users/Freedom/.platformio/penv/bin/python", "system": "darwin_x86_64" } ``` -------------------------------- ### Example Output of pio platform list Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/platforms/cmd_list.md This example shows the typical output format when listing installed platforms, detailing each platform's name, description, home URL, associated packages, and version. ```text > pio platform list atmelavr ~ Atmel AVR ==================== Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming. Home: https://platformio.org/platforms/atmelavr Packages: toolchain-atmelavr, framework-simba Version: 0.0.0 atmelsam ~ Atmel SAM ==================== Atmel | SMART offers Flash- based ARM products based on the ARM Cortex-M0+, Cortex-M3 and Cortex-M4 architectures, ranging from 8KB to 2MB of Flash including a rich peripheral and feature mix. Home: https://platformio.org/platforms/atmelsam Packages: framework-arduinosam, framework-mbed, framework-simba, toolchain-gccarmnoneeabi, tool-bossac Version: 0.0.0 espressif8266 ~ Espressif 8266 ============================== Espressif Systems is a privately held fabless semiconductor company. They provide wireless communications and Wi-Fi chips which are widely used in mobile devices and the Internet of Things applications. Home: https://platformio.org/platforms/espressif8266 Packages: framework-simba, tool-esptool, framework-arduinoespressif8266, sdk-esp8266, toolchain-xtensa Version: 0.0.0 ... ``` -------------------------------- ### Install ARM mbed Library Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/lib/cmd_install.md Installs an ARM mbed library from a provided URL to the global storage. This example uses Mercurial and shows the VCS download and installation process. ```bash > pio lib -g install https://developer.mbed.org/users/simon/code/TextLCD/ Library Storage: /storage/dir/... LibraryManager: Installing TextLCD 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. requesting all changes adding changesets adding manifests adding file changes added 9 changesets with 18 changes to 6 files updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved TextLCD @ 308d188a2d3a has been successfully installed! ``` -------------------------------- ### Install PlatformIO Libraries Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install specified libraries using package specifications. Multiple libraries can be installed in a single command. This example shows installing two libraries with specific version requirements and another from a Git repository. ```bash pio pkg install -l "bblanchon/ArduinoJson@^6.19.2" -l "milesburton/DallasTemperature@^3.9.1" ``` ```bash pio pkg install --library https://github.com/Makuna/NeoPixelBus.git ``` -------------------------------- ### Example: Update all libraries in global storage Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/lib/cmd_update.md Demonstrates updating all libraries installed in the global storage. Shows output indicating which libraries are up-to-date and which are being updated. ```bash > pio lib -g update Library Storage: /storage/dir/... 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.4.0: [Out-of-date] LibraryManager: Installing id=64 @ 5.6.4 Downloading [####################################] 100% Unpacking [####################################] 100% Json @ 5.6.4 has been successfully installed! Updating PJON @ 1fb26fd: [Checking] git version 2.7.4 (Apple Git-66) Already up-to-date. Updating TextLCD @ 308d188a2d3a: [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/TextLCD/ searching for changes no changes found ``` -------------------------------- ### Install Development Tools Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install specific development tools, such as debug probes, using the `pio pkg install` command with the `--tool` option. This example installs the SEGGER J-Link Software. ```shell pio pkg install --tool "platformio/tool-jlink" ``` -------------------------------- ### Install PlatformIO Packages Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install specified development platforms and tools. Multiple items can be specified using the -p or --platform and -t or --tool flags respectively. This example shows installing a specific version of a platform and a tool. ```bash pio pkg install -p "aceinna/aceinna_imu@^1.3.8" -p "platformio/atmelavr" ``` ```bash pio pkg install --platform "https://github.com/platformio/platform-sifive.git" ``` ```bash pio pkg install -t "platformio/tool-openocd" ``` ```bash pio pkg install --tool https://github.com/platformio/platform-sifive.git ``` -------------------------------- ### Install from local folder (symbolic link) Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install a package by creating a symbolic link to a local folder. Changes in the source folder will be reflected in the installed package. ```shell symlink://C:/local/path/to/the/package/dir ``` -------------------------------- ### Install PlatformIO and Test Libraries with pio ci Source: https://github.com/platformio/platformio-docs/blob/develop/integration/ci/drone.md Install PlatformIO and use the 'pio ci' command to test your library project. Specify boards and additional libraries directly from the command line. This method is convenient for projects with examples or testing code. ```bash pip install -U platformio wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip unzip /tmp/spi4teensy3.zip -d /tmp pio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due ``` -------------------------------- ### PlatformIO `examples` Configuration Source: https://github.com/platformio/platformio-docs/blob/develop/manifests/library-json/fields/examples.md Defines a list of example patterns for a PlatformIO project. Each entry specifies the example name, its base directory, and a list of associated files. ```javascript "examples": [ { "name": "Hello", "base": "examples/world", "files": [ "platformio.ini", "include/world.h", "src/world.c", "README", "extra.py" ] }, { "name": "Blink", "base": "examples/blink", "files": ["blink.cpp", "blink.h"] } ] ``` -------------------------------- ### Example OTA Configuration in platformio.ini Source: https://github.com/platformio/platformio-docs/blob/develop/platforms/espressif32.md An example configuration for OTA updates in `platformio.ini`, including platform, board, framework, upload protocol, and upload port. This setup is essential for deploying firmware updates wirelessly. ```ini [env:myenv] platform = platformio/espressif32 board = esp32dev framework = arduino upload_protocol = espota upload_port = 192.168.0.255 ``` -------------------------------- ### PlatformIO Core Installation Options Source: https://github.com/platformio/platformio-docs/blob/develop/core/installation/integration.md Use command-line flags to modify the installation process, such as enabling verbose output or installing a development version. ```bash python get-platformio.py --verbose ``` ```bash python get-platformio.py --dev ``` ```bash python get-platformio.py --ignore-python ``` -------------------------------- ### Install Library to Custom Storage with Dependencies Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/lib/cmd_install.md Installs a library and its dependencies to a specified custom storage directory. Demonstrates the process of finding and installing both the main library and its required dependencies. ```bash > pio lib --storage-dir /my/storage/dir install DallasTemperature Library Storage: /my/storage/dir Looking for DallasTemperature library in registry Found: https://platformio.org/lib/show/54/DallasTemperature LibraryManager: Installing id=54 Downloading [####################################] 100% Unpacking [####################################] 100% DallasTemperature @ 3.7.7 has been successfully installed! Installing dependencies Looking for OneWire library in registry Found: https://platformio.org/lib/show/1/OneWire LibraryManager: Installing id=1 Downloading [####################################] 100% Unpacking [####################################] 100% OneWire @ 8fd2ebfec7 has been successfully installed! ``` -------------------------------- ### PlatformIO Install Command Usage Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/platforms/cmd_install.md Shows the different ways to specify platforms for installation, including version ranges, local files, and repositories. ```bash pio platform install [OPTIONS] [PLATFORM...] # [PLATFORM...] forms pio platform install pio platform install @ pio platform install @ pio platform install @ pio platform install @ pio platform install pio platform install file:// pio platform install file:// pio platform install pio platform install (name it should have locally) pio platform install ("tag" can be commit, branch or tag) ``` -------------------------------- ### Install from local folder (hard copy) Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install a package by copying its contents from a local folder. Changes in the source folder will not affect the installed package. ```shell file:///local/path/to/the/package/dir ``` -------------------------------- ### Original Arduino .ino File Example Source: https://github.com/platformio/platformio-docs/blob/develop/faq/ino-to-cpp.md This is an example of a standard Arduino sketch file before conversion. ```cpp void setup () { someFunction(13); } void loop() { delay(1000); } void someFunction(int num) { } ``` -------------------------------- ### Install Library by ID or Name Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/lib/cmd_install.md Installs the latest version of a library using its ID or Name into the global storage. Shows output for both ID and Name installation, including when the library is already installed. ```bash > pio lib -g install 4 Library Storage: /storage/dir/... LibraryManager: Installing id=4 Downloading [####################################] 100% Unpacking [####################################] 100% IRremote @ 2.2.1 has been successfully installed! # repeat command with name > pio lib -g install IRRemote Library Storage: /storage/dir/... Looking for IRRemote library in registry Found: https://platformio.org/lib/show/4/IRremote LibraryManager: Installing id=4 IRremote @ 2.2.1 is already installed ``` -------------------------------- ### Install PlatformIO Core Source: https://github.com/platformio/platformio-docs/blob/develop/core/installation/integration.md Run the installer script without arguments for automatic installation. The script returns an exit code 0 on success. ```bash python get-platformio.py ``` -------------------------------- ### Install Specific Library Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/lib/cmd_install.md Installs a specific library and its dependencies. Run this command from the project root. ```bash pio lib install [OPTIONS] [LIBRARY...] ``` -------------------------------- ### Install PlatformIO Platform with Default Packages Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/platforms/cmd_install.md Installs the 'atmelavr' platform and its default packages. This is the standard way to add a new development platform. ```default > pio platform install atmelavr PlatformManager: Installing atmelavr Downloading... Unpacking [####################################] 100% atmelavr @ 0.0.0 has been successfully installed! PackageManager: Installing tool-scons @ >=2.3.0,<2.6.0 Downloading [####################################] 100% Unpacking [####################################] 100% tool-scons @ 2.4.1 has been successfully installed! PackageManager: Installing toolchain-atmelavr @ ~1.40801.0 Downloading [####################################] 100% Unpacking [####################################] 100% toolchain-atmelavr @ 1.40801.0 has been successfully installed! The platform 'atmelavr' has been successfully installed! The rest of packages will be installed automatically depending on your build environment. ``` -------------------------------- ### Install from local TAR.GZ archive Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install a package from a local .tar.gz archive. The archive must contain a manifest file. ```shell file:///local/path/to/the/archive.tar.gz ``` -------------------------------- ### Install GCC on Linux Source: https://github.com/platformio/platformio-docs/blob/develop/platforms/native.md Update package lists and install build essentials using apt. ```shell sudo apt update sudo apt install build-essential ``` -------------------------------- ### Install PlatformIO Platform from Git Repository Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/platforms/cmd_install.md Installs the 'atmelavr' platform directly from a Git repository URL. This is useful for installing development or custom versions of a platform. ```default > pio platform install https://github.com/platformio/platform-atmelavr.git PlatformManager: Installing platform-atmelavr git version 2.7.4 (Apple Git-66) Cloning into '/Volumes/MEDIA/tmp/pio3_test_projects/arduino-digihead-master/home_dir/platforms/installing-U3ucN0-package'... remote: Counting objects: 176, done. remote: Compressing objects: 100% (55/55), done. remote: Total 176 (delta 114), reused 164 (delta 109), pack-reused 0 Receiving objects: 100% (176/176), 38.86 KiB | 0 bytes/s, done. Resolving deltas: 100% (114/114), done. Checking connectivity... done. Submodule 'examples/arduino-external-libs/lib/OneWire' (https://github.com/PaulStoffregen/OneWire.git) registered for path 'examples/arduino-external-libs/lib/OneWire' Cloning into 'examples/arduino-external-libs/lib/OneWire'... remote: Counting objects: 91, done. remote: Total 91 (delta 0), reused 0 (delta 0), pack-reused 91 Unpacking objects: 100% (91/91), done. Checking connectivity... done. Submodule path 'examples/arduino-external-libs/lib/OneWire': checked out '57c18c6de80c13429275f70875c7c341f1719201' atmelavr @ 0.0.0 has been successfully installed! PackageManager: Installing tool-scons @ >=2.3.0,<2.6.0 Downloading [####################################] 100% Unpacking [####################################] 100% tool-scons @ 2.4.1 has been successfully installed! PackageManager: Installing toolchain-atmelavr @ ~1.40801.0 Downloading [####################################] 100% Unpacking [####################################] 100% toolchain-atmelavr @ 1.40801.0 has been successfully installed! The platform 'https://github.com/platformio/platform-atmelavr.git' has been successfully installed! The rest of packages will be installed automatically depending on your build environment. ``` -------------------------------- ### Remote Build and Upload Example Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/remote/cmd_run.md This example shows the command to initiate a remote build and upload process for the 'uno' environment. It includes the output logs from the build and upload stages, indicating successful compilation and device communication. ```bash > pio remote run --environment uno --target upload Building project locally [Wed Oct 26 16:35:09 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino) -------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option Collected 25 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/HardwareSerial.o Compiling .pio/build/uno/FrameworkArduino/HardwareSerial0.o Compiling .pio/build/uno/FrameworkArduino/HardwareSerial1.o Compiling .pio/build/uno/FrameworkArduino/HardwareSerial2.o Compiling .pio/build/uno/FrameworkArduino/HardwareSerial3.o Compiling .pio/build/uno/FrameworkArduino/IPAddress.o Compiling .pio/build/uno/FrameworkArduino/PluggableUSB.o Compiling .pio/build/uno/FrameworkArduino/Print.o Compiling .pio/build/uno/FrameworkArduino/Stream.o Compiling .pio/build/uno/FrameworkArduino/Tone.o Compiling .pio/build/uno/FrameworkArduino/USBCore.o Compiling .pio/build/uno/FrameworkArduino/WInterrupts.o Compiling .pio/build/uno/FrameworkArduino/WMath.o Compiling .pio/build/uno/FrameworkArduino/WString.o Compiling .pio/build/uno/FrameworkArduino/_wiring_pulse.o Compiling .pio/build/uno/FrameworkArduino/abi.o Compiling .pio/build/uno/FrameworkArduino/hooks.o Compiling .pio/build/uno/FrameworkArduino/main.o Compiling .pio/build/uno/FrameworkArduino/new.o Compiling .pio/build/uno/FrameworkArduino/wiring.o Compiling .pio/build/uno/FrameworkArduino/wiring_analog.o Compiling .pio/build/uno/FrameworkArduino/wiring_digital.o Compiling .pio/build/uno/FrameworkArduino/wiring_pulse.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 Building .pio/build/uno/firmware.hex text data bss dec hex filename 2574 48 168 2790 ae6 .pio/build/uno/firmware.elf ========================= [SUCCESS] Took 10.01 seconds ======================= ================================== [SUMMARY] ================================= Environment nodemcuv2 [SKIP] Environment uno_pic32 [SKIP] Environment teensy31 [SKIP] Environment uno [SUCCESS] ========================= [SUCCESS] Took 10.01 seconds ======================== Uploading firmware remotely [Wed Oct 26 19:35:20 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino) ---------------------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option Looking for upload port... Auto-detected: /dev/cu.usbmodemFA1431 Uploading .pio/build/uno/firmware.hex avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e950f avrdude: reading input file ".pio/build/uno/firmware.hex" avrdude: writing flash (2622 bytes): Writing | ################################################## | 100% 0.43s avrdude: 2622 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 2622 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 0.34s avrdude: verifying ... avrdude: 2622 bytes of flash verified avrdude done. Thank you. ========================= [SUCCESS] Took 3.04 seconds ======================= ========================= [SUMMARY] ========================================= Environment nodemcuv2 [SKIP] Environment uno_pic32 [SKIP] Environment teensy31 [SKIP] Environment uno [SUCCESS] ========================= [SUCCESS] Took 3.04 seconds ======================== ``` -------------------------------- ### Install from Local Directory or Archive Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/platforms/cmd_install.md Use the 'file://' prefix to install a development platform from a local directory or a compressed archive (zip, tar.gz). The target must contain a 'platform.json' manifest. ```bash file:///local/path/to/the/platform/dir ``` ```bash file:///local/path/to/the/platform.zip ``` ```bash file:///local/path/to/the/platform.tar.gz ``` -------------------------------- ### Install Libraries with Package Manager Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Use the `pio pkg install` command with the `--library` option to install packages and add them to project dependencies. This example installs ArduinoJson and Embedded Template Library. ```shell pio pkg install --library "bblanchon/ArduinoJson" --library "etlcpp/Embedded Template Library" ``` -------------------------------- ### Example Project Structure Source: https://github.com/platformio/platformio-docs/blob/develop/integration/ide/codeanywhere.md Recommended folder structure for multiple PlatformIO projects in a workspace. ```default ├── project-A │ ├── lib │ │ └── README │ ├── platformio.ini │ └── src │ └── main.ino └── project-B ├── lib │ └── README ├── platformio.ini └── src ├── main.cpp └── main.h ``` -------------------------------- ### Initialize Project with Sample Code Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/project/cmd_init.md Include sample code in the newly created project. The availability of sample code depends on the development platform being used. Added in version 6.1.7. ```bash pio project init --sample-code ``` -------------------------------- ### PlatformIO Project Configuration Example Source: https://github.com/platformio/platformio-docs/blob/develop/projectconf/index.md This example demonstrates the structure of a platformio.ini file, including global settings, common options, and environment-specific configurations for different boards. ```ini [platformio] default_envs = nodemcuv2 ; custom common options [common] build_flags = -D VERSION=1.2.3 -D DEBUG=1 lib_deps_builtin = SPI Wire lib_deps_external = bblanchon/ArduinoJson @ ~5.6,!=5.4 https://github.com/gioblu/PJON.git#v2.0 IRremoteESP8266=https://github.com/markszabo/IRremoteESP8266/archive/master.zip [env:nodemcuv2] platform = espressif8266 framework = arduino board = nodemcuv2 ; Build options build_flags = ${common.build_flags} -DSSID_NAME=HELLO -DSSID_PASWORD=WORLD ; Library options lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} https://github.com/me-no-dev/ESPAsyncTCP.git knolleary/PubSubClient@^2.8 paulstoffregen/OneWire ; Serial Monitor options monitor_speed = 115200 monitor_flags = --encoding hexlify ; Unit Testing options test_ignore = test_desktop [env:bluepill_f103c8] platform = ststm32 framework = arduino board = bluepill_f103c8 ; Library options lib_deps = ${common.lib_deps_external} ; Debug options debug_tool = custom debug_server = ${platformio.packages_dir}/tool-jlink/JLinkGDBServer -singlerun -if SWD -select USB -port 2331 -device STM32F103C8 ; Unit Testing options test_ignore = test_desktop ``` -------------------------------- ### Example of Uninstalling 'atmelavr' Platform Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/platforms/cmd_uninstall.md This example demonstrates the output when uninstalling the 'atmelavr' platform and its associated tools. Note that this command is deprecated. ```bash > pio platform uninstall atmelavr Uninstalling platform atmelavr @ 0.0.0: [OK] Uninstalling package tool-scons @ 2.4.1: [OK] Uninstalling package toolchain-atmelavr @ 1.40801.0: [OK] The platform 'atmelavr' has been successfully uninstalled! ``` -------------------------------- ### PlatformIO Installation and Library Management in Travis CI Source: https://github.com/platformio/platformio-docs/blob/develop/integration/ci/travis.md Install PlatformIO using pip, update it, and install libraries from the PlatformIO Library Registry using their IDs. This is part of the CI setup. ```bash install: - pip install -U platformio - pio update - rm -rf ./linux # # Libraries from PlatformIO Library Registry: # # https://platformio.org/lib/show/416/TinyGPS - pio lib -g install 416 421 422 ``` -------------------------------- ### Example: Show Atmel AVR Platform Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/platforms/cmd_show.md This example demonstrates the output when showing details for the 'atmelavr' platform. It includes version, home URL, license, supported frameworks, and details about associated packages like toolchains and uploaders. ```text > pio platform show atmelavr atmelavr ~ Atmel AVR ==================== Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming. Version: 1.2.1 Home: https://platformio.org/platforms/atmelavr License: Apache-2.0 Frameworks: simba, arduino Package toolchain-atmelavr -------------------------- Type: toolchain Requirements: ~1.40902.0 Installed: Yes Description: avr-gcc Url: http://www.atmel.com/products/microcontrollers/avr/32-bitavruc3.aspx?tab=tools Version: 1.40902.0 (4.9.2) Package framework-arduinoavr ---------------------------- Type: framework Requirements: ~1.10612.1 Installed: Yes Url: https://www.arduino.cc/en/Main/Software Version: 1.10612.1 (1.6.12) Description: Arduino Wiring-based Framework (AVR Core, 1.6) Package framework-simba ----------------------- Type: framework Requirements: >=7.0.0 Installed: Yes Url: https://github.com/eerimoq/simba Version: 11.0.0 Description: Simba Embedded Programming Platform Package tool-avrdude -------------------- Type: uploader Requirements: ~1.60300.0 Installed: Yes Description: AVRDUDE Url: http://www.nongnu.org/avrdude/ Version: 1.60300.0 (6.3.0) Package tool-micronucleus ------------------------- Type: uploader Requirements: ~1.200.0 Installed: No (optional) ``` -------------------------------- ### Get a Specific Setting Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/cmd_settings.md Use this command to retrieve the value of a specific PlatformIO setting by its name. For example, to get the 'check_platformio_interval' setting. ```bash pio settings get [NAME] ``` -------------------------------- ### Build Multiple Project Environments Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/cmd_run.md This example demonstrates how to build a project for multiple environments simultaneously using the 'pio run' command with the '-e' option. It shows the output for building 'nodemcu' and 'teensy31' environments, including compilation, linking, and size calculation. ```bash > pio run -e nodemcu -e teensy31 [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 =========================== ``` -------------------------------- ### Dump PlatformIO Core Installation State Source: https://github.com/platformio/platformio-docs/blob/develop/core/installation/integration.md Use this command to get detailed information about the PlatformIO Core installation state and save it to a JSON file. This is useful for programmatic access to installation details. ```bash get-platformio.py check core --dump-state tmpdir/pioinstaller-state.json ``` -------------------------------- ### Install Package with Version Requirements Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install the latest package version that satisfies specified version requirements using the `@` syntax. This example installs ArduinoJson versions greater than or equal to 6, excluding version 6.13.0. ```shell bblanchon/ArduinoJson@>=6,!=6.13.0 ``` -------------------------------- ### Install Specific Package Version Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install a precise version of a package from the PlatformIO Registry by appending `@` to the package identifier. This example specifies version 6.9.12 for ArduinoJson. ```shell bblanchon/ArduinoJson@6.9.12 ``` -------------------------------- ### PlatformIO Arduino Project Example Source: https://github.com/platformio/platformio-docs/blob/develop/integration/ide/cloud9.md Example 'main.cpp' file for a PlatformIO project in Cloud9. Includes basic Arduino setup and a loop for serial communication and counter increment. ```c++ #include int i = 0; void setup() { Serial.begin(9600); Serial.println("Hello Cloud9!"); } void loop() { /* serial echo */ while (Serial.available()) { Serial.write(Serial.read()); } i++; Serial.println(i); delay(100); } ``` -------------------------------- ### Initialize Project for Arduino Uno Board Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/project/cmd_init.md Initialize a new PlatformIO project specifically configured for the Arduino Uno board. ```bash > pio project init --board uno The current working directory *** will be used for the new project. You can specify another project directory via `pio project init -d %PATH_TO_THE_PROJECT_DIR%` command. ... ``` -------------------------------- ### Install from remote TAR archive URL Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/pkg/cmd_install.md Install a package by fetching and extracting a .tar.gz archive from a remote URL. The URL must start with http:// or https://. ```shell https://github.com/bblanchon/ArduinoJson/archive/refs/heads/6.x.tar.gz ``` -------------------------------- ### Example Output for 'pio lib show' Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/lib/cmd_show.md This is an example of the detailed output provided by the 'pio lib show' command when querying the 'OneWire' library. It includes metadata such as ID, description, version, manifest URL, homepage, repository, authors, keywords, compatible frameworks, platforms, headers, examples, and download statistics. This command is deprecated. ```text > pio lib show OneWire PubSubClient ============ #ID: 89 A client library for MQTT messaging. MQTT is a lightweight messaging protocol ideal for small devices. This library allows you to send and receive MQTT messages. It supports the latest MQTT 3.1.1 protocol and can be configured to use the older MQTT 3.1... Version: 2.6, released 10 months ago Manifest: https://raw.githubusercontent.com/ivankravets/pubsubclient/patch-2/library.json Homepage: http://pubsubclient.knolleary.net Repository: https://github.com/knolleary/pubsubclient.git Authors ------- Nick O'Leary https://github.com/knolleary Keywords -------- ethernet mqtt iot m2m Compatible frameworks --------------------- Arduino Compatible platforms -------------------- Atmel AVR Atmel SAM Espressif 8266 Intel ARC32 Microchip PIC32 Nordic nRF51 Teensy TI MSP430 Headers ------- PubSubClient.h Examples -------- http://dl.platformio.org/libraries/examples/0/89/mqtt_auth.ino http://dl.platformio.org/libraries/examples/0/89/mqtt_basic.ino http://dl.platformio.org/libraries/examples/0/89/mqtt_esp8266.ino http://dl.platformio.org/libraries/examples/0/89/mqtt_publish_in_callback.ino http://dl.platformio.org/libraries/examples/0/89/mqtt_reconnect_nonblocking.ino http://dl.platformio.org/libraries/examples/0/89/mqtt_stream.ino Versions -------- 2.6, released 10 months ago Downloads --------- Today: 25 Week: 120 Month: 462 ``` -------------------------------- ### Configure Board and Platform Source: https://github.com/platformio/platformio-docs/blob/develop/boards/ststm32/ublox_c030_u201.md Specify the board and platform for the u-blox C030-U201 IoT Starter Kit in your 'platformio.ini' file. ```ini [env:ublox_c030_u201] platform = ststm32 board = ublox_c030_u201 ``` -------------------------------- ### Configure Seeeduino Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/atmelavr/seeeduino.md Use the 'seeeduino' ID for the board option in your platformio.ini file. This is the basic configuration to get started. ```ini [env:seeeduino] platform = atmelavr board = seeeduino ``` -------------------------------- ### Configure ElectronutLabs Papyr Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/nordicnrf52/electronut_papyr.md Use the `electronut_papyr` ID for the board option in your platformio.ini file. This is the basic configuration to get started. ```ini [env:electronut_papyr] platform = nordicnrf52 board = electronut_papyr ``` -------------------------------- ### Example: Target with Options Source: https://github.com/platformio/platformio-docs/blob/develop/scripting/custom_targets.md Demonstrates creating a target that utilizes project configuration options and executes a Python callback. ```APIDOC ## Example: Target with Options ### Description Creates a custom target that uses project configuration options and executes a Python callback function. ### `platformio.ini` Configuration ```ini [env:env_custom_target] platform = ... ... extra_scripts = extra_script.py custom_ping_host = google.com ``` ### `extra_script.py` Implementation ```python Import("env") host = env.GetProjectOption("custom_ping_host") def mytarget_callback(*args, **kwargs): print("Hello PlatformIO!") env.Execute("ping " + host) env.AddCustomTarget("ping", None, mytarget_callback) ``` ### Usage Run `pio run --target ping`. ``` -------------------------------- ### Configure Pic32 CUI32-Development Stick Source: https://github.com/platformio/platformio-docs/blob/develop/boards/microchippic32/cui32.md Use the 'cui32' ID for the board option in your platformio.ini file. This is the basic configuration to get started. ```ini [env:cui32] platform = microchippic32 board = cui32 ``` -------------------------------- ### Install PlatformIO Core with wget (macOS/Linux) Source: https://github.com/platformio/platformio-docs/blob/develop/core/installation/methods/installer-script.md Use this command to download the installer script using wget and then execute it with python3. This method is suitable for macOS and Linux. ```bash wget -O get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py python3 get-platformio.py ``` -------------------------------- ### Install Library from Archive URL Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/lib/cmd_install.md Installs a library from a ZIP archive hosted at a given URL into the global storage. Shows the download and unpacking process. ```bash > pio lib -g install https://github.com/adafruit/DHT-sensor-library/archive/master.zip Library Storage: /storage/dir/... LibraryManager: Installing master Downloading [####################################] 100% Unpacking [####################################] 100% DHT sensor library @ 1.2.3 has been successfully installed! ``` -------------------------------- ### Configure LilyGo T3-S3 Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/espressif32/lilygo-t3-s3.md Use 'lilygo-t3-s3' ID for the board option in your platformio.ini file. This is the basic configuration to get started. ```ini [env:lilygo-t3-s3] platform = espressif32 board = lilygo-t3-s3 ``` -------------------------------- ### Configure ATtiny1617 Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/atmelmegaavr/ATtiny1617.md Use this configuration in your platformio.ini file to set up the ATtiny1617 board. This is the basic setup required to start a project. ```ini [env:ATtiny1617] platform = atmelmegaavr board = ATtiny1617 ``` -------------------------------- ### Configure QEMU in platformio.ini Source: https://github.com/platformio/platformio-docs/blob/develop/advanced/unit-testing/simulators/qemu.md Add the QEMU tool package and specify the testing command in your `platformio.ini` file. This setup is board-specific and requires the correct path to the QEMU executable. ```ini [env:hifive1] platform = sifive framework = freedom-e-sdk board = hifive1 platform_packages = platformio/tool-qemu-riscv test_testing_command = ${platformio.packages_dir}/tool-qemu-riscv/bin/qemu-system-riscv32 -nographic -machine sifive_e -kernel ${platformio.build_dir}/${this.__env__}/firmware.elf ``` -------------------------------- ### Initialize Project with Additional Options Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/project/cmd_init.md Add custom options to the platformio.ini file during project initialization. Multiple options can be provided. ```bash pio project init --project-option="lib_deps=ArduinoJSON" ``` -------------------------------- ### Configure STC8H1K16 Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/intel_mcs51/STC8H1K16.md Use this configuration in your 'platformio.ini' file to set up the Generic STC8H1K16 board. This is the basic setup required to start a project. ```ini [env:STC8H1K16] platform = intel_mcs51 board = STC8H1K16 ``` -------------------------------- ### List Available Boards (CLI) Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/cmd_boards.md Use this command to view all pre-configured embedded boards supported by PlatformIO. No specific setup is required beyond having PlatformIO installed. ```bash pio boards [OPTIONS] [FILTER] ``` -------------------------------- ### Initialize Project with Environment and Build Flags Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/project/cmd_init.md Initialize a new PlatformIO project, specifying a working environment name and custom build options like platform and build flags. ```bash > pio project init --environment native --project-option="platform=native" --project-option="build_flags=-DRELEASE=1" The current working directory *** will be used for the new project. ... ``` -------------------------------- ### Configure WeAct Studio MiniSTM32H750VBTX Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/ststm32/weact_mini_h750vbtx.md Use this configuration in your platformio.ini file to set up the WeAct Studio MiniSTM32H750VBTX board. This is the basic setup required to start a project. ```ini [env:weact_mini_h750vbtx] platform = ststm32 board = weact_mini_h750vbtx ``` -------------------------------- ### Configure ST Nucleo L486RG Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/ststm32/nucleo_l486rg.md Use this configuration in your platformio.ini file to set up the ST Nucleo L486RG board. This is the basic setup required to start a project. ```ini [env:nucleo_l486rg] platform = ststm32 board = nucleo_l486rg ``` -------------------------------- ### Configure ST Nucleo F746ZG Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/ststm32/nucleo_f746zg.md Use this configuration in your 'platformio.ini' file to set up the ST Nucleo F746ZG board. This is the basic setup required to start a project. ```ini [env:nucleo_f746zg] platform = ststm32 board = nucleo_f746zg ``` -------------------------------- ### Build PlatformIO Examples with pio ci Source: https://github.com/platformio/platformio-docs/blob/develop/integration/ci/github-actions.md This workflow is suitable for library development. It uses `pio ci` to build examples, allowing specification of multiple boards and setting the source file via an environment variable. ```yaml name: PlatformIO CI on: [push] jobs: build: runs-on: ubuntu-latest strategy: matrix: example: [path/to/test/file.c, examples/file.ino, path/to/test/directory] steps: - uses: actions/checkout@v6 - uses: actions/cache@v4 with: path: | ~/.cache/pip ~/.platformio/.cache key: ${{ runner.os }}-pio - uses: actions/setup-python@v6 with: python-version: '3.11' - name: Install PlatformIO Core run: pip install --upgrade platformio - name: Build PlatformIO examples run: pio ci --board= --board= --board= env: PLATFORMIO_CI_SRC: ${{ matrix.example }} ``` -------------------------------- ### Configure MGBOT IOTIK 32A Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/espressif32/mgbot-iotik32a.md Use this configuration in your platformio.ini file to set up the MGBOT IOTIK 32A board. This is the basic setup required to start a project. ```ini [env:mgbot-iotik32a] platform = espressif32 board = mgbot-iotik32a ``` -------------------------------- ### Configure WEMOS LOLIN S3 Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/espressif32/lolin_s3.md Use this configuration in your platformio.ini file to set up the WEMOS LOLIN S3 board. This is the basic setup required to start a project. ```ini [env:lolin_s3] platform = espressif32 board = lolin_s3 ``` -------------------------------- ### Initialize New PlatformIO Project Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/project/cmd_init.md Use this command to create a new PlatformIO project structure. It generates essential files and directories like platformio.ini, include/, src/, lib/, and test/. ```bash pio project init [OPTIONS] ``` -------------------------------- ### Enable PVS-Studio in platformio.ini Source: https://github.com/platformio/platformio-docs/blob/develop/advanced/static-code-analysis/tools/pvs-studio.md To enable PVS-Studio, add 'pvs-studio' to the 'check_tool' option in your project's platformio.ini file. This is the basic setup required to start using the tool. ```ini [env:myenv] platform = ... board = ... check_tool = pvs-studio ``` -------------------------------- ### Configure OpenOCD Debug Server Source: https://github.com/platformio/platformio-docs/blob/develop/projectconf/sections/env/options/debug/debug_server.md This example shows how to configure OpenOCD as a custom debug server, specifying its executable path and configuration script. Ensure OpenOCD is installed and accessible. ```ini [env:debug_openocd] platform = ... board = ... debug_tool = custom debug_server = ${platformio.packages_dir}/tool-openocd/openocd -f ${platformio.packages_dir}/tool-openocd/scripts/board/stm32f103zet6_warship.cfg ``` -------------------------------- ### Initialize Project with Specific Board Source: https://github.com/platformio/platformio-docs/blob/develop/core/userguide/project/cmd_init.md Specify a target board ID to automatically configure the 'platform', 'framework', and 'board' settings in the platformio.ini file. ```bash pio project init --board ``` -------------------------------- ### Configure WEMOS LOLIN S2 Mini Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/espressif32/lolin_s2_mini.md Use this configuration in your platformio.ini file to set up the WEMOS LOLIN S2 Mini board. This is the basic setup required to start a project. ```ini [env:lolin_s2_mini] platform = espressif32 board = lolin_s2_mini ``` -------------------------------- ### Initialize avr-stub Debugger in Arduino Application Source: https://github.com/platformio/platformio-docs/blob/develop/plus/debug-tools/avr-stub_extra.rst Include necessary headers and call debug_init() at the beginning of your setup function to enable the GDB stub. This example shows initialization within an Arduino sketch. ```cpp #include "Arduino.h" #include "avr8-stub.h" #include "app_api.h" // only needed with flash breakpoints void setup() { // initialize GDB stub debug_init(); pinMode(LED_BUILTIN, OUTPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); } ``` -------------------------------- ### Configure Arduino Robot Control Board Source: https://github.com/platformio/platformio-docs/blob/develop/boards/atmelavr/robotControl.md Use `robotControl` ID for the `board` option in your `platformio.ini` file to configure the Arduino Robot Control board. This is the basic setup required to start a project. ```ini [env:robotControl] platform = atmelavr board = robotControl ``` -------------------------------- ### Enable Custom System Setup Implementation Source: https://github.com/platformio/platformio-docs/blob/develop/frameworks/stm32cube_extra.rst Set `custom_system_setup` to `yes` to prevent PlatformIO from compiling default system startup implementations. This is useful if your project already provides its own system setup code. ```ini [env:nucleo_f401re] platform = ststm32 framework = stm32cube board = nucleo_f401re board_build.stm32cube.custom_system_setup = yes ```