This is an old revision of the document!
You may chose to use your Oak with a local version of the Particle server. This is a guide for how to install the local server and setup an Oak to use it.
NOTE: You can also use many other cloud services for storing data, just look for any of them that have a ESP8266 Arduino library and they should work with the Oak - though you may need to remove the WiFi connection code in their examples because the Oak handles that automatically.
See this page for what the local server can and cannot do: https://github.com/spark/spark-server
npm install node main.js
node main.js
The Particle local server should now be running!
npm install -g particle-cli
For an Oak to use the local server we'll need to do the following:
Run (from the same folder as the server):
openssl rsa -in default_key.pem -pubin -pubout -outform DER -out default_key.der
and then use a base64 encoder (locally for best safety) or here for convenience: http://bin-hex-converter.online-domain-tools.com/
Upload the default_key.der and get the encoded output, save this somewhere, you will need it in the next step.
Go to this page: http://digistump.com/oak/localserver.html
Then disconnect from the internet and connect your wifi to an updated Oak that is in config mode (see: http://digistump.com/wiki/oak/tutorials/connecting).
On that page enter the server address (IP or domain) and the hex encoded key you got above and hit submit.
Or POST the following JSON as a raw body to http://192.168.0.1/set
{"server-address":"IP OR DOMAIN HERE","server_address_type":0,"server-public-key":"HEX PUBLIC KEY FROM ABOVE"}
server_address_type = 0 for IP address, 1 for domain name
Source: https://docs.particle.io/support/troubleshooting/cloud-solutions/photon/ Run the following commands on a separate CMD prompt from the one running the server:
particle config local_oak apiUrl "http://DOMAIN_OR_IP:8080" particle config local_oak particle setup
This adds the local server ip to the cli tool, switches to using it, and creates an account on the local cloud.
Repeat steps #2 and #3 for other Oaks you want on the same cloud.
Remove power from the Oak and then re-apply power. The Oak should now connect to the local server and you should see the connection in the local server command window.
See the Particle guides for more about what you can do with the local server, use the Particle-cli upload and compile options to push firmware.