Closed Lagunaxx closed 3 months ago
Hi @Lagunaxx ,
Thank you for the issue and sorry for the late response.
Update: I tried to reproduce the issue you described as per log below but did not get the same result.
c) (1) AP disconnects it (old lost connection) (in this case we run modbus destroy),
In my code I do not destroy the stack on disconnection and it is able to reconnect and restart polling cycle again once the STA (Modbus slave) is connected.
I don't have your code but once you destroyed stack on disconnect where you initialize the stack after connection?
As per your log you successfully destroyed the stack on disconnect event then your polling task is trying to read discrete inputs but the event group handle is not actual and this causes the crash because the stack interface handle is not actual including all subsequent object handles. You need to change your algorithm to remove stack destroy on disconnection or handle disconnection and reconnection correctly including stack initialization, stop and restart of polling task before/after disconnection.
@Lagunaxx ,
Do you have an update for the issue?
@Lagunaxx, the issue will be closed because lack of feedback. Feel free to reopen if you have some results of test.
Hi. Have project with crashes modbas master 2 devices on esp32 (1st) tcp_Master and (2nd) tcp_slave. (1st) works in WiFi AP mode, (2nd) - STA 1) : Switch (1) on, wait till boot Switch (2) on - it connected normaly as result - modbus works well 2): (2) -Swich phisical power off wait any time or not wait <- here mast be on (1) modbus master at least one try to read data from (2) modbus slave __ (2) Switch power on as result: a) (2) booted, b) (2)tries to connect to (1)-AP, c) (1) AP disconnects it (old lost connection) (in this case we run modbus destroy), d) (2) tries to reconnect e) (1) accepts connection f) (2) connected? <-- (1) crashes somewhere here.