Skip to content

Conversation

DavePutz
Copy link
Collaborator

@DavePutz DavePutz commented Feb 9, 2022

Issue #5980. Using ESP_PING_PROF_DURATION to check for timeout was always returning zero values until a response was returned. Thus, the code checking for a timeout never detected one. Replaced that check with a manual one using common_hal_time_monotonic_ms().
Note that the actual cause of the crash into safe mode was not determined or corrected; this is a workaround that avoids whatever was going on. It does fix the ping timeout logic, though. Note also that removing the line
esp_ping_get_profile(ping, ESP_PING_PROF_DURATION, &total_time_ms, sizeof(total_time_ms));
which should no longer be needed, can also result in crashes into safe mode.

Copy link
Member

@anecdata anecdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and confirmed much improved behavior. Should be fine for most typical use cases. As noted, it can still go into Safe Mode if really pushed (many very-fast sequential pings).

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dave!

@tannewt tannewt merged commit c9b494b into adafruit:main Feb 10, 2022
@DavePutz DavePutz deleted the issue_5980 branch June 14, 2022 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants