Po-util: The Ultimate Local Particle Experience for Linux and macOS

electron
boron
argon
xenon
photon
Tags: #<Tag:0x00007f1ca247a868> #<Tag:0x00007f1ca247a598> #<Tag:0x00007f1ca247a430> #<Tag:0x00007f1ca247a2f0> #<Tag:0x00007f1ca247a188>

#103

You should make sure you are using https://github.com/nrobinson2000/po, not the older repository.

You can install it with:

bash <(curl -sL get.po-util.com)

For photon, I recommend v0.8.0-rc.14 for the Particle branch, duo for the Redbear Duo branch and no for the headers.

Also, how are you using cloud9? I’ve used it in the past but now it appears to have been bought out by Amazon and no longer uses ubuntu. I made a new workspace, and I tried to install po but it failed.

Oh wait. The old c9.io is still up.


#104

Yeh I used the old repo.

I don’t think cloud9 likes

bash <(curl -sL get.po-util.com)

oh. I will just try the new repo above.

Cloud9 now needs a credit card just to try it. Is that still the same?


#105

Here are the steps to get (the old) c9.io working for argon:

sudo rm -rf /.dockerenv
sudo rm -rf ~/.nvm
bash <(curl -sL get.po-util.com) # Press enter at the prompt
# For the config options (separate lines) do: v0.8.0-rc.27 duo no
# Wait for the installer to finish
po config v0.8.0-rc.27
po setup-mesh # This is when the c9 drive literally ran out of space
cd ~/workspace
po argon init .

EDIT:
Running this caused the c9.io workspace (2gb) to overfill.

The extra mesh dependencies are simply too large for c9.


#106

I have a premium account so will see if it works for me.


#107

Ok. The commands above should work.


#108

Why are these important. They remove the docker and node virtual manager??


#109

Yeah, deleting .dockerenv makes po-util treat c9 like a normal ubuntu system which is what we want for c9.

Deleting nvm (node version manager) makes c9 use the version of node po-util installs in order to install particle-cli successfully.


#110

Over the last few years it would have been nice to know that little trick.

P.S. I thought I was good at bash programming, but you are at a totally different level. This stuff is amazing.


#111

So that was amazing.

Built the workspace-argon.bin file and used 3Gb of disk space.

I will try this on my laptop which should let me flash the code.

Thanks @nrobinson2000. Today was a very good day.


#112

Sorry, the Disk was 2gb, the memory was 500mb. 2gb was not enough disk space.

po should install much more easily on ubuntu running on your laptop.

This is all you should need:

bash <(curl -sL get.po-util.com) # Press enter at the prompt
# For the config options (separate lines) do: v0.8.0-rc.27 duo no
# Wait for the installer to finish
po config v0.8.0-rc.27
po setup-mesh

EDIT:
Sorry for any confusion I really need to update the documentation. :wink:

If you need direct support again I’d recommend trying the gitter.im chatroom or sending me a PM. This thread is getting long.


#113

Particle released Device OS v1.0.0 today. I just wanted to mention that it is supported in po-util.

To get v1.0.0 all you need to do is:

po update
po config v1.0.0

#114

I have added support for Particle’s official project structure to po-util. Any project created with Particle CLI or Particle Workbench can now be built using po-util.

To get the update you’ll need to run the following:

po update
po install

There are a few new commands that allow you to build the official structure:

First you must have a Particle project you want to build. If you need to make one you can do:

particle project create . --name myProject
cd myProject

The new commands are build-beta, flash-beta, and clean-beta. You can run them like so:

po PLATFORM build-beta
po PLATFORM flash-beta
po PLATFORM clean-beta

In addition, all of the options from Particle Workbench are supported:

clean-user
clean-all
clean-debug

compile-user
compile-all
compile-debug

flash-user
flash-all
flash-debug

To use the options you can use the run command.

Example: if you want to build the user firmware for a photon you could do:

po photon run compile-user

If you forget any of these options you can press the TAB key after run to autocomplete the different options. In case you didn’t know, po-util has TAB completion for nearly all commands, making it much easier to choose the arguments you want.


#115

I’ve made a flowchart for po-util’s command line arguments with draw.io

https://github.com/nrobinson2000/po/blob/master/po-util-flowchart.pdf


#116

I’ve been using this feature: very nice! But it only seems to work for flashing locally? E.g. while po boron flash-beta works, po boron ota doesn’t… It says “Firmware directory not found!”…


#117

This command relies on building a project using the old structure.

You can still flash the .bin that gets created in target


#118

How?


#119

With something like this:

particle flash YOURDEVICE target/YOURFIRMWARE.bin

#120

I’d like to use po-util with my own version (fork) of the device-os and I’m wondering what I need to do for that to be reasonably smooth.

I’ve been compiling locally for a boron using po boron flash-beta and that worked great. But now I’d like to expose a few additional “system calls” from the device-os core so I can access the littlefs. Building the monolithic firmware works, but it’s pretty slow (erasing the flash alone takes a while), so I’m thinking of forking device-os and tweaking it. Questions:

  • Do I just go into ~/.po-util/src/particle/firmware and change the git checkout?
  • Or do I risk my version (which I’ll be editing) being updated or messed with (possibly by accident if I type the wrong po-util command)?
  • Is there something simple I can do so it won’t mess with that dir?
  • I haven’t dug into the po-util code, is the worst case a git checkout to the std branch or is there code that rm’s the whole subtree and re-downloads?

Thanks for an awesome tool!


#121

The easiest way would be to edit ~/.po-util/config and change FIRMWARE_PARTICLE to the path of your device-os version.

po-util does do git stash on the device-os repo whenever you clean a project or upgrade the device-os on a device (which makes sense for official device-os but may be a problem for you).

I’m planning on slimming down po-util in the future, letting particle-cli and the workbench makefile do most of the work.


#122

Thanks for the quick reply. Yes, leveraging the particle stuff more seems to make sense and should reduce your maintenance task!