[OpenTRV-dev] PlatformIO

Jeremy Poulter jeremy at bigjungle.net
Thu Mar 16 11:06:12 GMT 2017


Well spotted ;-) I have the code building via Platform IO, and I am
pondering how to persuade Travis CI to build using both Arduino IDE and
Platform IO, probably going to just have to move the install/build commands
into scripts and use a variable to switch between them,

With regard to your questions;

- Ease of setting up.
Platform IO is comparable to Arduino IDE in terms of setting up. The IDE is
just an install similar to other apps. You still need to a bit of manual
install of the V0p2 board config, but I will fond out from the OEM guys how
to add the config to the main Platform IO repo, I think it is just a case
of a PR.

- Dependency management with versioning etc.
The Libraries have full dependency management specifying specific versions
if needed, and this is project specific so one project does not mess up
others. This is also specified in the project file so makes getting started
far easier compared with Arduino IDE.

- The possibility of supporting another MCU.
Platform IO supports many more MCUs (and CPUs) than Arduino IDE and without
a lot of the messing around adding additional with a board manager as there
is a central (online) repository. However that does not necessarily
translate to easy of moving the OpenTRV code to another CPU, it depends on
how dependant OpenTRV is on the Arduino APIs and AVR. Also it should also
be noted that Arduino IDE also supports a huge range of MCUs these days

- Maintaining support for building on the Arduino IDE.
Platform IO projects can easily be built in Arduino IDE and visa-versa. I
did have to make one change due to some pre-processor weirdness which was
to move the main content of the .ino file to a .cpp file but an empty .ino
file is all that is needed to allow builds in Arduino IDE

Here are some other Platform IO IDE advantages;
- Code completion
- Built on Atom IDE, with access to all the extensions that supports
- Huge development effort and support
- Easy to support building of different configs without changing the code

but there are also some disadvantages;
- I am not aware of any support for flashing bootloaders (but I have not
really looked for any)
- Sometimes there are inconsistencies with Arduino IDE (as mentioned above)
but I have also had weirdness with an Arduino Mega, but even in these cases
I find it a much more pleasant experience to code in Platform IO and just
build with Arduino IDE.

FYI to add the V0p2 support to Platform IO copy
https://github.com/jeremypoulter/OpenTRV-Arduino-V0p2/raw/master/Arduino/hardware/V0p2.json
to ~/.platfomio/boards/

Jeremy


On 14 March 2017 at 15:52, Deniz Erbilgin <deniz.erbilgin at gmail.com> wrote:

> Hi All,
>
> Does anyone have any experience/thoughts on PlatformIO?
>
> Jeremy P has got our code compiling on it and we've been looking for a
> better build environment than the Arduino IDE can currently provide.
>
> We're specifically interested in:
> - Ease of setting up.
> - Dependency management with versioning etc.
> - The possibility of supporting another MCU.
> - Maintaining support for building on the Arduino IDE.
>
> repo here if anyone wants to take a look:
> https://github.com/jeremypoulter/OpenTRV-Arduino-V0p2/tree/master/Arduino
>
> Thanks,
>
> Deniz
>
> _______________________________________________
> OpenTRV-dev mailing list
> OpenTRV-dev at lists.opentrv.org.uk
> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opentrv.org.uk/pipermail/opentrv-dev/attachments/20170316/19b49d02/attachment.html>


More information about the OpenTRV-dev mailing list