particle-offline-compiler

100% offline compiling + upload workflow for Particle devices. Please see readme for prerequisites.

Chuan Khoo

1,578

0

0.1.3

MIT

GitHub

particle-offline-compiler

An Atom / Particle Dev package for 100% offline code compilation for Particle Devices.

For situations where you need to compile and test Particle projects locally, and keep to a streamlined workflow.

This should be compatible with projects that connect to Particle.io, or if you're deploying your own local cloud.

Requirements

  1. particle local compiler
    Install the Particle local compiler (full instructions here), including dependencies.

    This package also assumes that you have the latest particle-cli installed on your system – this will be required for OTA updates (coming soon)

  2. particle-cli
    To install particle-cli:

    $ npm install -g particle-cli
    $ particle cloud login
    

Installation

In atom / Particle Dev > Preferences > Install, search for particle-offline-compiler and install it.

Before using it, open up the settings on the package, and enter the Particle Compiler Path – this should point to the location where you downloaded and compiled the particle local compiler (see instructions above). The Device Type and Serial Port can be left empty, as they can be set easily in the Particle.offline user menu.

Once installed, you should see a Particle.offline menubar with self-explanatory options listed.

Usage Instructions

OSX – Important note on environment variables:

In order for all of your PATH environment variables to be picked up, launch Atom from the terminal:

$ open -a "/Applications/Atom.app"

or, if you have already installed the Atom Shell commands:

$ atom

If you're using Particle Dev, launch the application similarly from Terminal:

open -a "/Applications/Particle Dev.app"

If you skip this step, the compile will not be able to find arm-none-eabi-gcc in your PATH environment variable, as the standard PATH launched from a Finder instance of Atom most likely excludes the gcc compiler location (default: /usr/local/bin).

Work in progress!

This is a work in progress.

At this point the package is only tested on OSX Yosemite, Atom 1.0.3+ and Particle Dev 0.0.25. YMMV.

Compiler output is currently dumped out the Javascript console – sorry to those who prefer spiffier GUIs, but the console is good enough for now to figure out what's going on during the compile process. Perhaps a proper view with syntax coloring can be considered in the future.

Dfu-util has a bug where the conclusion of every firmware upload presents STDERR: dfu-util: Error during download get_status, despite the firmware uploading OK. This can be safely ignored.

Key features:

Wait, isn't there Particle Dev that does the same thing?

Yes and no. Particle Dev, which was built on top of Atom Shell a.k.a. Electron, is a fantastic project that addresses a specific need – quick, easy local development (and storage) of code, with firmware builds/uploads still routed through Particle.io for ease of use. This same ease of use presents workflow obstacles when it comes to local cloud development, and slows down development massively.

This package was developed to improve workflow bottlenecks of the existing official Particle IDEs (Build Web IDE and Particle Dev).

If you encounter any of these scenarios, I hope this package will be of help:

It's worth noting that Particle Dev (and the Particle platform at large) goes through continuous development, and will eventually implement much better development workflows. This tiny Atom package might be helpful for those who want an immediate, interim solution to a faster workflow for local-cloud and/or offline Particle projects.