HI,
I am using master functionality with modbus slave device. Current program has strange issue and this appear with no consistency.
Sometime this happens after hour or 5hrs, 24hrs or 40hrs.
I have two registers to read/write. I receive command (example : 3:3:3:1:0 slaveid:fcode:address:length:value) from MQTT message for read or write operations. Based on the message, my program do required.
Until i get below error, everything works flawless.
When I try to read/write data to modbus slave, I get the following error.
MB_CONTROLLER_MASTER: mbc_master_send_request(131): SERIAL master send request failure error=(0x108) (ESP_ERR_INVALID_RESPONSE).
once the above error appear, the next requests read data is interchanged.
Example, before this error
3:3:3:1:0 response is 260
3:3:1:1:0 response is 1
after the above error occured,
3:3:3:1:0 response is 1 or 260
3:3:1:1:0 response is 260 or 1
I tried to restart my modbus slave, did not help.
I tried with modbus simulator, did not help.
I tried to do soft restart when this error occurs, did not help.
only way its working again was hard power restart.
My setup is
esp32 tx/rx <-> rx/tx RS485 TTL a/b -> a/b Modbus Slave
Any suggestions are really helpful.
Thanks,
Surendra
modbus issue while reading
-
- Posts: 211
- Joined: Fri Feb 01, 2019 4:02 pm
- Contact:
Re: modbus issue while reading
Hi Surendra,
Could you provide more information about your implementation? Do you have other tasks whose priority higher than FMB_SERIAL_TASK_PRIO option and how high if it is? Are these task(s) doing flash access (nvs) or disable CPU cache? Is the FMB_TIMER_ISR_IN_IRAM option set in your kconfig? Could you send your sdkconfig for verification? Could you provide your log file with the `Default log verbosity` is set to debug in kconfig?
Thanks.
--
Alexey
Could you provide more information about your implementation? Do you have other tasks whose priority higher than FMB_SERIAL_TASK_PRIO option and how high if it is? Are these task(s) doing flash access (nvs) or disable CPU cache? Is the FMB_TIMER_ISR_IN_IRAM option set in your kconfig? Could you send your sdkconfig for verification? Could you provide your log file with the `Default log verbosity` is set to debug in kconfig?
Thanks.
--
Alexey
Who is online
Users browsing this forum: Baidu [Spider], Bing [Bot], Corand and 116 guests