A Modbus TCP and MQTT gateway to rs-485 for RTU and ASCII. https://github.com/EHerzog76/ModbusGW/
248
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/
| Env-Name | Param-Name | Default Value | Description |
|---|---|---|---|
| SERIAL_DEVICE | /dev/ttyUSB0 | Serial device name | |
| LISTEN_ADDRESS | -L --listen | 0.0.0.0 | listen-address |
| PORT | -p --port | 502 | Listen on TCP Port |
| SERIAL_BAUDRATE | -b --baudrate | 19200 | serial baudrate |
| SERIAL_BYTESIZE | -c --bytesize | 8 | Use 5,6,7 or 8 Bits per Char |
| SERIAL_PARITY | -P --parity | N | serial parity N..None, O..Odd, E..Even |
| SERIAL_STOPBITS | -f --stopbits | 1 | serial Stopbits 0, 1, 1.5 |
| SERIAL_FRAMETYPE | -F --frametype | RTU | Serial Frametype RTU or ASCII |
| SERIAL_TIMEOUT | -t --timeout | 1.0 | Serial bus timeout delay for response |
| SERIAL_WAITTIME | -w --waittime | 0 | Serial waittime befor sending next frame |
| SERIAL_EOF | -e --eof | 0.05 | Not used |
| MQTT_HOST | -M --mqtthost | Connect to MQTT-Host only when set | |
| MQTT_PORT | -q --mqttport | 1883 | |
| MQTT_TOPIC | -T --mqtttopic | modbus | |
| MQTT_CLIENTID | -i --mqttclientid | pyRS485GW | MQTT client-id prefix |
| MQTT_USER | -u --mqttuser | usr | Only login to MQTT-Host if set |
| MQTT_PWD | -s --mqttpwd | ||
| MQTT_VERSION | -v --mqttversion | MQTTv5 | MQTT-Version: MQTTv5, MQTTv311, MQTTv31 |
| LOG_LEVEL | -g --log | INFO | Loglevel: Debug, Info, Warning, Error, Critical see python logging |
| DEBUG | -d --debug | False | Activate 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
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