Modbus RS485 implementation using UART1 and TTL module
Has anyone tried Modbus 485 using https://www.sparkfun.com/products/10124
this TTL module?
the RS485 converter will need 3 main connections
- Data Enable
you will need to set DE pin high and low based on data read write operation. To make the communication reliable you will need to use interrupts.
you can look into this product as well
RS485 UART converter
this one has an on board processor which will do all the data interpretation for you and you will communicate with this device just like a UART device and it will convert the data into RS485 and during the read operation, it will convert data from RS485 to UART.
Thank you for the hardware details..but what about software integration?
it will connect to onion omega uart. and you will read write data on uart and it will get converted in rs485.
omega serial communication
You can use pyserial as well.
learn more about pyserial
..but what about software integration?
MinimalModbus is an easy-to-use Modbus RTU and Modbus ASCII implementation for Python with very good documentation.
You should install (after an
opkg install python
opkg install python-pyserial
opkg install python-pip
pip install minimalmodbus