aioespnow send method produces error on broadcast send (ValueError: Send timeout on synch.) #10004
-
Greetings: Relatively new to Micropython but knowledgeable about Python. Requesting assistance because I cannot find answers in my searches. Here is the backtrace: I am attaching the two files in the backtrace rather than presuming I know what to present. I appreciate your assistance. I found aioespnow.py at https://github.com/glenn20/micropython/blob/espnow-g20/ports/esp32/modules/aioespnow.py The relevant section is:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This is nothing special, I think. I don't have enough patience to analyze your whole program (this is your task, anyway).
|
Beta Was this translation helpful? Give feedback.
-
@garykuipers Thanks for the report. As you can see from esp_espnow.c#L504 this exception "should not happen". The ESP-NOW software stack is meant to invoke the send_cb() function (which updates self->tx_responses) when a sent packet is acknowledged by the peer OR after no response has been received (which is usually invoked within 25ms or so). I have never seen this happen, but it is interesting to know that it can. So, yes, as suggested by @karfas , best to just trap the exception and continue. I'll review my code to see if there is a better way to handle this now that I know it CAN occur or if there is some logic error on my part causing it to occur. Oh - and if this is happening rarely, it should have little impact on your application, BUT if it happen frequently then you will be carrying the burden of the 250ms timeout whenever this occurs. If that is the case, give me some more details about your device and I will try to test. |
Beta Was this translation helpful? Give feedback.
This is nothing special, I think.
You get a timeout when sending to
to_mac[0]
(which is most likely different fromto_mac[1]
printed) and you don't handle the resulting exception.Maybe to_mac[0] is not started, disconnected, whatever ?
I don't have enough patience to analyze your whole program (this is your task, anyway).