One Bundle Project – Modbus and Eclipse Kura

Default installation of Eclipse Kura 1.1.1 do not provision org.eclipse.kura.protocol.modbus bundle. Nevertheless, you can find it in source code (compile yourself) or grab it from https://repo.eclipse.org/content/repositories/kura-releases/org/eclipse/kura/org.eclipse.kura.protocol.modbus/1.0.1/ .

All you need is to install modbus budle in Kura.

First you need to upload org.eclipse.kura.protocol.modbus-1.0.1.jar to your target device (RPi or BBB), connect with osgi console and install mentioned jar file:

telnet localhost 5002

osgi> install file:/{path to folder with jar file}/org.eclipse.kura.protocol.modbus-1.0.1.jar

Now, you can reference it from your bundle.

<?xml version="1.0"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="io.github.tobidi.modbus.monitor.service.impl.ModbusMonitorServiceImpl" activate="activate">
  <implementation class="io.github.tobidi.modbus.monitor.service.impl.ModbusMonitorServiceImpl"/>
  <service>
    <provide interface="io.github.tobidi.modbus.monitor.service.api.ModbusMonitorService"/>
  </service>
  <reference name="connectionFactory" cardinality="1..1" interface="org.osgi.service.io.ConnectionFactory" bind="setConnectionFactory" unbind="unsetConnectionFactory"/>
  <reference name="modbusDeviceService" cardinality="1..1" interface="org.eclipse.kura.protocol.modbus.ModbusProtocolDeviceService" bind="setModbusDeviceService" unbind="unsetModbusDeviceService"/>
</scr:component>

There is more about modbus on Kura Documenation.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s