In this project, we've added support for the NXP Rapid IoT multi-sensor, running the "out of the box" firmware, to the OmnIoT SoftHub Platform. The SoftHub Platform allows users to build out many typical IoT edge infrastructure applications very rapidly and with no programming required. It does this by incorporating an object based rule engine into a hub/gateway application (the SoftHub) that runs on very inexpensive Linux based systems such as the Raspberry Pi 3 or Zero/W. In addition to the hub/gateway application the platform includes the SoftHub Configuration Utility, a Remote Packet Capture Service, and a Binary Logfile Decode Utility. The SoftHub Platform is free for non-commercial use (including the current NXP/hackster.io contest) and a fully functioning copy, now including support for the NXP Rapid IoT multi-sensor, can be downloaded from our website at www.omniot.com.
One of the key differentiators of the SoftHub verses other hub/gateway solutions is that it includes an ever growing library of built in sensor support allowing users to create their edge infrastructure in a manner of minutes using off the shelf sensors. Using the SoftHub Configuration Utility you can now select the NXP Rapid IoT sensor and will then have access to all of the BLE functionality it exposes via the stock firmware. You can easily Read from, Write to, and enable/disable Notifications for all BLE characteristics that support these operations. Then, using the 60+ additional configuration objects provided, you can quickly build applications to -
- Send your TLS encrypted raw packet data to your local or remote servers to be decoded
- Log sensor data in either binary or XML format directly to the hub devices' local storage
- Create complex threshold logic based on the real time sensor data being received
- Generate email/sms alarm messages to be sent directly from the hub device itself
- Control GPIO's to actuate external devices or to allow for user input
- Configure sensor data value averagers or cache's to bulk report data
- Create customized aggregate Report packets in either binary or XML format
- And much more (extensive documentation is available at the OmnIoT website)...
Below is a table of BLE characteristics exposed by the Atmosphere "out of the box" firmware and shows what operations the firmware supports on each BLE characteristic (Read/Write/Notify) as well as each characteristic's data type -
Presented in video below is a demonstration application featuring the NXP sensor which, while having no real-world use, illustrates a small subset of the type of functionality that can by created very quickly using the SoftHub Platform. At the very core of the SoftHub you create a "ruleset" that describes what actions you want the SoftHub to perform as well as when, and under what conditions, you want these actions to be executed. Building out and deploying the example scenario took roughly 30 minutes from start to finish. Ultimately the demo required just 9 "rules" triggered by 6 "events". We'll break the demo video into two sections, the first will very quickly show the live demo in action, and the second will give a very brief overview of the ruleset configuration file used to drive the demo. For the sake of brevity the discussion is kept to a very high level. For more in depth information the OmnIoT website has several documents and videos describing the actual mechanics of creating and deploying a ruleset from scratch.
In the demonstration the SoftHub has been configured to perform the following example scenario -
* When started the SoftHub daemon it will initiate a connection to the NXP Rapid IoT sensor.
* When the sensor is connected and ready the front LED will be illuminated in green.
* When the sensor is tapped rapidly three times (with no more than one second between taps) the LED will
switch to red indicating that a temperature reading is being taken and forwarded to a remote server.
* The LED will remain red for five seconds during which time any additional tap input will be ignored.
* After 5 seconds the LED will switch back to green and wait for the next tap event(s).
The example scenario manipulates three of the sensor's BLE characteristics, (1) the "Tap Count" characteristic's Notify flag is written to to toggle tap count notifications on or off depending on our current mode, (2) the "Temperature" characteristic is read from to retrieve the latest temperature data and, (3) the "RGB LED Color" characteristic is written to to turn the front LED either red, green, or off.
Summary - To keep things brief this presentation obviously glosses over a great deal of detail, but in general to build new IoT application for the NXP Rapid IoT multi-sensor the process is -
- Install the SoftHub Configuration Utility.
- Install the SoftHub daemon on your hub device (Raspberry Pi).
- Optionally install the Packet Capture Service on a target server to receive your packets remotely.
- Use the SoftHub Configuration Utility to create and save your ruleset (RuleEngine.xml) file.
- Copy the ruleset file to the device running the SoftHub daemon.
- Restart the SoftHub daemon.
- Your application will now be carried out per the ruleset you have created.
And again, full details including in depth documentation and tutorial videos are available at the omniot.com website. You can also download the RuleFile.xml file used in the demo from HERE. To use it you'll need to change the ip and port information in the "doFwdTempPacket" object definition to point to your own packet capture server (again we have videos available on how to set up a free AWS server as a packet capture server). One caveat, a quirk of the stock Atmosphere firmware requires that the UI on the sensor be on the Tap Count screen for the unit to send Tap Count notifications.
A note to NXP - With its UI screen and Atmosphere graphical configuration tool, the NXP Rapid Iot device has many unique features not available on your competitor's multi-sensor prototyping devices (e.g. TI SensorTag, Nordic Thingy:52, Dialog Semiconductor DA14535). However, the out of the box firmware seems to only expose a relatively small subset of the devices' capabilities. The button, gpio, and buzzer hardware is completely omitted. Only one LED is exposed and all of the motion related characteristics are Read only (not Notify) greatly limiting their usefulness. I understand that users can create their own firmware using the Atmosphere application however, after all the obvious effort you went to to create the hardware it seems like it would have been a small additional effort to provide an alternate firmware that shows off all of the devices' hardware capabilities similar to what the aforementioned competitors have done. I've worked with all these other platforms extensively so feel free to contact me for further information if you're interested. I would love to add support for an additional NXP Rapid IoT firmware version giving your users a true off the shelf experience capable of getting at all of your device's capabilities.