Re: Multi-function RS-485 remote sensor
Posted: Fri Jul 13, 2018 12:44 am
Which one? I post a lot of them!I have a TTL to RS485 converter like you
I suppose that GPIO17 is your direction of your signal. This will never works for two reasons.
1 - There is a buffer in the transmit data. The data are still transmitted when the function ser.write() returns. Then there is no chance that the unit returns something since the full packet is never received.
2- Even if the packet is received there is a good chance that the direction won't be set in times. The python is quit slow and it is possible that the O.S. will do something else and add a delay because it will do other task. Then the direction bit will be too late .
If you read my post I used a build in USB to RS-485 with automatic handling transmit/receive direction. Or I used a little cpu to handle the direction.
What is your device b.t.w. ?