I have followed this tutorial exactly and had trouble correctly getting my Photon to connect to my local cloud. I just want to share the things I had to do to get it working properly.
Make sure your node version is 0.10.36.
After downloading particle-cli, you need to change several lines in ApiClient.js
(/usr/local/lib/node_modules/particle-cli/lib/ApiClient.js)
from https://github.com/spark/spark-cli/blob/4f06c4bac32e3e75ecfcb217261b8bf57e1b7b47/lib/ApiClient.js
REPLACE the similar looking code with the following:
//GET /oauth/token
login: function (client_id, user, pass) {
var that = this;
return this.createAccessToken(client_id, user, pass).then(function(resp) {
console.log("Got an access token! " + resp.access_token);
that._access_token = resp.access_token;
return that._access_token;
}).catch(function (err) {
console.error("Login error: ", err);
return when.reject();
});
},
This would allow you to create an account on you local cloud. Your local cloud DOES NOT know about your Particle Cloud account. When following the instructions in this tutorial, I was always signed in and never logged out. I decided to log out and I was never able to log in nor was I able to create an account until I changed the code on that file.
Make sure you do a
particle update
to make sure the system firmware is up to date.
Doing these 3 things helped me correctly run a local cloud, connect all my Photons to that local cloud, and control them through the iOS SDK with this small change [SOLVED] iOS SDK on Local Cloud