Neopo: A lightweight solution for local Particle development

Hello everyone.

I am proud to announce the release of neopo, a utility for locally building and flashing Particle projects to Particle devices that integrates with Particle Workbench.

TL;DR

I’ve made a replacement for po and po-util written in Python that is fully compatible with Particle Workbench and particle-cli. Here is the GitHub repository:

You can install neopo with the following command:

$ bash <( curl -sL https://git.io/JfwhJ )

Story

Four years ago I created po-util, a large, messy shell script for building, flashing, and interacting with Particle devices. After maintaining it for two years, it was in desperate need of a rewrite because the script was over 2,000 lines long.

I created a new repository called po and continued development there, breaking up the script into multiple files and taking on dependencies in a vain attempt to improve the maintainability of the project. Over the past year, I only made a few updates to po, letting the project grow stale. It grew stale because I had not fully integrated the project with newly developed tools like Workbench and the improvements made to particle-cli.

Since the initial release of Workbench, I dreamed of integrating its features and dependencies into a slick, useful tool that can be used on Linux and macOS independent from the GUI of Visual Studio Code.

In the past week, I’ve realized that dream. Neopo natively uses the Workbench project format and relies on the same dependencies and Makefile. It can even manage dependencies as well. Overall, not only is neopo an excellent companion to Workbench, but it offers unparalleled utility in build environments where Workbench is not an option as well.

To all users of po, I highly recommend switching over to neopo for your local Particle needs, as it is an immense improvement over the previous project. To everyone else, I would greatly appreciate it if you could give neopo a try.

I await your feedback and bug reports. Feel free to make an issue on the GitHub repository.

6 Likes

Update: Raspberry Pi support

Last night I compiled gcc-arm 5.3.1 for the Raspberry Pi. I have uploaded the compiled toolchain to the neopo repository on GitHub. Now when you install neopo on a Raspberry Pi it will download my compiled toolchain instead of the x86 toolchain hosted on binaries.particle.io

I’ve also fixed the install script to download the required dependencies for Particle CLI.

Neopo now works fully on Raspberry Pi.


I timed the compilation of an empty cleaned project on a Raspberry Pi4 with:

time neopo run compile-all

It took 3m53.841s to compile, compared to my Linux desktop which took 0m45.049s.

Building again without cleaning first took 0m7.179s on the Pi4, versus 0m1.622s on my Linux desktop.

2 Likes

If anyone wants to try to get neopo working on Windows I’d greatly appreciate it if you could share your results.

great work Nathan.

Why would one use neopo vs just using the Workbench?
I looked at the examples and couldn’t figure it out.
Thanks!

Thanks Gustavo.

Since the early days of Particle Dev and Particle Workbench, there have been many scenarios where other developers and I have needed a tool that could be used to quickly compile a project or flash firmware to a device without having the time or interest to open up a large IDE.

Back when the Web IDE was king and before Workbench was released, I attempted to build a wrapper around the makefiles in deviceOS, called po-util, or later po, that provided that experience, but it was large and clumsy because the neatly organized and now easily available dependencies of Workbench had not been released yet.

Neopo is most useful for developers who are confident with the command line, as it provides a powerful CLI experience much like Particle CLI but it offers the build features of Workbench.

It’s also incredibly portable and extensible, meaning that it can be easily used in automated, restricted, or remote environments like Travis CI, Raspberry Pi, or any macOS or Linux (Ubuntu/Debian) host.

Since the core functionality of neopo is kept in a single Python script, savvy users can integrate the module into existing Python solutions, providing possibilities for sophisticated Particle development workflows. I’ve done something similar in the past, integrating po into a script that could be used to flash firmware and import devices into a product in series, greatly accelerating the provisioning process.

While neopo is complementary to Particle Workbench, it is by no means a replacement. I have no idea how to implement Intellisense or the Debugger on the command line or in an editor like Vim. Overall, I hope that with the redesigned tool I can provide an improved experience for developers who had used po or po-util in the past, and reach new users who may be interested in improving their Particle development workflow.

alright, thanks Nathan for the extra explanation!
Gustavo.

Update: Windows support

I have added Windows (Cygwin) support for neopo. Here are the installation instructions: https://github.com/nrobinson2000/neopo/blob/master/docs/windows.md

Update:

I have made tons of improvements to neopo over the last month. I’ve also written some documentation: https://nrobinson2000.github.io/neopo/full-docs.html