Skip to content

REPL server missing serial configuration #1188

@RazorneckCodes

Description

@RazorneckCodes

Versions

  • Python: Python 3.9.2 (default, Mar 12 2021, 04:06:34)
    [GCC 10.2.1 20210110] on linux
  • OS: PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
    NAME="Raspbian GNU/Linux"
    VERSION_ID="11"
    VERSION="11 (bullseye)"
    VERSION_CODENAME=bullseye
    ID=raspbian
    ID_LIKE=debian
  • Pymodbus: 3.0.2 REPL
  • Modbus Hardware (if used): Serial USB Adapter

Pymodbus Specific

  • Server: rtu - sync/async
  • Client: rtu - sync/async

Description

I am using pymodbus REPL server and client for modbus rtu communication with two usb adapters. Unfortunately I wasn't able to configure another baudrate, parity, stop bits and other serial settings for the server. I checked the config of the serial port with the command stty. In my example the server wasn't set to 38400 baud. I was able to set it manually while running the server. The client settings are fine.

Are there command line parameters to set those properties? I haven't found them in the example videos, docs or code.

Code and Logs

pymodbus.server --verbose run -s serial -f rtu -p /dev/ttyUSB1 --baudrate 38400 -u 1 -r 2

pymodbus.console serial --method rtu --port /dev/ttyUSB0 --baudrate 38400
#serial settings and logs
pi@pi1:~/pymodbus-dev/pymodbus $ stty -F /dev/ttyUSB1 -a
#speed 9600 baud; rows 0; columns 0; line = 0;
#intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; #swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = #^V; discard = ^O; min = 0; time = 0;
#-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
#-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany #-imaxbel -iutf8
#-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
#-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -#echoctl -echoke -flusho -extproc

#manual edit interface while running the server
stty -F /dev/ttyUSB1 38400

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions