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: Oak can't be programmed at all when used with Particle Local Server because of protocol mismatch. So in practice it is nearly useless to try using Oak with Particle Local Server. (forum post
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
sudo npm install -g particle-cli --unsafe-perm --build-from-source
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.pub.pem -pubin -pubout -outform DER -out default_key.pub.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.pub.der and get the hex 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
In the server folder create a core_keys folder if it does not exist.
While still connected to the Oak that is in config mode go to http://192.168.0.1/device-id - you should get a response like this:
{ "id":"ABCDEFGHJK","c":"1" }
Where “ABCDEFGHJK” is the device ID for this device - copy this without the quotes, you will need it to complete the rest of this step.
Now go to http://192.168.0.1/public-key - you should get a response like this:
{ "r": 0, "b":"AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ" }
Where “AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ” is a string of numbers and letters that make up the hex encoded public key for the device. Copy this string without the quotes into a text editor and save as DEVICE_ID.pub.der - where DEVICE_ID is the device id you got above.
Upload it here (or use another hex decoder): http://bin-hex-converter.online-domain-tools.com/ and hit decode, then click download as binary file. Rename that download to DEVICE_ID.pub.pem and place in the core_keys directory you created above.
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.
Stop and restart the server.
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.