modbus | Fault-tolerant implementation of modbus protocol in Go (golang) | Networking library

 by   goburrow Go Version: v0.1.0 License: BSD-3-Clause

kandi X-RAY | modbus Summary

kandi X-RAY | modbus Summary

modbus is a Go library typically used in Networking applications. modbus has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

go modbus
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              modbus has a medium active ecosystem.
              It has 815 star(s) with 324 fork(s). There are 52 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 38 open issues and 24 have been closed. On average issues are closed in 81 days. There are 18 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of modbus is v0.1.0

            kandi-Quality Quality

              modbus has 0 bugs and 0 code smells.

            kandi-Security Security

              modbus has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              modbus code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              modbus is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              modbus releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              It has 1747 lines of code, 100 functions and 21 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of modbus
            Get all kandi verified functions for this library.

            modbus Key Features

            No Key Features are available at this moment for modbus.

            modbus Examples and Code Snippets

            No Code Snippets are available at this moment for modbus.

            Community Discussions

            QUESTION

            decode register to 32bit float big endian in python code on raspberry pi 3B with python library pymodbus2.5.3
            Asked 2022-Mar-25 at 02:29

            I'm trying to get the data stream of a sensor transmitter that uses the modbus rtu communication protocol on my raspberry pi 3B. I'm able to get the data with the pymodbus2.5.3 library. For this I use this code:

            ...

            ANSWER

            Answered 2022-Mar-25 at 02:29

            You can use BinaryPayloadDecoder to help decoding your payload, here is a simplified example, change Endian.Big and Endian.Little if needed.

            Source https://stackoverflow.com/questions/71606375

            QUESTION

            What is the proper way for me to handle network access for a device
            Asked 2022-Mar-12 at 18:38

            I am currently working on a blazor server project which will display information from modbus tcp/ip devices. I have a class called "DeviceModel" which models a Modbus device. A simplified example is shown below.

            ...

            ANSWER

            Answered 2022-Mar-12 at 18:38

            Or does it make more sense to keep NetworkAccess and DeviceModel separate?

            As single responsibility principle of SOLID says:

            The single-responsibility principle (SRP) is a computer-programming principle that states that every module, class or function in a computer program should have responsibility over a single part of that program's functionality, and it should encapsulate that part. All of that module, class or function's services should be narrowly aligned with that responsibility.

            Read more about single responsibility principle of SOLID here.

            So making separate method dev.ResetAlarm1() in Device class is more preferable for me.

            It is hard to say whether my refactoring code is appropriate to you, but I tried to do my best:

            Source https://stackoverflow.com/questions/71441357

            QUESTION

            Error on Telegraf Helm Chart update: Error parsing data
            Asked 2022-Mar-11 at 12:37

            Im trying to deploy telegraf helm chart on kubernetes.

            helm upgrade --install telegraf-instance -f values.yaml influxdata/telegraf

            When I add modbus input plugin with holding_register i get error

            [telegraf] Error running agent: Error loading config file /etc/telegraf/telegraf.conf: Error parsing data: line 49: key `name’ is in conflict with line 2fd

            my values.yaml like below

            ...

            ANSWER

            Answered 2022-Mar-11 at 12:37

            Problem resolved by doing the following steps

            • deleted config section of my values.yaml
            • added my telegraf.conf to /additional_config path
            • added configmap to kubernetes with the following command

            Source https://stackoverflow.com/questions/71396884

            QUESTION

            FreeRTOS and synchronization between one writer and two readers
            Asked 2022-Feb-24 at 00:34

            I'm working on Modbus data logger that has two RS-485 ports handled by two tasks modbus_0_task and modbus_1_task. Both tasks use shared data_descriptors array (only for reading). These tasks will be called "readers" below.

            There is also another task config_keeper_task that updates data_descriptors array (read and write). This task will be called "writer" below.

            At this moment I have single mutex that protects data_descriptors array from being accessed by more than 1 task.

            Everything works fine, but there is one side effect. When one "reader" takes mutex - another "reader" has to wait. This is not necessary. They only should wait when the "writer" has access.

            How can I fix this?

            I was thinking about counting semaphore with maximum and initial value 2.

            Two readers take once, so my array could be read by both at the same time.

            Writer take semaphore two times (and also waits until all readers finish). When it finishes - it gives semaphore 2 times.

            Is this the normal way to do this?

            ...

            ANSWER

            Answered 2022-Feb-24 at 00:34

            So after few experiments and some research I know that I need read/write lock pattern, and there are 2 types of simple r/w locks suitable for FreeRTOS.

            First can be implemented with less resources: 1 mutex and 1 semaphore. Reader has priority when the reader and writer need access at the same time.

            Second requires a bit more: 2 mutex and 2 semaphores. Writer has priority and readers must wait until writer finishes (actually all writers, because more than 1 writer can wait for access).

            I found few implementations written for FreeRTOS and (to have full understanding how it works) I have rewritten this completely to fit my project.

            Here is the my favourite implementation by Michael Becker:

            https://github.com/michaelbecker/freertos-addons/blob/master/c/Source/read_write_lock.c

            Source https://stackoverflow.com/questions/71213380

            QUESTION

            Communicate with Elfin EW11 RS485 wifi converter
            Asked 2022-Feb-08 at 12:17

            I am trying to communicate with an electrical meter (Orno WE-517) that has an RS485 modbus interface. This serial interface is connected to an Elfin EW11 modbus to Wifi converter.

            Using pymodbus, I can connect to the adapter but I don't manage to read anything from the meter. Here is my code:

            ...

            ANSWER

            Answered 2022-Feb-01 at 18:01

            Which meter are you trying to read?

            try adding

            • from pymodbus.constants import Endian
            • from pymodbus.payload import BinaryPayloadDecoder

            change

            Source https://stackoverflow.com/questions/70530395

            QUESTION

            How to request Ebox wifi with modbus
            Asked 2022-Jan-30 at 16:01

            I've never used modbus before.

            I have an eBox-Wifi Epever connected to an MPPT charge controller TRIRON for solar power.

            I was able to make it connect to my wifi and now has an accessible IP : 192.168.39.149

            I just want to extract some data from it, battery Voltage, etc...

            On http://192.168.39.149:80, i have a web interface for administration. (Which is not what i want.)

            After an nmap, I see that there is port 8088 open. (Can use modbus there maybe ? no web interface on this port.)

            I installed and used modbus_cli like that modbus -b 115200 -p 1 192.168.39.149:8088 3101 but I can't make it return anything...

            https://files.i4wifi.cz/inc/_doc/attach/StoItem/7068/MODBUS-Protocol-v25.pdf

            http://www.solar-elektro.cz/data/dokumenty/1733_modbus_protocol.pdf

            https://github.com/favalex/modbus-cli

            EDIT : I changed for baud 9600 and port 502. (Which are the defaults for modbus ?)

            ...

            ANSWER

            Answered 2021-Dec-26 at 14:42

            Try python modpoll tool with the following configuration, install modpoll via pip install modpoll if not installed.

            • Create a local config file, e.g. epever.csv, only added voltage/current/power values for testing.

            Source https://stackoverflow.com/questions/70421066

            QUESTION

            How should I access these (Enron Modbus) registers?
            Asked 2021-Dec-07 at 15:02

            While using an OMNI Flow computer I ran into an issue I can't really wrap my head around. I'm trying to access 32 bits IEEE floating points number using NModbus.

            What I do to get one number :

            1. Read 2 registers using ReadHoldingRegisters(byte slaveAddress, ushort StartAddress, ushort numberOfPoints) with numberOfPoints = 2.
            2. Convert the 2 ushorts I read into 1 float like so :
            ...

            ANSWER

            Answered 2021-Dec-07 at 15:02

            After a few tests I have noticed that I am able to read the correct value from a register by using ReadHoldingRegisters(byte slaveAddress, ushort address, ushort numberOfPoints) with numberOfPoints = 2 while I get an error if I try with numberOfPoints = 1 because my device sends back 8 bytes of data instead of 4. This is coherent with the documentation stating that

            You cannot read or write a partial variable

            And since each floating point is in the form of a 32bits register I can't read less than 2 ushorts.

            Moreover, I discovered that, for me to read a value from a specific register (be it float or boolean) I had to use an address that was decremented by 1. So for example if I wanted to read the value in register 8080, in my code I should in fact read register 8079.

            I had a feeling there was an offset in the addressing but I wasn't expecting this.

            Source https://stackoverflow.com/questions/70247497

            QUESTION

            Pymodbus read and decode register value
            Asked 2021-Nov-09 at 19:14

            I am new to modbus comunication, i have to read from an inverter a single value from one register using modbus protocol (i use python with pymodbus for this): From the inverter documentation i read about register documentation:

            Register ADR: 31249 Description: Active power of system at PCC (W) CNT: 2 Type: S32 Format: FIX0 Access: RO

            Well, i try my python script like this:

            ...

            ANSWER

            Answered 2021-Nov-09 at 19:14

            As far as I can tell from your question you are trying to connect to an SMA inverter.

            Reading the first manual I could find it's not completely clear but it seems the register you are trying to read is not a holding register but an input register (for most Modbus devices if the register number is in the 3XXXX range it usually means input register and 4XXXX is for holding registers).

            The second trick is the offset: pyModbus does not account for the way registers are addressed in the protocol so you have to be aware that:

            -When you are trying to read or write an input register you need to subtract 30001. For your case, that is: 31249-30001=1248 (note that in some weird devices the offset is actually 30000 so you might want to try that too).

            -For holding registers the offset is obviously 40001 instead.

            If the manual I pointed to above is correct for your device then you should be addressing unit 2 instead of 1 as you are doing now. If that's correct you'd have to change this line:

            Source https://stackoverflow.com/questions/69881272

            QUESTION

            Changing the configuration of TF6250-Modbus-TCP when used in TwinCAT/BSD
            Asked 2021-Oct-26 at 03:48

            I have a device running TwinCAT/BSD.

            Following section 5 the manual for TwinCAT/BSD I have successfully managed to install the TF6250 package. After updating the firewall rules I have confirmed that I am able connect and issue modbus tcp requests successfully using the Default Configuration from section 4.3 of the TF6250 manual.

            My project requires mapping that is different from the default (i.e to the %Q registers rather than %M). Normally (when not not using TwinCAT/BSD) I would be able to edit my mapping via the Modbus TCP Configurator, but there does not appear to be an equivalent tool contained in the package for TwinCAT/BSD.

            I have tried copying the mapping files that I would have created in the configurator into the Server directory with no luck. Are you able to tell me how my mapping can be updated in the TwinCAT/BSD environment?

            If relevant:

            ...

            ANSWER

            Answered 2021-Oct-26 at 03:48

            I spoke with Beckhoff support who told that TF6250 expects the xml file with the configuration here: /usr/local/etc/TwinCAT/Functions/TF6250-Modbus-TCP/TcModbusSrv.xml

            I tested this and it appears to work so all you need to do;

            • Create the mapping file as per normal (e.g using the windows tool) and copy the file there.
            • Reboot the device to load the configuration from the file.

            Source https://stackoverflow.com/questions/69603620

            QUESTION

            EE certificate key too weak (_ssl.c:1131)
            Asked 2021-Oct-15 at 12:49

            I am using the python 3.8 client example on my Modbus application, but I get an error like this:

            ...

            ANSWER

            Answered 2021-Oct-15 at 12:49

            The output from openssl x509 -text -in cert.pem on your certificate shows:

            Source https://stackoverflow.com/questions/69584265

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install modbus

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/goburrow/modbus.git

          • CLI

            gh repo clone goburrow/modbus

          • sshUrl

            git@github.com:goburrow/modbus.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Networking Libraries

            Moya

            by Moya

            diaspora

            by diaspora

            kcptun

            by xtaci

            cilium

            by cilium

            kcp

            by skywind3000

            Try Top Libraries by goburrow

            cache

            by goburrowGo

            quic

            by goburrowGo

            serial

            by goburrowGo

            melon

            by goburrowGo

            netforward

            by goburrowGo