Closed mstegen closed 6 months ago
In order to receive/send data correctly i had to patch the RTUutils.cpp file which is part of the eModbus library
line 213: after // Toggle rtsPin, if necessary rts(LOW); serial.read(); // <- add this
comment out line 327: // No, packet was too short for anything usable. Return error //rv.push_back(PACKET_LENGTH_ERROR);
This might not be needed when your rs485 bus is correctly terminated, and biased correctly.
In order to receive/send data correctly i had to patch the RTUutils.cpp file which is part of the eModbus library
line 213: after // Toggle rtsPin, if necessary rts(LOW); serial.read(); // <- add this
comment out line 327: // No, packet was too short for anything usable. Return error //rv.push_back(PACKET_LENGTH_ERROR);
This might not be needed when your rs485 bus is correctly terminated, and biased correctly.