Hello everyone!
I'm using two arduino and one rasperry connected by rs485 ModBus, my goal is send from arduino_1 (master+slave) to raspberry_2 (master) the data received from the arduino_2 (slave).
Raspberry_1 (master) makes a call to arduino_1 (slave) and next arduino_1 (master) makes a call to arduino_2 (slave)
I tried arduino_1 can do at the same time master and slave so I think that arduino_1 can do as a concentrator for arduino_2, arduino_3 ... arduino_n but I need to intercept in arduino_1's code when the raspberry (master) calls him so I wrote:
Rxstate = slave.poll(au16regs, 16);
if (Rxstate >4) {
to do.... (call to arduino slave)
}
but Rxstate (uint_8 type) is always 0.
I check the code of ModbusRtu.h and I see slave.poll() process should return a value of i8state (4 < i8state < 7) if no exception occurred .
Why slave.poll() function returns always 0?
thank you for answer.