Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL server missing serial configuration #1188

Closed
RazorneckCodes opened this issue Nov 15, 2022 · 3 comments
Closed

REPL server missing serial configuration #1188

RazorneckCodes opened this issue Nov 15, 2022 · 3 comments
Labels

Comments

@RazorneckCodes
Copy link

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
@dhoomakethu
Copy link
Contributor

Will take a look and revert.

@dhoomakethu
Copy link
Contributor

Thanks for the bug, the serial args are being dropped silently. I will have a fix in a day or two.

dhoomakethu added a commit that referenced this issue Nov 16, 2022
@dhoomakethu
Copy link
Contributor

@RazorneckCodes please check PR #1189

janiversen pushed a commit that referenced this issue Nov 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants