Particle Photon

Setting up a particle (Spark.io) Photon on OSX El Capitain

Install on OSX fails as described on
https://docs.particle.io/guide/getting-started/connect/photon/

node.js 5


Particle Photon
Particle Photon
First it fails with:

an error that it can’t write to a directory and suggests to run it as administrator.

After executing as sudo npm install -g particle-cli

it fails with:

node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v2.0.2/Release/node-v47-darwin-x64/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v2.0.2/Release/node-v47-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/particle-cli/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:818:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 15.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/particle-cli/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/particle-cli/node_modules/serialport
node-pre-gyp ERR! node -v v5.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.13
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v2.0.2/Release/node-v47-darwin-x64/serialport.node --module_name=serialport --module_path=/usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport/v2.0.2/Release/node-v47-darwin-x64' (1)
npm WARN install:serialport serialport@2.0.2 install: `node-pre-gyp install --fallback-to-build`
npm WARN install:serialport Exit status 1
/usr/local/lib
└── (empty)

npm ERR! code 1

This seems to be fixed with adding –unsafe-perm

sudo npm install –unsafe-perm -g particle-cli

After entering the particle setup procedure it fails with not finding the internet.

After reentering the procedure and asking the photon to scan for networks it hangs.

Ctrl-C’ed out of the setup


! PROTIP: Wireless setup of Photons works like a wizard!
! PROTIP: We will automagically change the Wi-Fi network to which your computer is connected.
! PROTIP: You will lose your connection to the internet periodically.

does not sound very reassuring.

Next attempt to scan: hangs

reattached Photon to USB, pulled out of breadboard.

Next attempt…
Now it tried to attempt to change the network configuration … 3 times and has connected itself to it’s own network and finally found the two access points.

? Would you like to continue with the information shown above? Yes

> Obtaining device information...
> Requesting public key from the device...
> Setting the magical cloud claim code...
> Telling the Photon to apply your Wi-Fi configuration...
> The Photon will now attempt to connect to your Wi-Fi network...

> Configuration complete! You've just won the internet!

Patronising?

? Would you like to return this computer to the wireless network you just configured? Yesn) 
! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! Network not ready yet, retrying...

! It doesn't look like your Photon has made it to the cloud yet.

? What would you like to do? Check again to see if the Photon has connected
! It doesn't look like your Photon has made it to the cloud yet.

? What would you like to do? Check again to see if the Photon has connected
! It doesn't look like your Photon has made it to the cloud yet.

? What would you like to do? Check again to see if the Photon has connected
! It doesn't look like your Photon has made it to the cloud yet.

? What would you like to do? Check again to see if the Photon has connected
! It doesn't look like your Photon has made it to the cloud yet.

? What would you like to do? Check again to see if the Photon has connected
! It doesn't look like your Photon has made it to the cloud yet.

? What would you like to do? Check again to see if the Photon has connected
! It doesn't look like your Photon has made it to the cloud yet.

? What would you like to do? Check again to see if the Photon has connected
! It doesn't look like your Photon has made it to the cloud yet.

? What would you like to do? (Use arrow keys)
❯ Reconfigure the Wi-Fi settings of the Photon 
  Check again to see if the Photon has connected 

Doesn’t seem to work to connect to the same access point as the computer I am sitting on. The wifi did not resolve anything until I stopped it. Then the internet was back on again immediately.

Tried the other access point now no connection can be made from the MacBook Pro to the internet on any access point.

retrying again with the other access point.

now it hangs again … photon does not show up as an access point on the mac ….

So essentially if your mac connects it can’t find access points. If the Mac connects to the photon it finds it, but can’t put the normal connection back on.

Unplugging plugging in again

Setup again

Now it can’t find the photon

Unplugging plugging in again

Blue light blinking slowly

Setup again

> I have detected a Photon connected via USB.
? Would you like to continue with this one? Yes
! The Photon supports secure Wi-Fi setup. We'll try that first.

! PROTIP: Wireless setup of Photons works like a wizard!
! PROTIP: We will automagically change the Wi-Fi network to which your computer is connected.
! PROTIP: You will lose your connection to the internet periodically.

> No nearby Photons detected. Try the `particle help` command for more information.

Apparently the photon is now connected … as it shows a cyan heartbeat.

https://docs.particle.io/guide/getting-started/modes/photon/

Sadly though at the same time the internet on MacOS seems to go down.

After playing around with it and uploading a sketch and trying it on a separate Unix system, this seems to be a frequent occurrence that the network drops on this MacBook Pro Late 2014 16GB + Nvidia etc.

MacOS Wifi outages didn’t happen though while  the Photon is connected to a Ubuntu system about 20 cm away from it, while running the sketch.

It is not the smoothest of setups, but one can get it going.