Coder Social home page Coder Social logo

adam-borkowski / mbusd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 3cky/mbusd

0.0 1.0 0.0 704 KB

Open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.

License: BSD 3-Clause "New" or "Revised" License

Makefile 5.79% M4 0.35% Shell 82.47% C 10.72% C++ 0.67%

mbusd's Introduction

About mbusd

mbusd is open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.

Features:

  • Small footprint - suitable to run on embedded devices and SBCs like Raspberry Pi
  • Multi-master - multiple TCP masters can access slave devices in RTU network using same gateway
  • Robustness - can retry requests with mismatched response CRC
  • Flexible RTU modes - speed/parity/stop-bits/timeouts can be configured for RTU network
  • Support for both of automatic and manual (using RTS bit) direction control types for RS-485 transceivers

Supported function codes:

  • 01: Read coil status
  • 02: Read input status
  • 03: Read holding registers
  • 04: Read input registers
  • 05: Force single coil
  • 06: Preset single register
  • 07: Read exception status
  • 15: Force multiple coils
  • 16: Preset multiple registers

Please note all other function codes (including vendor-specific extensions) are supported on a "best-effort" basis and most likely will fail.

Configuring and compilation:

$ git clone https://github.com/3cky/mbusd.git mbusd.git
$ cd mbusd.git
$ ./configure
$ make
# make install
$ make clean

Usage:

   mbusd [-h] [-d] [-t] [-v level] [-L logfile] [-p device] [-s speed] [-m mode] \
   	       	[-P port] [-C maxconn] [-N retries] [-R pause] [-W wait] [-T timeout]

   -h     Usage help.
   -d     Instruct mbusd not to fork itself (non-daemonize).
   -t     Enable RTS RS-485 data direction control (if not disabled while compile).
   -v level
          Specifies  log  verbosity level (0 for errors only, 1 for warnings
          and 2 for also information messages.) If mbusd was compiled in debug mode,
          valid log levels are up to 9, where log levels above 2 forces
          logging of information about additional internal events.
   -L logfile
          Specifies log file name ('-' for logging to STDOUT only, default is /var/log/mbusd.log).
   -p device
          Specifies serial port device name.
   -s speed
          Specifies serial port speed.
   -m mode
          Specifies serial port mode (like 8N1).
   -P port
          Specifies TCP port number (default 502).
   -C maxconn
          Specifies maximum number of simultaneous TCP connections.
   -N retries
          Specifies maximum number of request retries (0 disables retries).
   -R pause
          Specifies pause between requests in milliseconds.
   -W wait
          Specifies response wait time in milliseconds.
   -T timeout
          Specifies connection timeout value in seconds (0 disables timeout).

Please note running mbusd on default Modbus TCP port (502) requires root privileges!

Reporting bugs:

Please file issue with attached debug log in verbose (-v9) mode, i.e.:

   # mbusd -L/tmp/mbusd.log -p /dev/ttyUSB0 -s 9600 -P 502 -d -v9

Unless you were prompted so or there is another pertinent reason (e.g. GitHub fails to accept the bug report), please do not send bug reports via personal email.

Contributing:

  1. Fork it and clone forked repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

Author:

Victor Antonovich ([email protected])

Credits:

Andrew Denysenko ([email protected]):

  • RTS RS-485 data direction control
  • RTU response receiving by length

License:

This project is distributed under the BSD license. See the LICENSE file for the full license text.

mbusd's People

Contributors

3cky avatar mbs38 avatar

Watchers

 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.