Code Monkey home page Code Monkey logo

Comments (3)

sandervandevelde avatar sandervandevelde commented on August 11, 2024

This module is a Modbus 'slave' so there must a Modbus 'master' somewhere.
You refer to the localhost IP address. Is there a Modbus application running on the RPi?
Otherwise, find the right IP address of your Modbus master.

from iot-edge-modbus.

jesweare avatar jesweare commented on August 11, 2024

It's been quite a while since the last post, but in case others may have seen a similar issue, I figured it would help to chime in:

Assuming that the IP address is set to the SlaveConnection desired property field, if the intention behind setting 127.0.0.1 is to poll the host (IoT Edge device) as the Modbus device/slave/server, using 127.0.0.1 may not be the right option. This is because the Modbus module, as an IoT Edge module, is (by default) placed under the Docker daemon's azure-iot-edge network.

You can determine the desired IP address by examining the details of the azure-iot-edge network bridge and compare that to the network interfaces of your host device. Here is an example in an Ubuntu device I've used for testing.

// "172.18.0.1" would be the IP address of the Modbus device
$ sudo docker network inspect azure-iot-edge
[
    {
        "Name": "azure-iot-edge",
        "Id": "f04958f1d3bf175e64d2d4ec696c79afac9572c76012122722ed392c287ca2fc",
        "Created": "2021-07-16T02:42:45.303029015Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
 <snip>

$ ifconfig
br-f04958f1d3bf: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
<snip>

Hope this helps.

from iot-edge-modbus.

yphuangms avatar yphuangms commented on August 11, 2024

This repository is no longer being actively maintained and will be archived. Open issues will be closed.

from iot-edge-modbus.

Related Issues (20)

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.