hi would you be able to share your code, an old one i know but encountering the same issue
grasvezel wrote: ↑Thu Apr 12, 2018 3:36 pmI know it has been a few weeks, but I ran into similar problems, solved them and would like to share. I use a MAX-3485. Basically a 485 but for 3.3v instead of 5v. I couldn't get anyting to work using standard libraries. I used one of the many hardware examples in wich the DE and /RE are connected. DriverEnable is active high, ReceiverEnable is active low. So, why not use one GPIO and use that as a toggle between send and receive, right? After hours of debugging and hooking up a second ESP32/MAX3485 to see what was going on on the RS485 bus, I found that the DE dropped before the transmission of the Modbus frame was complete. My guess is that the library just goes ahead and drops the DE pin after the frame is sent, but at that time the ESP32 still has some data in the transmit buffer. Maybe that is a difference with arduinos, maybe those don't have a transmit buffer?
Anyway: I solved it by modifying my hardware a bit (RE is always low now) and implementing the Modbus protocol myself instead of using a lib. The protocol is quite straightforward. The only thing I had to deal with is reading back my own transmission because the receiver is always on now. But since I know exactly what I sent out, that's not difficult to do.
Who is online
Users browsing this forum: Google [Bot] and 10 guests