IoT is not only about controlling but also about measuring. Since Switchboard provides a means to connect many devices in a centralised manner, it would be a shame not to provide some interface through which we can collect the device data and do things with it, such as storing it or displaying it.
To this end I have just added a component to Switchboard called IOData. At every polling cycle IOData receives an update of all the device states. IOData then proceeds to determine what the value differences are between the current and the previous cycles and encodes those differences as an array of updates.
This is where IOData Agents come in. An agent is an app that subscribes to the IOData update stream. What it does with this data is entirely up to the agent. Switchboard currently comes with two agents out of the box:
- IOFileSave: stores the list of updates in a file. Can be configured to only store a maximum number of updates, deleting the oldest entries if we reach this number
- Dashboard: an HTML dashboard that uses websockets to always display the latest device value data:
To launch the Dashboard agent enter the following command:
launchapp swb_dashboardafter which you will be prompted for the port on which to run the server. All agent settings are automatically stored in the config file.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.