Hello everyone,
I wanted to follow up on my earlier post.
I’ve discovered the underlying issue and a solution that might help others experiencing similar problems.
It turns out that the logging was inadvertently affecting the timing of the ESP32. When logging was active, it slowed down the ESP32 just enough to allow the transmission process to complete correctly. Once I closed the log window, the ESP32 would run without this slight delay to close the RS485 transmission with GPIO5, causing the transmissions to not be completed.
It’s a matter of ms. (increase to 7ms instead of 5ms the delay).
Next time, I will buy a more expensive RS485 to TTL adapter with automatic flow control.