arduino-libraries / ArduinoModbus

244 stars 116 forks source link

Clarification regarding RS485 PORT #146

Closed sunilkumar105 closed 4 months ago

sunilkumar105 commented 4 months ago

Uno Compatibility

Is this library compatible with Arduino Uno?

Which pin is RX and TX?

I was exploring the rs485 library on which this library is dependent for RTU,

#ifndef RS485_DEFAULT_TX_PIN
#ifdef PIN_SERIAL1_TX
#define RS485_DEFAULT_TX_PIN PIN_SERIAL1_TX
#else
#define RS485_DEFAULT_TX_PIN 1 
#endif
#endif

#ifdef __AVR__
#define RS485_DEFAULT_DE_PIN 2
#define RS485_DEFAULT_RE_PIN -1
#elif ARDUINO_NANO_RP2040_CONNECT
#define RS485_DEFAULT_DE_PIN A1
#define RS485_DEFAULT_RE_PIN A0
#elif ARDUINO_SAMD_ZERO
#define RS485_DEFAULT_DE_PIN A4
#define RS485_DEFAULT_RE_PIN A5
#else
#ifndef RS485_DEFAULT_DE_PIN
#define RS485_DEFAULT_DE_PIN A6
#define RS485_DEFAULT_RE_PIN A5
#endif
#endif

Here I couldn't find the pin number on which tx, rx pin is connected, however de/re pin is mentioned there.

Software Serial

Does this library needs HARDWARE SERIAL ONLY, or can we run it using software serial?

Implementation of transmitting and receiving data

Can you please help me finding where is the exact implementation of transmitting and receiving data as I couldn't find it either in modbus / rs485 blibrary.

per1234 commented 4 months ago

Hi @sunilkumar105. Thanks for your interest in this open source project. This issue tracker is only to be used to report bugs or feature requests specific to the project. This topic is more appropriate for the Arduino Forum. I'm sure we will be able to help you out over there:

https://forum.arduino.cc/


UPDATE: Forum topic here:

https://forum.arduino.cc/t/modbus-rtu-using-arduino-modbus-libarray/1227939