Closed madhujk closed 3 years ago
@madhujk Could you provide more info on your request ?
It is a request to support both, local ports and remote ports servers supporting rfc2217 format ,
format:
rfc2217://
Pyserial support above url handler to connect to remote ports with "serial_for_url()".
pymodbus dymanically can connect to local port or remote port based on input to the server
@madhujk thanks for the idea. Its good to have but I do not see much users for this feature. I will leave this open for anyone to go ahead and implement and raise a PR. Feel free to contribute.
I need this, specifically the "hwgrep://" syntax. Scenario: Remote box, two FTDI RS-485 USB adapters, other USB devices also show up as /dev/ttyUSB*, so I cannot rely on the device names as they change on reboot. So ideally I would specify the serial ports to be: "hwgrep://0403:6001" and "hwgrep://0403:6001&n=2"
I hacked the pymodbus module, sync.py, ModbusSerialClient.connect() Instead of:
self.socket = serial.Serial(port=self.port,
timeout=self.timeout,
bytesize=self.bytesize,
stopbits=self.stopbits,
baudrate=self.baudrate,
parity=self.parity)
I use this:
self.socket = serial.serial_for_url(self.port,
timeout=self.timeout,
bytesize=self.bytesize,
stopbits=self.stopbits,
baudrate=self.baudrate,
parity=self.parity)
That's it. Works for me.
@isj4 Thanks for the workaround, I will see if this is something we can support from the pymodbus library directly
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
I still need this.
Versions
Pymodbus Specific
Description
What were you trying, what has happened, what went wrong, and what did you expect?
Code and Logs