jSerialComm added support for explicitly configuring the RS-485 mode of an interface on Linux a while ago. This does not introduce breaking changes to the API but always configures RS-485 mode via ioctl TIOCSRS485 which is off by default.
This breaks j2mod on Linux systems where the RS-485 mode of a serial interface is pre-configured at boot time and did not get touched afterwards. The following issues are likely surfacing phenomenons of that:
This PR adds the necessary configuration parameters to configure RS-485 mode explicitly from j2mod as well and allows to revive RS-485 operation. Our new configuration looks like
final SerialParameters result = new SerialParameters(
portName,
19200,
AbstractSerialConnection.FLOW_CONTROL_DISABLED,
AbstractSerialConnection.FLOW_CONTROL_DISABLED,
8,
AbstractSerialConnection.ONE_STOP_BIT,
AbstractSerialConnection.EVEN_PARITY,
false,
// Here we come - the new parameters for configuring RS-485 mode:
true,
false,
5000,
2000);
using the newly added constructor for setting the four RS-485-related parameters as well. The already existing constructors set default values for the new RS-485 parameters and keep RS-485 mode disabled.
jSerialComm added support for explicitly configuring the RS-485 mode of an interface on Linux a while ago. This does not introduce breaking changes to the API but always configures RS-485 mode via ioctl
TIOCSRS485
which is off by default.This breaks j2mod on Linux systems where the RS-485 mode of a serial interface is pre-configured at boot time and did not get touched afterwards. The following issues are likely surfacing phenomenons of that:
This PR adds the necessary configuration parameters to configure RS-485 mode explicitly from j2mod as well and allows to revive RS-485 operation. Our new configuration looks like
using the newly added constructor for setting the four RS-485-related parameters as well. The already existing constructors set default values for the new RS-485 parameters and keep RS-485 mode disabled.
For correctly configuring the delay timing, https://github.com/Fazecast/jSerialComm/pull/353 is required for jSerialComm too.