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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -