ArduinoModbus icon indicating copy to clipboard operation
ArduinoModbus copied to clipboard

Any chance to implement software serial? and several more.

Open ijash opened this issue 4 years ago • 2 comments

I've been reading this good article. He's been testing some libraries across the web and make some good comparison points. Let me quote some for this particular library:

https://github.com/arduino-libraries/ArduinoModbus

  • Official library from Arduino.
  • Master and slave.
  • Uses the RS485 library to communicate, but does not offer any way to pass a custom RS485 instance, so it is effectively hardcoded to a specific serial port.
  • Offers only single value reads and writes.
  • Slave stores value internally and reads/writes directly from those, without any callback or way to detect that communication has happened.

More on the page, and I hope this reference makes a good study for further improvement. So, for my personal request, Any chance to implement to softwareSerial? So many other boards can use this library later.

Because I want the official library can cover it all.

Thanks in advance.

ijash avatar Mar 22 '20 10:03 ijash

What would be needed on this library is to allow passing a custom RS485 instance, rather than hardcoding to the predefined global RS485 instance.

Additionally, the RS485 library should also be modified to accept a Stream instead of a HardwareSerial instance, so you can also pass SoftwareSerial (or other streams) instead of just HardwareSerial.

matthijskooijman avatar Mar 22 '20 11:03 matthijskooijman

Would be pretty nice if this would be an option. Or is there another workaround to get this library working on an Arduino UNO?

larsvankleef avatar Jun 22 '21 18:06 larsvankleef