I want to try modbus energy monitor witn modbus serial interface. My board have onboard UARTS (Allwiner A10 soc) but for modbus i need extra pin for switch direction of 485 tranceiver.
Does modbus binding support pin driven uart or i need linux kernel that support uart 485 mode?
May be 485 mode for uart i must configure in dts?
Modbus binding uses a java serial transport module, as do other bindings using USB sticks etc. You’d need to present your port as a standard system serial port somehow - tty style. Don’t know how you’d do that.
Thank you for reply. Does binding have posibility to use GPIO to switch direction? Allwiner A10 linux arm board have few UART on board and presented in /tty style. But rs232-485 converter based on max485 chip need extra pin to control direction. In some linux modules for TI arm boards (olimex??) driver use rts signal to control direction but in allwiner uart driver in mainline kernel this is impossible now. May be i have to use usb-485 converter to use with binding.
That would be up to the serial transport module.
The Modbus binding allows us to specify flowControl options (RTS/CTS).
Then it is up to the serial transport module to decide what to do with those signals on the designated serial port.
So, in this case, does the Allwiner created tty port support directing RTS/CTS to a GPIO pin? Maybe if you find some kind of guide about using it in RS232 mode (where there are physical RTS/CTS pins) it might help.
USB/RS485 sticks are really cheap, and portable. I wouldn’t struggle with this.
Yes. I choose this. RTS CTS doesnt supprot yet in kernel -(. I do not have free usb ports on board but i hope usb hub resolve this-).-))
A more expensive solution is a wifi or ethernet gateway. OH talks Modbus-TCP over the network, the gateway talks Modbus-RTU to the slave. No extra ports used at host, just the existing net.
Yes. I know abourt esp8266 as a modbus tcp-rtu gateway. But i didn’t test it. It is really cheap solution, but reliability of this is unknown.
One of many commercial products
I use these and USR brand, reliable.