Modbus crashing when second UART port in use
Posted: Wed Jun 05, 2024 8:22 am
Hi All,
I am using ESP32 with the following configuration:
In menuconfig → Component config → ESP System Settings I have defined:
Everything works fine and I can read logs on pins 27 and 26, while sending commands via Modbus on pin 3 and 26. However, when the traffic increases (high speed commands via Modbus) AND many logs are printed, the Modbus connection starts to slow down, have timeouts and eventually the ESP crashes.
If logs are disabled, everything works fine. Reproduced on several ESP32.
I am compiling with:
Anyone can shed some light on this? Is there a way for me to improve Modbus stability?
I am using ESP32 with the following configuration:
Code: Select all
...
#define PIN_MODBUS_RX 3
#define PIN_MODEM_RX 26
#define MODBUS_UART_PORT UART_NUM_2
#define MODBUS_BAUD_RATE 115200
...
Code: Select all
Channel for console output (Custom UART) --->
UART peripheral to use for console output (0-1) (UART0) --->
(27) UART TX on GPIO#
(26) UART RX on GPIO#
(115200) UART console baud rate
If logs are disabled, everything works fine. Reproduced on several ESP32.
I am compiling with:
Code: Select all
[1/2] espressif/esp-modbus (1.0.15)
[2/2] idf (5.2.1)