# Local Compile and particle dev

**URL:** <https://community.particle.io/t/local-compile-and-particle-dev/14671>\
**Category:** General\
**Created:** [August 23, 2015, 6:33pm UTC](https://community.particle.io/t/local-compile-and-particle-dev/14671 "2015-08-23T18:33:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frlobo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frlobo/32/1279_2.png) [@frlobo](https://community.particle.io/u/frlobo)\
**Post date:** [August 23, 2015, 6:33pm UTC](https://community.particle.io/t/local-compile-and-particle-dev/14671/1 "2015-08-23T18:33:05Z")

</div>

I think that local compile and dfu should babe possible with particle dev as an option. Yesterday compile in the cloud outage should be the perfect example as to why.

I know that local compile is possible, but it does take some time and effort on the user side (Did that yesterday to keep on working). I think particle dev should be akin arduino ide. I don’t mind the default being cloud compile but have the option to local compile easily.

I know the risks of the local repository being out of date , but this is something you can address with a menu comman ‘update local tools’ or a similar mechanism.

Anyway, I do think that this is a feature that needs to be implemented soon in the roadmap.

---

<div class="post-metadata">

**Author:** ![Awake](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Awake](https://community.particle.io/u/Awake)\
**Post date:** [August 24, 2015, 2:50am UTC](https://community.particle.io/t/local-compile-and-particle-dev/14671/2 "2015-08-24T02:50:56Z")

</div>

I second that proposal.  
We should not be so dependent on online only tools that can be broken at one central location. The currently ongoing firmware auto-update fiasco is another example of frustrating and dangerous practices (that has cost me many mystery debugging hours) that can be avoided by giving the local developer full control over what changes. If I know that I am developing in a stable yet obsolete environment, with known problems (for example bad I2C implementation), that is OK. If I run into some obstacle that has a documented solution in a newer version, then I can manually choose to make changes.  
Add some USB based utilities to facilitate starting up the device (link to AP and register), reset to factory option.  
In reality, I should be able to buy, configure, develop for, deploy and maintain a Photon without ANY Particle online dependencies unless I explicitly build them in.  
So yes, give us a more robust “Arduino like” stand alone IDE.

---

<div class="post-metadata">

**Author:** ![chuank](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/chuank/32/3617_2.png) [@chuank](https://community.particle.io/u/chuank)\
**Post date:** [August 24, 2015, 3:23am UTC](https://community.particle.io/t/local-compile-and-particle-dev/14671/3 "2015-08-24T03:23:31Z")

</div>

Same thoughts here, although I'll also add that @suda has identified cloud configuration selection (and hopefully, by extension, local compiles + uploads) as a future enhancement in Particle Dev: [Option to select between Particle.io or local cloud to send OTA updates to devices · Issue #86 · particle-iot-archived/particle-dev · GitHub](https://github.com/spark/spark-dev/issues/86)

While waiting for that to happen, I wrote an [atom.io](http://atom.io) package to handle offline compiles+uploads for use with atom. I haven't tried installing my package within Particle Dev itself, but it should be possible, too.

It's not the cleanest solution, and there are issues related to the refresh/selection of the serial ports (especially if you work with multiple devices simultaneously), so ymmv!

> [@Particle-offline-compiler: atom package for 100% local compiling + auto DFU update](https://community.particle.io/t/particle-offline-compiler-atom-package-for-100-local-compiling-auto-dfu-update/14068):
>
> If you’re developing on a local cloud or need to compile locally, you currently have particle-cli which is fantastic for getting all things Particle setup via command line. It’s a good chance that you’re using some IDE or text editor to write your code, which results in a bit of a shuffle between your terminal and IDE, to execute the make/upload scripts and testing your work. I wrote a basic Atom package that supports a faster workflow for those of us developing ‘off the [Particle.io](http://Particle.io) grid’ – i…

(EDIT: finally fixed the [atom.io](http://atom.io) package – you should now be able to install it directly from atom – search for the [**particle-local-compiler**](https://atom.io/packages/particle-offline-compiler) package)

If you're using atom, ensure you `#include "application.h"`, use `.cpp` file extensions and your code should compile locally. Also, `.cpp/.h` libraries should be in the same folder as your main sketch. Finally, you'll have to declare your prototypes manually, either in a `.h` file or at the top of your main `.cpp` file.

If I get the time, I'll see to the cleaning up of the package and also testing it within Particle Dev.
