I have a big conceptual problem with your CLI. I have two Photons and have set them up, written programs for them and am using them to measure temperature and humidities, publishing these values to the web. I successfully use the Particle build environment to compile and flash programs. I have a web server set up on a VPS that allows me to query the Photons. So I can do lots of things I want with them.
But in exploring the documentation I came across the CLI section and I want to use it an alternative to Build. But I am stumped about where it runs, how or if it connects to the Photon and what it does.
It is not actually explicitly mentioned but it looks like it runs as a
nodejs program on a user’s PC or MAC running Linux, Windows or the OSX, and communicates with the particle cloud via the internet and the user’s Photon devices via a usb serial port. It seems to provide functions for flashing devices, installing webhooks, listing devices, etc. I want to do these using the CLI as an alternative to Build.
Now I don’t have a PC or MAC available and have been doing all my work on a chromebook and virtual private servers (VPS) running Linux. I thought I’d try using the CLI commands that don’t involve connecting directly to the Photon (which is never mentioned directly but assumed by statements like ‘make sure your device is connected’.) So I tried installing the CLI on my VPS and it failed:
henry@ocean1:~$ sudo npm install -g particle-cli .... npm http 200 https://registry.npmjs.org/wordwrap npm http 200 https://registry.npmjs.org/minimist > email@example.com install /usr/local/lib/node_modules/particle-cli/node_modules/serialport > node-pre-gyp install --fallback-to-build /usr/bin/env: node: No such file or directory npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian npm ERR! weird error 127 npm ERR! not ok code 0
Before I spend time debugging the install I thought I’d ask the more fundamental question: Can I run it from a Ubuntu 14.04 VPS and do things that don’t involve direct connection to a Photon?