Closed Antoine2211 closed 1 month ago
It should work, but I haven't tested it.
Don't set a dePin, when you try: use ModbusRTUSlave modbus(Serial);
instead.
Be aware of Arduino rebooting when built-in USBtoSerial is used. I stumbled upon this effect just now. I use pymodbus on my Raspberry as master and Arduino Nano connected via USB. Each time I open /dev/ttyUSB0 Arduino restarts. This is required for programming via USB to work and is not related to communication.
ok it works fine with the Arduino Leonardo <-> PC Be aware on the PC side to open the Serial Port with the option Dtr (DtrEnable at true in C#) if not the Serial.write doesn't work on the Arduino Leonardo side.
Hello, @CMB27
Is it possible to use the library with an Arduino Leonardo and the Serial USB?
https://github.com/CMB27/ModbusRTUSlave/blob/db7627af7d716035225d3b7a42b2cff8c30fde55/examples/ModbusRTUSlaveExample/ModbusRTUSlaveExample.ino#L81
regards,