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

E (123456) wifi_init_default: netstack cb reg failed with 12308 (IDFGH-14107) #14916

Open
3 tasks done
kriegste opened this issue Nov 21, 2024 · 11 comments
Open
3 tasks done
Assignees
Labels
Status: Reviewing Issue is being reviewed

Comments

@kriegste
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

In ESP-IDF 5.3.1 with ESP32.

After using
esp_wifi_set_mode(WIFI_MODE_STA);
to disable the AP, this error appears:

E (123456) wifi_init_default: netstack cb reg failed with 12308

What does this error mean? And how do I fix it?

@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 21, 2024
@github-actions github-actions bot changed the title E (123456) wifi_init_default: netstack cb reg failed with 12308 E (123456) wifi_init_default: netstack cb reg failed with 12308 (IDFGH-14107) Nov 21, 2024
@kriegste
Copy link
Author

kriegste commented Nov 21, 2024

I do a

esp_wifi_set_protocol(ESP_IF_WIFI_AP, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_LR);

just before changing the mode. This seems to be the cause of the error. How can I avoid this problem?

@hansw123
Copy link
Collaborator

@kriegste
sorry for late reply ,could you please put the whole code which can reproduce the issue, this may help us to find the true reason correctly and quickly

@AxelLin
Copy link
Contributor

AxelLin commented Nov 27, 2024

E (123456) wifi_init_default: netstack cb reg failed with 12308

What does this error mean? And how do I fix it?

ESP_ERR_WIFI_STOP_STATE: /* 12308 0x3014 Returned when WiFi is stopping */

@kriegste
Copy link
Author

Try these two lines:

esp_wifi_set_protocol(ESP_IF_WIFI_AP, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_11AX | WIFI_PROTOCOL_LR);
esp_wifi_set_mode(WIFI_MODE_STA);

You might ask why I do this.

esp_wifi_set_protocol() always enables/disables the LR protocol for both the STA and AP interface. This is a general problem in ESP-IDF.
When my app needs to open an access point, it has to disable the LR protocol. Otherwise the access point cannot be found by any phone or computer.
So when it closes the access point again (this is the code above) the LR protocol needs to be enabled again.

@kriegste
Copy link
Author

Of course, it would be best to finally solve the underlying root issue, which is this:
#9978

@hansw123
Copy link
Collaborator

@kriegste
this err means the program is doing wifi stop, and we dont allow other apis to interrupt this action or doing wifi stop again.you should check your code about releated api which will do wifi stop

@kriegste
Copy link
Author

You mean esp_wifi_stop()? There is not a single call to this API in my whole app.

@hansw123
Copy link
Collaborator

@kriegste
other apis may have wifi stop action such as change wifi mode, change config and so on.
may be you can post more detailed code for refer,thanks!

@kriegste
Copy link
Author

kriegste commented Dec 1, 2024

I am working on a minimum code example. It is a bit harder than I thought.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed and removed Status: Opened Issue is new Status: In Progress Work is in progress labels Dec 4, 2024
@hansw123
Copy link
Collaborator

@kriegste could you offer your code which can reproduce the issue , or we can not find the root cause

@kriegste
Copy link
Author

I could narrow the problem down to the use of esp_wifi_internal_set_retry_counter() (I have very poor WiFi in one spot of the building and was experimenting with this function).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewing Issue is being reviewed
Projects
None yet
Development

No branches or pull requests

5 participants