python - Pymodbus Rtu over Max485(Half duplex) -
i want communicate pic raspberry pi 3. wrote simple code on both devices , data when tx , rx pins connected directly wire.now long distance communication want implement max485. using library function @ raspberry pi side not able control de , re of max485 through gpio when trying read data. tried connecting re gnd , de vcc did not data.how solve problem??
import pymodbus pymodbus.client.sync import modbusserialclient modbusclient client= modbusclient(method = "rtu", port="/dev/ttyama0",stopbits = 1, bytesize = 8, parity = 'e' baudrate= 9600) while true: data = client.read_input_registers(30001, 4, unit=1) print data.registers
this program fine direct connection .what modifications have done implement on max485?
Comments
Post a Comment