I am trying to find a simple example of using Modbus to link several Arduino Boards, simply sending digital and analogue signals from the Master to each Slave. Modbus seems overkill but the application involves large distances outdoor lighting. I have worked through the tutorials:
Long Distance Wired Serial Communication with Arduino using RS485 and CAT Cables
I have made this work but this only works for one Slave
RS-485 MODBUS Serial Communication using Arduino UNO as Slave
RS-485 MODBUS Serial Communication with Arduino as Master
Both of these involve a link to a computer and I can't work out how to adapt them to Arduino to Arduino.
Any assistance will be gratefully received
PS. The tutorials are very good with full detail.
Mike
In reply to Hi Mike by Debashis Das
Hi Debashis
i appreciate your response. I have tried this and all the responses I can find illustrate for two only. I do not understand how to do this for more than one slave. Any ideas?
regards
mike
Use two RS485 module in two different arduinos. Make one slave and other one as master. It will work.
In reply to Hiii by Sourav Gupta
Hi Sourav
i appreciate your response. I agree it works for master and one slave but I do not understand how to do this for more than one slave. Any ideas?
regards
Mike
For multiple slaves, you need slave adresses unique for each slaves and by using the slave address you could communicate with each of them one by one. Hope this help.
Hi Sourav
Thanks for the response. I am sure you are correct. The trouble is I do not know how to code that!
Regards
Mike.
Debashis Das
Joined December 02, 2019 117Monday at 10:02 PM
You can google for long-distance serial communication between two or more Arduino boards, I think it will redirect you to the sollution that you are looking for.