The availabel constructor and begin method in the Modbus class alows only RS232 communication for SoftwareSerial since the u8txenpin is allways 0 in this use case.
Solution:
I add an additional begin method for Software Serial:
void begin(SoftwareSerial *sPort, long u32speed, uint8_t u8txenpin);
This allows the use of the txenpin even for SoftwareSerial and hence the use in RS485 communications.
Additionally I fixed some compile warnings. Now it compiles in the Arduino IDE 1.8.9 even with -Wall without any warning.
Problem:
The availabel constructor and begin method in the Modbus class alows only RS232 communication for SoftwareSerial since the u8txenpin is allways 0 in this use case.
Solution:
I add an additional begin method for Software Serial:
void begin(SoftwareSerial *sPort, long u32speed, uint8_t u8txenpin);
This allows the use of the txenpin even for SoftwareSerial and hence the use in RS485 communications.
Additionally I fixed some compile warnings. Now it compiles in the Arduino IDE 1.8.9 even with -Wall without any warning.