Sign inSign up

eherzog/modbus-gw

By eherzog

•Updated over 2 years ago

A Modbus TCP and MQTT gateway to rs-485 for RTU and ASCII. https://github.com/EHerzog76/ModbusGW/

Image
0

248

eherzog/modbus-gw repository overview

⁠modbus-gw

This is a Modbus TCP and MQTT gateway to rs-485 for RTU and ASCII protocol. For a complete documentations see here: https://github.com/EHerzog76/ModbusGW/⁠

⁠Environment variables / Parameters

Env-NameParam-NameDefault ValueDescription
SERIAL_DEVICE/dev/ttyUSB0Serial device name
LISTEN_ADDRESS-L --listen0.0.0.0listen-address
PORT-p --port502Listen on TCP Port
SERIAL_BAUDRATE-b --baudrate19200serial baudrate
SERIAL_BYTESIZE-c --bytesize8Use 5,6,7 or 8 Bits per Char
SERIAL_PARITY-P --parityNserial parity N..None, O..Odd, E..Even
SERIAL_STOPBITS-f --stopbits1serial Stopbits 0, 1, 1.5
SERIAL_FRAMETYPE-F --frametypeRTUSerial Frametype RTU or ASCII
SERIAL_TIMEOUT-t --timeout1.0Serial bus timeout delay for response
SERIAL_WAITTIME-w --waittime0Serial waittime befor sending next frame
SERIAL_EOF-e --eof0.05Not used
MQTT_HOST-M --mqtthostConnect to MQTT-Host only when set
MQTT_PORT-q --mqttport1883
MQTT_TOPIC-T --mqtttopicmodbus
MQTT_CLIENTID-i --mqttclientidpyRS485GWMQTT client-id prefix
MQTT_USER-u --mqttuserusrOnly login to MQTT-Host if set
MQTT_PWD-s --mqttpwd
MQTT_VERSION-v --mqttversionMQTTv5MQTT-Version: MQTTv5, MQTTv311, MQTTv31
LOG_LEVEL-g --logINFOLoglevel: Debug, Info, Warning, Error, Critical see python logging
DEBUG-d --debugFalseActivate Debug-Output

All serial timing parameters are calculated based on the baudrate and the Bits per Char. So SERIAL_WAITTIME is only needed if your modbus devices need a longer time delay between the read/write requests.

To use more then one serial bus you can seperate all SERIAL_ parameters with a ; e.g.:

SERIAL_DEVICE=/dev/ttyUSB0;/dev/ttyUSB1
SERIAL_BAUDRATE=19200;9600

Tag summary

Content type

Image

Digest

sha256:fc285b836…

Size

24.8 MB

Last updated

over 2 years ago

docker pull eherzog/modbus-gw:alpine-1.9.9