Modbus RTU failure to read from slave

Hello, my partner and I are attempting to use Modbus RTU to get a master (an UNO) and a slave (a Nano) to communicate data back and forth.

We are using fabricated Modbus RTU modules on both master and slave that use MAX 485 chips.
[[/url]

We used this site to wire the boards together, minus the LCD screen.
[ [/url]

Currently we are using the SimpleModbusMaster and SimpleModbusSlave to communicate as they seem to be well flushed out and have example programs.
[[/url]

The example programs use a potentiometer on one to alter the brightness of an LED on the other. (Ex. Changing the potentiometer on the master will change the brightness of the LED on the slave and vice versa)

Using the given example programs, we can get the master’s potentiometer to alter the slave’s LED, but not the other way around.
Using SoftwareSerial and another nano, we have been able to prove that the Slave is both receiving the request and storing the potentiometer data in the correct holding register
We have not been able to see if the Master is even seeing the data or if it is just timing out. We aren’t even sure where exactly it is supposed to be storing the value read from the Slave.

We have been reading MANY forum posts that are similar, but none of the proposed solutions have worked.
What we have tried so far:
• Pull up resistor on RX on the Master side
• Made sure both master and slave were sending and receiving using an LED
• Checked the all values stored within the master for the entire array of regs on the Master
• Changed pin numbers on inputs and outputs
• Raised timeout value – helped a little with what is currently working
• Added a delay –made everything worse (unsurprising)

Other, older, forum posts (and the manual) talk about being able to see failed requests and number of retries, but do not give examples of how to use or access these functions within the library. (My partner and I are very new at this)

Any advice would be appreciated

/*Edit: on the attachments the names are switched for the SerialMonitor and the Slave.

SlaveCode.ino (655 Bytes)

MasterCode.ino (1.93 KB)

SoftwareSerialReader.ino (4.52 KB)](Modbus RTU libraries for Arduino - Google Drive)](RS485 Serial Communication between Arduino Uno and Arduino Nano)](https://www.ebay.com/itm/272999927128)

I am having a similar problem, however I’m using two unos. I did not buy the module that you have, but I have the same MAX485 chip.

kitkatkatie:
Using the given example programs, we can get the master’s potentiometer to alter the slave’s LED, but not the other way around.

that's pretty clear:
The examples from RS485 Serial Communication between Arduino Uno and Arduino Nano only contains code to send analogRead data from a so called master to the slave on plain RS485.

On the other hand, the simplemodbusmaster library is optimized that a master RETRIVES data from a slave on permanent base.

regarding

Other, older, forum posts (and the manual) talk about being able to see failed requests and number of retries, but do not give examples of how to use or access these functions within the library.

you simplemodbus maste code attached to the post, doesn't contain any "error/failed" messages output, so you can't expect to it. This is a example how to print these kind of messages, keep aware, that I'm using Serial for debugging (I'm using a Mega with), in your case it should be your softserial mySerial

Serial.print("requests: ");
Serial.print(packets[PACKET0].requests);
Serial.print("; successful_requests: ");
Serial.print(packets[PACKET0].successful_requests);
Serial.print("; failed_requests: ");
Serial.print(packets[PACKET0].failed_requests);
Serial.print("; exception_errors: ");
Serial.print(packets[PACKET0].exception_errors);
Serial.print("; connection: ");
Serial.print(packets[PACKET0].connection);
Serial.println("\n");

hope this clarified some things for you. If you need more information first describe in detail what you want to achieve, best make a simple picture/diagramm, what kind of data (payload) you want to transmit from which module to another, just to have a clear understanding who is a master - who should be a slave.

If you have difficulties to get proper communication based on the simplemodbus example programms, make a clear picture of your test environment, where we can see EACH single wire.