- September 16, 2022
- Posted by: AliensFaith
- Category: OBJECTIVE PRESS
Hello!
Recently, I have been trying to communicate with a solar charge controller I have (one of these https://www.epever.com/product/xtra-10-40a-mppt-solar-charge-controller/)..) I have learned that it uses Modbus over RS485. So, I purchased a modbus transceiver that uses a Max485 chip https://www.amazon.ca/gp/product/B09BKJ … UTF8&psc=1. I’ll need to pull off half-duplex communication using this chip. The transceiver has DE/RE signals which control whether data is being sent to the module or received from it. The issue I am having is that, I have no idea how to control these signals. If I do it from userspace, research has told me that it will be too slow (I need to operate at 115200 baud). I have tried using hardware flow control with GPIO17/16 as RTS/CTS, but it looks like that doesn’t do what I need. The RTS pin only changes state when the serial port is opened, not when sending/receiving data (also it goes low when the port is opened, thus disabling the transmitter). Any ideas on how to toggle the DE/RE pins when data needs to be sent?
Also, I am using Libmodbus, pigpio, and C.
submitted by /u/BadboyZ1299
[link] [comments]