GithubHelp home page GithubHelp logo

softwareag / cumulocity-modbus-demo Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 602 KB

Example implementation of a modbus device in Cumulocity IoT. The demo device sends random values via modbus TCP. In the following you will see how to easily connect and read the values from the device with Cumulocity IoT.

License: Apache License 2.0

Dockerfile 20.22% Makefile 56.48% Python 23.30%
cumulocity cumulocity-iot modbus-tcp linux-agent iot-analytics cumulocity-example cumulocity-agent modbus agent example

cumulocity-modbus-demo's Introduction

Cumulocity Modbus Demo

Example implementation of a modbus device in Cumulocity IoT. The demo device sends random values via modbus TCP. In the following you will see how to easily connect and read the values from the device with Cumulocity IoT.

Cumulocity is an IoT platform that enables rapid connections of many, many different devices and applications. It allows you to monitor and respond to IoT data in real time and to spin up this capability in minutes. More information on Cumulocity IoT and how to start a free trial can be found here.

Cumulocity IoT enables companies to quickly and easily implement smart IoT solutions.

The Cumulocity IoT documentation contains detailed instructions on how to connect fieldbus devices to the platform.


For more information you can Ask a Question in the TECHcommunity Forums.


These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.

Contact us at TECHcommunity if you have any questions.

Getting started

Simply start via:

git clone URL
cd cumulocity-modbus-demo

In the docker-compose.yml you have to use an identifier such as the serial number or mac address. This serial number will be used for the registration purpose and must be unique across all tenants. Please change it at the beginning. Find it within the compose file in the agent section. You can also change the Cumulocity base url if needed.

There will be two containers ramped up:

  1. The linux agent that contains the Modbus functionality
  2. A Modbus simulator, that simulates random values

Start both containers with:

docker-compose up

Device Registration

On Cumulocity side you have to register the device in your tenant.

Device Registration

Device Protocol

The Modbus server sends random integer measurements via the holding register from Bit 0 to Bit 16. To read these values with the agent and send them as measurements to Cumulocity, the agent must be remotely configured in Cumulocity. This conecpt is called Cloud Fieldbus. You can find additional infos about that in the Cumulocity IoT documentation

New fieldbus device protocols can be created in the Device protocols page which is opened from the Device types menu in the navigator. Create a new Modbus device protocol and configure it, as shown below:

Device protocol

Further information on how to read and send events and alarms from Modbus devices can be found in the Cumulocity IoT documentation.

Device Configuration Modbus

Within the device management application of Cumulocity you will find the tab "Modbus" after the device/agent was registered successfully.

Device Registration

Within here, you can add a TCP Device. The address of the Modbus server is 0. For the ip address of the Modbus server use your local ip address. Since the agent is running in a docker container 127.0.0.1 will not work for the docker host. On windows you can display the local network address via the command line with ipconfig.

cumulocity-modbus-demo's People

Contributors

mbay-odw avatar scfx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.