Moving project from Web IDE to Particle Dev on a Mac


#1

Is there a page or procedure defined to explain how to move from a successfully built and tested project on the WEB IDE to PARTICLE DEV on a Mac?

Thanks


#2

Unfortunately, for the time being, that would mean copy & paste. You can download the libraries that you’ve used by clicking their github icon.
Keep these points in mind when working with Dev though: Particle Dev Tips

You might find the CLI to be a more comfortable way to work ‘locally’, allowing you to use any IDE you prefer.


#3

Ok Thanks

Still a wee bit uncomfortable with the Particle Editor… (I’m on old SW engineer with 25+ years on Vim+predecessors. ) So… Any suggestions for integrating with my more comfortable vim/gvim/macvim environment?

It would still be nice to use the buttons in the particle env to build/download.

Thanks


#4

@awardblvr

As @Moors7 mentioned you could use particle-cli for terminal based development using Particle’s Servers to compile your code.

I would also suggest trying po-util. Its a tool that I created to provide a local workflow for Particle development. It allows you to easily compile locally and work offline. po-util can be installed with Homebrew on Mac:

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

po-util can work with your preferred terminal based environment or with Atom, the editor Particle Dev is based on.

po-util has its own library manager, so you can easily download and use the libraries used on the Web IDE.

po-util operates with project directories, so that you can have as many separated projects as you want.

Here are the commands to create and build a po-util project for a photon:

$ mkdir particleProject
$ cd particleProject
$ po init photon
$ po photon build

All firmware is kept in the firmware/ directory, primarily in the main.cpp file.

Another feature of po-util is that it supports automatic flashing over USB using dfu-util.

To build and flash you can do:

$ po photon flash

To just flash you can do:

$ po photon dfu

Po-util supports build keyboard shortcuts for Atom. For example, to build you would do CTRL+ALT+1

The rest of the keyboard shortcuts can be found in the manpage for po.


#5

All I can say is that I started following this on Friday after you sent it. It has been nearly flawless and a HUGE productivity booster. I could not get the direct loading part to work, but OTA (“po photon ota …” works perfectly well. I cannot believe your steps worked installing so many utils and dependencies perfectly.

So very very cool Nathan… Very Very cool. The Particle world owes you a big debt. If there were Emmy awards for Particle contribs, you would get one.


#6

You need to upgrade the system firmware on the Photon to allow automatic DFU mode and upload.

$ po photon upgrade

#7

THANKS …Cool… Took a while to remember to put Photon in DFU… But after that… everything perfect and “po photon flash” —> perfection.


#8

That’s great. I’m glad you are enjoying po-util.

I made a page on the po-util wiki with step by step instructions to get started with po-util on Mac to help users interested in po-util.

Also, you can see the full features of po-util by doing man po.


#9

Any news on how Particle’s new Library manager should be used with Nick’s po-util tool set?

Thanks… And especially Nick for this really great environment!


#10

Who is nick? :wink:


#11

oops… Sorry Nathan! hey… it’s a free new name, new identity??? (I won’t make the same mistake again.)


#12

@awardblvr

I am working on adding support for the Particle Library Manager in po-util.

You can now install and use libraries from particle-cli with po-util.

Example:
If you do:

po lib get HttpClient

po-util will use particle-cli to download the library because the argument is not a URL.

You can add a library to a project the same way you would add a Git library:

po lib add HttpClient

Update po-util to get this feature:

po update

#13

Ok Cool But, this did not seem new. Is it? I thought your functionality was always there for this???

Now… HOW do I go in an see the header files for common libraries?

For instance, I want to see what other functions are prototyped wherever “strmp” is proto’d. This so I can see if there is a “safe” version “strncmp” and other related functions. But, all the libraries are kinda obfuscated and I have no idea where to look. Even going to github, it is kinda unclear which repo has, say, the standard stuff that is included when particle.h (application.h) is included.

Any advice appreciated.


#14

This is new. Basically if the argument you supply to po lib get is not URL to a repository, it will use Particle Libraries 2.0 to get the library from Particle.


#15

Thanks… any suggestion on…


#16

The Particle firmware is located in ~/github/firmware.

application.h is located in user/inc

A lot of the stuff is in wiring and system as well.

I think @BDub and @mdma could help refer you to what you are looking for.

I have answered this question here