In this walkthrough, I will be showing you how to create a Meshblu device, run it on an Intel Edison, and debug the sensor data in Octoblu.
Please follow the official documentation to setup your Intel Edison.
Make sure that you configure your edison with WiFi, as you will need to be able to pull code from github. Step 4 in the official setup guide will walk you through this.
Now that you have your Edison configured and setup with WiFi, you will need to install git by running the command:
npm install --global git
Now that you have Node and git installed, your Edison is almost ready to talk to Octoblu! This would be a good time to connect sensors to your Edison.
I suggest you clone the boilerplate, as it will have everything you need.
From your Edison:
cd /node_app_slot git clone repo-url
You can get the repo-url from the Code section at the bottom.
Now that you have your code ready to go, we will need to generate some Meshblu credentials via meshblu-util:
npm install --global meshblu-util meshblu-util register -t device:my-device > meshblu.json meshblu-util claim
Once you run the final command, it should open a new tab in your default browser, walking you through the device claiming process.
The node_app_slot folder should contain a main.js file. xdk-daemon is a service that is running on the Edison by default and will run node_app_slot/main.js when the device boots up.
Because it is looking for a main.js file inside of node_app_slot, you will need to move all the files from inside your repo folder out into the node_app_slot:
cd /node_app_slot cd meshblu-custom-device-boilerplate mv .git ../ mv main.js ../ etc...
Also make sure to stop the xdk-daemon service before manually running your script. You can check if it is running, and stop it with the following commands:
ps | grep xdk systemctl stop xdk-daemon
Now that you have the boilerplate in the node_app_slot and the xdk-daemon service is stopped, you are ready to run your custom device!
Now we will install dependencies and run your device:
cd /node_app_slot npm install npm start
With your device running, go to app.octoblu.com
1. Create a new flow
2. Add your custom device to the flow
3. Add a Debug tool and connect it to your device
4. Click the green arrow in the top right to run your flow
You should now be able to see your sensor's data in our debug pane in the sidebar!