Going from local build to cloud upload

Currently I developed my code locally. I use the application.cpp file and I’ve created a lot of other .h and .cpp files which I compile with the ARM GGC and the DFU Bootloader on OSX (I set everything up based on this tutorial.

Right now I’d like to start to deploy my code on 5 devices over WiFi/Cloud. I get confused about all the options. I’m wondering if I need to add my code directly as a product, or if I can Flash my code to each of the 5 devices separately as well?

I prefer to use the Desktop IDE or the Particle CLI

My first try was to use the Particle command line interface. I tried to run particle compile photon application.cpp but it kind find my included .h files (my code compiles perfectly with Make).

I don’t know if I need the CLI to compile my code? Or if I just can use the binary which is compile it with ARM GGC?

What would be a recommend directory structure for included files. Is it advisable to make a kind of private library? To library structure changed lately, so I’m a bit confused what is the best road to take.

This feels a bit like a noob question to me. So maybe the answers are just in front of me and I didn’t look good enough.

@kasper, do you want to use your locally built binary and upload that OTA?
If so, that can be done with CLI quite easily.

particle flash <yourDeviceName> <yourBinaryFile.bin>
1 Like

Did you see the following docs?

and Moors7 answer here:

1 Like

@ScruffR Good to know that that is possible as well. I’m still wondering about the directory structure. Because particle compile photon also seems to start the ARM compiler?

@Postler: I’ll give the dev another try. I seems that that guide also has some good tips about the directory structure.

Have you tried po-util? It's a tool I made to expedite local building. It supports a flexible project structure and it has keyboard shortcuts for building a project within Atom (Particle Dev).

With po-util you sequentially flash firmware over the air using just one command.

On OSX, you can install po-util using Homebrew:

$ brew tap nrobinson2000/po
$ brew install po
$ po install

Message me or join the po-util community if you have any questions. I think you will enjoy using po-util.

1 Like

@nrobinson2000 Thanks for making me aware of this tool. I came across your tool when I started about a year ago with Particle, but it seems better documented right now. I’ll check it out for sure. I like how the bin file is in the directory structure.

I suppose I have to make a choice though, because each method seems to have its own directory structure.

By the way I think in your documentation you should update the #include "application.h" to the currently used #include Particle.h ?

Thanks for spotting that. Po-util does use #include "Particle.h" when initializing a project, but I hadn't fixed that mention of application.h in the documentation.

I'll update the documentation now.