I’m currently (happily) using platformio and I’m trying it out also to develop arduino libraries.
The pio ci command plays perfectly with the examples folders, but I could not find a similar way to be able to pio run and upload a specific example to my board.
My current “poor man” options are:
link the file of the/one example into the src folder and execute pio run
Hrm, I’m afraid I don’t quite follow. I’ve got a local git tree for, say, esp8266/Arduino. I want to work on my own application, with my own local changes to the arduino core. Espressif 8266 — PlatformIO v6.1 documentation seems sort of on the right path, but only let’s me work with a published branch, not my local code still in development. I’m not sure how the CI commands help?
… would be called when using the micro board type …
pio ci -c platformio.ini --lib="." --board="micro" examples/blinkingLeds/blinkingLeds.ino
In this instance, I told it to use the lib relative from the directory I was running from/working directory, so it didn’t install anything… which is how I would use it in say a TravisCI job, as a prior stage would do the git pull of the library into the working directory.
Same here… saves full rebuild when I stuff up the code royaly or OTA goes flaky.
I’m starting to see what you mean… if you want the CI to only build certain boards, but need them customised (so you can’t just use the default configuration and the --boards="board_name" parameter… ) … then yeah, it looks like you’d need to use separate configuration files, else it will build all of the configured boards.
And it probably doesn’t read the [lib_dirs] parameter because it’s in the global [platformio] configuration block… but is that actually a problem? [lib_dirs] is the same as the --lib parameter … and since you’re refering to the downloads… may you mean the globallib_dir option? And yes, it also doesn’t seems to get read from the platformio.ini… but IS read from the environment variable… have a look at where warning related to the Button library says the file is located… I only had to install it once via the global library option (with the environment variable pointing to that alternate global library path also)… and all the ci builds keep pulling it from there, instead of downloading it each time.
[pfeerick@asus-h55d elapsedMillis]$ PLATFORMIO_GLOBALLIB_DIR="/tmp/pio-ci-libs" pio ci -c ../ci-boards --lib "." examples/blinkingLeds/blinkingLeds.ino --build-dir /tmp/pio-ci
The next files/directories have been created in /tmp/pio-ci
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File
Project has been successfully updated! Useful commands:
`pio run` - process/build project from the current directory
`pio run --target upload` or `pio run -t upload` - upload firmware to a target
`pio run --target clean` - clean project (remove compiled files)
`pio run --help` - additional information
Processing micro (platform: atmelavr; framework: arduino; board: micro)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Atmel AVR 1.15.0 > Arduino Micro
HARDWARE: ATMEGA32U4 16MHz, 2.50KB RAM, 28KB Flash
PACKAGES: toolchain-atmelavr 1.50400.190710 (5.4.0), framework-arduinoavr 4.1.1
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 7 compatible libraries
|-- <Button> 1.0.0
|-- <elapsedMillis> 1.0.5
In file included from /tmp/pio-ci-libs/Button_ID919/Button.cpp:7:0:
/tmp/pio-ci-libs/Button_ID919/Button.h: In constructor 'Button::Button(uint8_t)':
/tmp/pio-ci-libs/Button_ID919/Button.h:30:12: warning: 'Button::_ignore_until' will be initialized after [-Wreorder]