If I want to use the arduino YUN as modbus master by serial port to communicate with a slave device, and also make this arduino YUN as modbus slave by wifi to communicate with a master device. How can I do it?
I am researching on the same Modbus Master Slave function too.
As the serial port on Yun is virtual (ie. no dedicated chip to handle serial communication), I am wondering if we should add a RS485 shield for more reliable performance.
I've written quite a few implementations of both modbus master and slave, both serial and TCP. For various platforms including x86 and PIC.
Yes, you can use the same host as both a master and a slave as long as they are on different interfaces.
Hi SPlatten,
How it's possible?
How i can do it?
Assuming you have written the implementations for both Master and Slave, you then just assign each to a different serial port.
If you are asking how to write the modbus implementations I suggest downloading the Modicon Modbus Protocol Specification or visit: http://www.libstock.com/ and download my master and slave projects which include the source code written in C for PIC's.
Slave => LibStock - Serial Modbus Slave
Master => LibStock - Serial Modbus Master
It should be quite straight forward to port to Ardunio Yun.
Kind Regards,
Simon