Skip to content
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

Would be nice to have a WIFI_EVENT_CHANNEL_CHANGE (IDFGH-11400) #12538

Closed
moefear85 opened this issue Nov 7, 2023 · 4 comments
Closed

Would be nice to have a WIFI_EVENT_CHANNEL_CHANGE (IDFGH-11400) #12538

moefear85 opened this issue Nov 7, 2023 · 4 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@moefear85
Copy link

Is your feature request related to a problem?

Espnow fails to send if the configured peer channel is different than the home channel. But the home channel can change at any moment if wifi is configured as STA or APSTA.

Describe the solution you'd like.

It would be nice if there were a WIFI_EVENT_CHANNEL_CHANGE event, so that one can detect the channel change, and either modify peer infos, or ask the user what to do.

Describe alternatives you've considered.

No response

Additional context.

No response

@moefear85 moefear85 added the Type: Feature Request Feature request for IDF label Nov 7, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 7, 2023
@github-actions github-actions bot changed the title Would be nice to have a WIFI_EVENT_CHANNEL_CHANGE Would be nice to have a WIFI_EVENT_CHANNEL_CHANGE (IDFGH-11400) Nov 7, 2023
@zhangyanjiaoesp
Copy link
Collaborator

Suppose that at the beginning, A and B establish ESPNOW communication on channel 1. Later, A may connect to the AP on channel 11, and the home channel change to channel 11.
At this time, A post a WIFI_EVENT_CHANNEL_CHANGE event, the user may can change the peer's info of A, A can send ESPNOW data without channel error, but B is still on channel 1, so they still can't communicating properly.

@moefear85
Copy link
Author

moefear85 commented Nov 8, 2023

True, but there are cases where that isn't important, or A can otherhow signal to B that a channel change must happen, or both might be connected to same AP, but the apps want to do something special on channel change, such as blink an LED or write a log.
Or A might decide to temporarily or permanently disconnect from the AP and return to previous channel.

@moefear85
Copy link
Author

Also, I realize from the documentation, esp_now_add_peer takes a wifi_interface_t through esp_now_peer_info_t. If upon sending a packet from a non-matching interface, esp_now_send can return ESP_ERR_ESPNOW_IF. There is unfortunately no equivalent error code in case of channel mismatch. The printed output to the console is useful for a human reading the logs, but not for the app.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Nov 9, 2023
@zhangyanjiaoesp
Copy link
Collaborator

we will consider to add the channel change event, and return channel error when call esp_now_send()

@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed and removed Status: In Progress Work is in progress labels Nov 30, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Reviewing Issue is being reviewed labels Dec 13, 2023
espressif-bot pushed a commit that referenced this issue Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

3 participants