All Projects → 3cky → Mbusd

3cky / Mbusd

Licence: bsd-3-clause
Open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Mbusd

Hslcommunication
An industrial IoT underlying architecture framework, focusing on the underlying technical communications and cross-platform, cross-language communication functions, to achieve a variety of mainstream PLC data reading and writing, to achieve modbus of various protocols read and write, and so on, to support the rapid construction of industrial upper computer software, configuration software, SCADA software, factory mes system, To help enterprise Industry 4.0 take-off, to achieve intelligent manufacturing, smart factory goals. The main PLC contains Siemens, Mitsubishi, Omron, Panasonic, Modbus, AB-PLC, Redis
Stars: ✭ 816 (+250.21%)
Mutual labels:  modbus, modbus-tcp
Pymodbus
A full modbus protocol written in python
Stars: ✭ 1,225 (+425.75%)
Mutual labels:  modbus, modbus-tcp
Modbus
Modbus RTU and TCP support for C#
Stars: ✭ 23 (-90.13%)
Mutual labels:  modbus, modbus-tcp
Modbustool
A modbus master and slave test tool with import and export functionality, supports TCP, UDP and RTU.
Stars: ✭ 187 (-19.74%)
Mutual labels:  modbus, modbus-tcp
Genmon
Generac Generator Monitoring using a Raspberry Pi and WiFi
Stars: ✭ 143 (-38.63%)
Mutual labels:  modbus, modbus-tcp
Node Modbus
Modbus TCP Client/Server implementation for Node.JS
Stars: ✭ 313 (+34.33%)
Mutual labels:  modbus, modbus-tcp
Modbridge
Bridge between modbus and MQTT
Stars: ✭ 20 (-91.42%)
Mutual labels:  modbus, modbus-tcp
go-modbus
modbus write in pure go, support rtu,ascii,tcp master library,also support tcp slave.(WIP new implement<old: https://github.com/thinkgos/gomodbus >)
Stars: ✭ 124 (-46.78%)
Mutual labels:  modbus, modbus-tcp
Iot Technical Guide
🐝 IoT Technical Guide --- 从零搭建高性能物联网平台及物联网解决方案和Thingsboard源码分析 ✨ ✨ ✨ (IoT Platform, SaaS, MQTT, CoAP, HTTP, Modbus, OPC, WebSocket, 物模型,Protobuf, PostgreSQL, MongoDB, Spring Security, OAuth2, RuleEngine, Kafka, Docker)
Stars: ✭ 2,334 (+901.72%)
Mutual labels:  gateway, modbus
Modbuspp
A C++ Library for Modbus TCP Protocol
Stars: ✭ 108 (-53.65%)
Mutual labels:  modbus, modbus-tcp
solaredge modbus
SolarEdge Modbus data collection library
Stars: ✭ 49 (-78.97%)
Mutual labels:  modbus, modbus-tcp
J2mod
Enhanced Modbus library implemented in the Java programming language
Stars: ✭ 155 (-33.48%)
Mutual labels:  modbus, modbus-tcp
IoT-Technical-Guide
🐝 IoT Technical Guide --- 从零搭建高性能物联网平台及物联网解决方案和Thingsboard源码分析 ✨ ✨ ✨ (IoT Platform, SaaS, MQTT, CoAP, HTTP, Modbus, OPC, WebSocket, 物模型,Protobuf, PostgreSQL, MongoDB, Spring Security, OAuth2, RuleEngine, Kafka, Docker)
Stars: ✭ 2,565 (+1000.86%)
Mutual labels:  gateway, modbus
Easymodbustcp.net
Modbus TCP, Modbus UDP and Modbus RTU client/server library for .NET implementations
Stars: ✭ 358 (+53.65%)
Mutual labels:  modbus, modbus-tcp
rodbus
Rust implementation of Modbus with idiomatic bindings for C, C++, .NET, and Java
Stars: ✭ 34 (-85.41%)
Mutual labels:  modbus, modbus-tcp
Gomodbus
A Modbus client in Go
Stars: ✭ 11 (-95.28%)
Mutual labels:  modbus, modbus-tcp
huawei solar
Home Assistant integration for Huawei Solar inverters via Modbus
Stars: ✭ 126 (-45.92%)
Mutual labels:  modbus, modbus-tcp
ModbusMechanic
Cross platform GUI MODBUS TCP/RTU simulator & gateway. Interprets data types including ascii float and int.
Stars: ✭ 63 (-72.96%)
Mutual labels:  modbus, modbus-tcp
Modbus Tcp Client
PHP client for Modbus TCP and Modbus RTU over TCP (can be used for serial)
Stars: ✭ 89 (-61.8%)
Mutual labels:  modbus, modbus-tcp
Jlibmodbus
JLibModbus is an implementation of the Modbus protocol v1.1b in java language.
Stars: ✭ 149 (-36.05%)
Mutual labels:  modbus, modbus-tcp

About mbusd

Build Status

mbusd is open-source Modbus TCP to Modbus RTU (RS-232/485) gateway. It presents a network of RTU slaves as single TCP slave.

That is a TCP-Slave (or server) which acts as a RTU-master to get data from Modbus RTU-slave devices.

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.

Installation instructions:

$ git clone https://github.com/3cky/mbusd.git mbusd.git
$ cd mbusd.git
$ mkdir -p build && cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
$ make
$ sudo make install

Compile time options can be altered in many ways, e.g. by using the following tools in the build dir:

  • ccmake - usually in the package cmake-curses-gui
  • cmake-gui - usually in the package cmake-qt-gui

Usage:

   mbusd [-h] [-d] [-L logfile] [-v level] [-c cfgfile] [-p device] [-s speed] [-m mode]
         [-t] [-y file] [-Y file] [-A address] [-P port] [-C maxconn] [-N retries]
         [-R pause] [-W wait] [-T timeout]

   -h     Usage help.
   -d     Instruct mbusd not to fork itself (non-daemonize).
   -L logfile
          Specifies log file name ('-' for logging to STDOUT only, default is /var/log/mbusd.log).
   -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.
   -c cfgfile
          Read configuration from cfgfile.
   -p device
          Specifies serial port device name.
   -s speed
          Specifies serial port speed.
   -m mode
          Specifies serial port mode (like 8N1).
   -t     Enable RTS RS-485 data direction control (if not disabled while compile).
   -y file
          Enable RS-485 direction data direction control by writing '1' to file
          for transmitter enable and '0' to file for transmitter disable
   -Y file
          Enable RS-485 direction data direction control by writing '0' to file
          for transmitter enable and '1' to file for transmitter disable
   -A address
         Specifies TCP address to bind (default 0.0.0.0).
   -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!

Configuration file:

mbusd can read the configuration from a file specified by -c command line flag. Please see example configuration file for complete list of available configuration options.

systemd:

mbusd has systemd support. The build system detects whether the system has systemd after which sudo make install installs the [email protected] file on systems with systemd active.

The mbusd service can be started via:

# systemctl start [email protected]<serial port>.service

where <serial port> is serial port device name (like ttyUSB0).

mbusd started by systemd will read its configuration from file named /etc/mbusd/mbusd-<serial port>.conf. This way it's possible to run multiple mbusd instances with different configurations.

To see the mbusd service status:

# systemctl status [email protected]<serial port>.service

To monitor the mbusd service:

# journalctl -u [email protected]<serial port>.service -f -n 10

To start the mbusd service on system boot:

# systemctl enable [email protected]<serial port>.service

Please check systemd documentation for other usefull systemd commands

Contributing:

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.

Workflow for code contributions

  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

Building and Testing

Dependencies: please see the correct OS-distribution section in the .gitlab-ci.yml

With all dependencies met, one is able to build and execute tests issuing the following bash commands:

# build
mkdir output.dir/ && cd $_
cmake ../ && make
# execute all tests
(cd ../ && python tests/run_itests.py output.dir/mbusd)

Author:

Victor Antonovich ([email protected])

Contributors:

Andrew Denysenko ([email protected]):

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

James Jarvis ([email protected]):

  • file based RS-485 data direction control

Luuk Loeffen ([email protected]):

  • systemd support

Nick Mayerhofer ([email protected]):

  • CMake build system

License:

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].