|
This recipe focuses on the integration of SmartMesh IP into ThingWorx. If you don't know what ThingWorx is, we recommend the excellent guides from the ThingWorx developer portal. |
The goal of this recipe is to get you started integrating your SmartMesh IP network into ThingWorx. After following these steps, you will be able to explore all the possibilities ThingWorx offers, including analytics.
The setup you will build contains the following:
JsonServer
application running on the computer, and connected to the SmartMesh IP manager's serial portTo replicate this recipe, you need a DC9000 SmartMesh IP starter kit, and a ThingWorx account (which is free for a 30-day trial). |
At this point, there is an instance of ThingWorx running just for you in the cloud. We are only interested in the foundation server for this recipe. From your ThingWorx dashboard, you can "launch" it, i.e. open its web interface. Note that your instance has its own IP address, in my case |
Create an application key called "motekey" which you associate with user name "Administrator".
Once you save, the actual key is in field "keyId". In my case a807cb5d-6425-4786-95df-e09e2171a85d
.
Your Thingworx instance is now configured so you can issue RESTful commands, and authenticate as Administrator using an application key. Yes, that's it! Pretty simple, right? |
Switch on your SmartMesh IP manager and motes
We assume all SmartMesh IP motes are running the default firmware in master mode, and publish temperature data every 30 seconds. |
Start the SmartMesh IP JsonServer
application and Node-RED, and connect the JsonServer
application to your SmartMesh IP manager's serial API port.
See the SmartMesh IP and Node-RED, revisited recipe to see how to do that. |
Your SmartMesh IP network is running, and the All you have to do now is have Node-RED publish those sensors' measurements to your ThingWorx instance! |
Almost there, this is the last step!
All we need to do is create a Node-RED flow which:
/oap
to receive the OAP notifications form the JsonServer
This is what the resulting Node-RED flow looks like:
|
Once everything is running, in your ThingWorx console, you can see the Things corresponding to your motes (we use the mote's MAC address at the name of the thing):
If you click on a mote, and list its properties, you will see there is a property called "temperature" with the latest published value:
This recipe doesn't even scratch the surface of what ThingWorx can do.
Things you can build now:
Security MUST be taken seriously in all applications, including end-to-end IoT solutions like the one we are building here. This recipe is minimal by design, and doesn't detail nor contain the level of security you need for a production system. Thing we haven't touched upon:
When building a production system, we strongly recommend implementing industry-standard security methods. |
Some links for your further exploration.