-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
esp32 Modbus TCP master problem (IDFGH-8393) #9860
Comments
I have try tcp modbus with the new patch : esp-modbus component, |
Hello @zhangxujun16, Thank you for this issue. In order to reproduce the issue please send your whole TCP modbus project including the Thank you. |
Thank you very much, If use the new modbus patch, mbc_master_set_descriptor must be called before mbc_master_start. Otherwise it will go to panic . The old doesn't require this . I will test for several days whether it is stable . |
**After test modbus tcp , I find a problem . |
In fact all your register areas should be defined calling
If the master lost connection with certain modbus slave and it is not recovered after Thanks. |
@alisitsyn |
The stack is designed in such a way that if one node of the network is not alive the master can not normally proceed with control process and starts the re-connection stage after connection timeout. Usually the master is able to reconnect to slave and restart the polling cycle. If you need other behavior you need to perform some modification of the tcp port code as described below. The stack handles the communication fails in two places:
In these cases the master :
If you need other behavior you can change the code in above branches to be able to continue the polling cycle even if the slave A is disconnected. Using the above information you can modify the code above to perform your custom behavior of processing in case of slave errors. For example: you can check if the slave alive |
Thanks for reporting, will close due to short of feedback, feel free to reopen with more updates. Thanks. |
Answers checklist.
General issue report
Environment
Development Kit: [ESP32-Wrover-Kit]
Kit version (for WroverKit/PicoKit/DevKitC): [v4.4]
Module or chip used: [ESP32-WROVER-B]
IDF version: [v4.4]
Modbus TCP master can only works well for several minutes , and then show such error:
MB_CONTROLLER_MASTER: mbc_master_get_parameter(83): Master get parameter failure, error=(0x107) (ESP_ERR_TIMEOUT)
sometimes it can recover , and run several minutes , but then go to fail again.
sometimes it will also trigger watch dog like this:
_�[0;31mE (160376) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (160376) task_wdt: - IDLE (CPU 0)�[0m
�[0;31mE (160376) task_wdt: Tasks currently running:�[0m
�[0;31mE (160376) task_wdt: CPU 0: tcp_master_task�[0m
�[0;31mE (160376) task_wdt: CPU 1: IDLE�[0m
�[0;31mE (160376) task_wdt: Print CPU 0 (current core) backtrace�[0m
Backtrace:0x400F4416:0x3FFB0B800x40082C59:0x3FFB0BA0 0x4000BFED:0x3FFCEAF0 0x4008D4EA:0x3FFCEB00 0x4008A39F:0x3FFCEB20 0x4010DBB2:0x3FFCEB60 0x400F8D24:0x3FFCEB80 0x400F8D3F:0x3FFCEBA0 0x400F903E:0x3FFCEBC0 0x400F905A:0x3FFCEBE0 0x400FAD66:0x3FFCEC00 0x400FAE56:0x3FFCEC60 0x400DDB09:0x3FFCEC80 0x400DDBE2:0x3FFCECB0 0x400DDFEA:0x3FFCECE0 0x4008D239:0x3FFCED30_
once it trigger watch dog , it will never recover again and it always trigger wdt in loop .
What's wrong with the tcp modbus mater please ?
The text was updated successfully, but these errors were encountered: