In this section we will explore using the IAP/MQ API to interact with Lon Devices. To prepare for this section, you will need to have at least one FT 5000/6050 EVB loaded with the image located in
...apps\Example Support Files\Multisensor_ImageFiles.zip (this path is relative to where you cloned the izot/smartserver-iot github repo on your computer). Use nodetuil to load the application image. This version of the application defaults to support external network management, and includes a visual response to the Wink command by flashing the blue LEDs at the bottom of the board.
Prior to starting this exercise, you should use nodeutil to load the appropriate NDL file based on the target EVB board you have.
The following steps setup this program example and should be done first.
Provisioning the Multi Sensor Example
If you have a SmartServer IoT in factory fresh condition, you can skip this section. If you are unsure, take the time to run these steps.
- Use putty.exe to connect to the SSH console as user apollo.
- To clear the SmartServer database using the System Configuration page, follow the steps for Resetting to Defaults Using the Configuration Page (reseting the databases) in the Resetting the SmartServer to Factory Defaults section. Allow 10 minutes to initialize the SmartServer IoT.
- Open a web browser and log in as user apollo. Return to the Features tab to enable features that were enabled before resetting the databases to defaults. To use the RNI interface with Nodeutil, enable the RNI feature, and then setup the RNI using the OpenLDV Lonworks Interfaces control panel applet. Use Nodeutil to load one or more FT 6050 EVB targets with the NDL images contained in the the Mutisensor_ImageFiles.zip archive referenced above.
- Select the CMS tab.
- Log in as the apollo user.
- In the Device widget, select the action menu (...). See the following figure.
- Select Import device types action. Click the DROP FILE HERE rectangle and navigate to the Multisensor_Example.dtp found in the folder
..apps\Example Support Files\or drag and drop the file.
- Select Create device from the action menu, and fill out the 2-step dialog as depicted in the following screenshots.
The UID field in the second screenshot must match the value of your target FT 6050 EVB. As an option, set the UID to 000000000000, and when you select provision, press the service pin of your EVB.
- Select the action menu for the device you just created, and select Provision device.
You should observe a burst of TX/RX activity on the U60, and after a short while, the service LED on the FT 6050 EVB should be off to indicate the device has been provisioned. You will also see the icon for the device change color from blue to green.
- Select the action menu for the device you just provisioned, and select Wink.
You should observe the blue LEDs on the bottom edge of the board flashing in response to the Wink message.
You have now used the CMS to provision a device that has code to implement a response to a wink command.
In the next section, you will learn how to write an application that will discover a provisioned device, and issue a wink command using the IAP/MQ API. Continue with IAP/MQ Device Interaction Example.