problem to use the SimpleModbusMaster library

Hi guys, I'm following this thread to do the Modbus master on my arduino YUN:

but when I burn the program into the board this error comes out:

modbus_configure(&Serial, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS);

cannot convert 'Serial_' to 'HardwareSerial' for argument '1' to 'void modbus_configure(HardwareSerial*, long int, unsigned char, unsigned int, unsigned int, unsigned char, unsigned char, Packet*, unsigned int)'

I don't quite understand this problem and how to solve it?

The AVR side of the Yun is an ATmega32U4, the same processor as the Leonardo has. On these Arduino types the “Serial” object is not a HardwareSerial class instance but connected to the USB serial emulation. Use the “Serial1” object there to access pins 0 and 1.

oh, I see it, thanks :) :)

Hi, everybody. How I understood, in Arduino YUN it is impossible to realize data transmission under the Modbus protocol through USB (object of Serial)? Not through Tx (0) and Rx (1) pins.