-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTU ModBus unexpected event triggered 0x02 / Timeout before any socket was ready! (IDFGH-14408) #88
Comments
Hi @sorinvn, Thank you for this report.
The message Please provide more information on what kind of additional components are used and priorities of the tasks in your application. Also, please include extended Modbus log and sdkconfig file.
The issue is present with modbus v2.0 and 2.0.1. It was not present with v1.17. The v1.0.17 contains the commit which fixes the |
Hello Alex, thanks for your prompt reply. noted your comment re mbc_master_send_request. |
@sorinvn ,
Thank you for the feedback.
Thanks for the clarification I will take a look to it as soon as I can. For now please try to follow the above recommendations to optimize your system to not block the Modbus for long time and let me know if you have any updates. UPDATE: the error happens because the Modbus can not get the events after timeout.
This message can be caused due to rare communication and expected. The verbosity of this message will be changed to debug later. Also, the debug messages will not be showed by default in the log. Thanks. |
Checklist
How often does this bug occurs?
always
Expected behavior
I am using ESP32-C3 Modbus RTU with modbus version 2.0.1 for communication with Schneider iem3150 energy meter.
Every 3 seconds I get an " unexpected event triggered", nevertheless both reading and writing registers work fine.
Actual behavior (suspected bug)
Please see below error log (debug enabled). Timeout messages start to occur immediately after modbus initialization. Before any write or read operation, the error message is "unexpected event triggered 0x02", after performing a write operation the error message changes to "unexpected event triggered 0x40".
This error occurs aftert getting "transport_base: poll_read: select - Timeout before any socket was ready!" every second. From what see, this message is triggered by the TCP communication stack (?!) and is present both with Modbus TCP enabled or disabled in sdkconfig (only RTU is used).
Additionally (independent issue), the first write message also shows the behavior described in IDFGH-10848, nevertheless after retry the write operation is done correctly.
The issue is present with modbus v2.0 and 2.0.1. It was not present with v1.17.
This issue is not critical since both read and write are ok, so it looks like a nuisance message.
Error logs or terminal output
Steps to reproduce the behavior
Below are the modbus init and write procedures:
void app_iem3150_set_date_time(void *arg) {
time_t time_raw;
struct tm *time_info;
time( &time_raw );
time_info = localtime( &time_raw );
ESP_LOGE(func, "IEM3150 Set local time and date: %s", asctime(time_info));
}
esp_err_t app_iem3150_init(void)
{
// Initialize and start Modbus controller
mb_communication_info_t comm = {
.ser_opts.port = MB_PORT_NUM,
.ser_opts.mode = MB_RTU,
.ser_opts.baudrate = MB_UART_SPEED,
.ser_opts.parity = MB_PARITY_NONE,
.ser_opts.uid = 0,
.ser_opts.response_tout_ms = 1000,
.ser_opts.data_bits = UART_DATA_8_BITS,
.ser_opts.stop_bits = UART_STOP_BITS_1
};
}
Project release version
v2.0.1
System architecture
ARM 64-bit (Apple M1/M2, Raspberry Pi 4/5)
Operating system
MacOS
Operating system version
macos 15.2
Shell
ZSH
Additional context
IDF 5.3.2 or 5.4
The text was updated successfully, but these errors were encountered: