How to use AGILE Kura REST api
This tutorial will show how to collect data from a Modbus device and publish it on a cloud platform using the interaction between NodeRED and Eclipse Kura. The Modbus device will be emulated using a software simulator, like <a href="http://modbuspal.sourceforge.net/" about="_blank">ModbusPal</a>.
Configure Modbus device
1. Download <a href="http://modbuspal.sourceforge.net/" about="_blank">ModbusPal</a> on a computer that will act as a Modbus slave.
2. Open ModbusPal application as root and click on the “Add” button under the “Modbus Slaves” tab to create a Modbus slave device. Select an address (i.e. 1) and put a name into the “Slave name” form.
3. Click on the button with the eye to edit the slave device. Once the window is opened, add a coil with address 1 and set a value (0 or 1).
4. Close the editor and on the main window, click on the “TCP/IP” button under the “Link Settings” tab. Set the “TCP port” to 5020. Be sure that the selected TCP port is opened and reachable on the system.
5. Click on “Run” button to start the device.
Configure Agile Kura Assets
1. Access the Eclipse Kura Web UI and select the Packages section
2. Install the ESF Modbus Driver from the [Eclipse Kura Marketplace](https://marketplace.eclipse.org/content/esf-modbus-driver). The ending setup should be like the one in the following image.
3. Define a new Modbus Driver instance in Drivers and Assets by clicking on the New Driver button, selecting the proper factory and setting a name, for example modbusDriver.
4. Configure the new service as follows:
- access.type: TCP - modbus.tcp-udp.ip: IP address of the system where ModbusPal is running - modbus.tcp-udp.port: 5020
5. Create a new Asset by clicking the New Asset button and setting a proper name, e.g. modbusAsset
6. Configure the just created Asset, specifying the same Channel setup as the one specified in the ModbusPal application.