Replies: 2 comments 11 replies
-
I just ran some tests between two ESP32 devices to double check: t1 = time.ticks_ms(); e.send(peer, 'ping'); t2 = time.ticks_ms(); print(time.dicks_diff(t1, t2)) # -> 2 ms if peer has wifi turned on
t1 = time.ticks_ms(); e.send(peer, 'ping'); t2 = time.ticks_ms(); print(time.dicks_diff(t1, t2)) # -> 25 ms if peer has wifi turned off
t1 = time.ticks_ms(); e.send(peer, 'ping', False); t2 = time.ticks_ms(); print(time.dicks_diff(t1, t2)) # -> 1 ms if peer has wifi turned on
t1 = time.ticks_ms(); e.send(peer, 'ping', False); t2 = time.ticks_ms(); print(time.dicks_diff(t1, t2)) # -> 1 ms if peer has wifi turned off ie. with build from micropython master (or nightly builds) send() only takes 25 ms if there is no Ack from the peer and |
Beta Was this translation helpful? Give feedback.
3 replies
-
I don't believe increasing the timeout will address the issue, after all,
radio waves travel 300km in one millisecond, so it won't be a propagation
time issue.
I think its more likely to be a wifi interference or signal strength issue.
I don't know about esp_now_set_p2p_timeout(). I will look into it (google
returns nothing), but I don't think that will help.
Note that if the ESPNOW doesnt receive a response within a millisecond or
so, it retransmits the message many times. It is all these retransmission
and wait for response that takes 25ms (see the 3rd graph at
https://github.com/glenn20/upy-esp32-experiments/blob/main/ESPNowvsWifiEnergyUsage/README.md
).
…On Thu, 11 May 2023, 12:42 am mmliam, ***@***.***> wrote:
Hi Glenn,
Thanks for the reply.
I had posted this on the ESP8266 forum, as I'm using an ESP8266 to
communicate with an ESP32. This was one reply:
Though ChatGPT says it is possible by using
esp_now_set_p2p_send_timeout()
This seems like the Arduino format; perhaps only Arduino supports setting
the timeout.
I'm using build v1.191(583K) on the ESP8266, and firmware-esp32-GENERIC on
the ESP32.
The timing tests I've done suggests the ESPNow send return is fixed at
25ms whether an Ack is received or not. I didn't think this was a bug, I
thought this was to maintain time synchronization between all transmitting
stations, which for me happens to be 5 ESP8266's.
My code does the following, an ESPNow send is issued; if the send returns
without an ACK the routine tries twice again to re-transmit waiting one
second in between retries. On the third Send failure it quits.
What I'm seeing is that the ESP32 receives the first transmission every
time, but sometimes the most distant ESP8266 does a second send (I never
see a third send). In other words it apparently didn't get the first ACK. I
thought that perhaps that the ESPNow timeout might be little too short, and
it wasn't waiting long enough for the first ACK; therefore increasing the
Send timeout might preclude the second transmission.
Do you have any thoughts on this?
Mike M.
—
Reply to this email directly, view it on GitHub
<#11454 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVEQR4P4I2AUAVKD2DC23DXFOSLZANCNFSM6AAAAAAX4BW6EQ>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The default timeout for an ESPNow Send is 25ms; it will return in 25ms either having received an Ack or not.
Is there a way to change the 25ms default timeout?
Thanks MM
Beta Was this translation helpful? Give feedback.
All reactions