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

Soft AP does not reset AID of clients on power cuts (IDFGH-12159) #13215

Closed
3 tasks done
SmartAppsML opened this issue Feb 19, 2024 · 9 comments
Closed
3 tasks done

Soft AP does not reset AID of clients on power cuts (IDFGH-12159) #13215

SmartAppsML opened this issue Feb 19, 2024 · 9 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@SmartAppsML
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.

IDF version.

release/v5.1

Espressif SoC revision.

ESP32-S3

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

esp-idf

Power Supply used.

USB

What is the expected behavior?

When disconnecting a client (ESP32) from the WiFi Soft AP (also ESP32), it triggers a STADISCONNECTED event, which is fine. However if the client connects again, this will lead to a new AID being assigned to the client without removing the old one. Repeating this 10 times leads to all the wifi slots being filled up, allowing no more connections to WiFi.

Also, it is not possible to use the deauth_sta function and remove the "faulty" AID.

What is the actual behavior?

The internal AID entry should be removed to free up the slot.

Steps to reproduce.

  1. Set up Soft AP with ESP32-S3.
  2. Set up client with ESP32-S3 and connect it to the Soft AP.
  3. Reset the client, let it connect.
  4. Repeat step 3 until the maximum AID is reached.
  5. Now, no new devices are able to connect.

Debug Logs.

No response

More Information.

No response

@SmartAppsML SmartAppsML added the Type: Bug bugs in IDF label Feb 19, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 19, 2024
@github-actions github-actions bot changed the title Soft AP does not reset AID of clients on power cuts Soft AP does not reset AID of clients on power cuts (IDFGH-12159) Feb 19, 2024
@mhdong
Copy link
Collaborator

mhdong commented Feb 20, 2024

Hi @SmartAppsML
3. Reset the client, let it connect.
Are you trying to reconnect after reset using the same device?
If using the same device, multiple connections will obtain the same AID.
If different devices are used, due to a sudden power off, the connection is still considered to exist for SoftAP until the active timeout. At this point, a new device is attempting to connect and cannot use the already occupied AID.

By the way, if it's convenient, please provide the log you reproduced.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Feb 20, 2024
@SmartAppsML
Copy link
Author

SmartAppsML commented Feb 20, 2024 via email

@mhdong
Copy link
Collaborator

mhdong commented Feb 21, 2024

Hi @SmartAppsML
Please provide the commit for IDF so that we can try to reproduce it. We have already fixed similar issues. If you are not using the latest release/v5.1, please use the latest and have a try.
d922d41

@SmartAppsML
Copy link
Author

Thank you for the fast reply! I have tested the issue with the latest release/v5.1 but it is still a problem.

  1. The access point connects to the Soft AP and gets AID 1.
    image

  2. Now I press "RESET" on the client. After resetting, it connects to the Soft AP again, receiving AID 2. AID 1 is not freed at this moment, so repeating this 10 times blocks all free slots.

image

  1. Doing it again...

image

And so on. Thank you for looking into it!

@mhdong
Copy link
Collaborator

mhdong commented Feb 21, 2024

Hi @SmartAppsML
ap_aid_always_1.txt
sta_commit_d922d4178f0.txt

We tried to reproduce it locally using the demos of esp-idf/examples/wifi/getting_started/softAP and esp-idf/examples/wifi/getting_started/station by two ESP32S3 boards. And the idf commit was d922d41. It is indeed impossible to reproduce it, and the log is shown in the above file.

Please provide more logs for us to analyze.

@SmartAppsML
Copy link
Author

Hey @mhdong indeed I checked the version again and was on an older version of 5.1. It is actually fixed using the latest commit! Thank you!

@AxelLin
Copy link
Contributor

AxelLin commented Feb 22, 2024

@mhdong
Could you share which commit fixed the issue? (I'd like to check if my firmware is impacted by this issue)

@SmartAppsML
Copy link
Author

@AxelLin The latest one did it, as @mhdong mentioned: d922d41

@mhdong
Copy link
Collaborator

mhdong commented Feb 22, 2024

Hi @AxelLin
18ffa02 fixed this aid issue for release/v5.1.
79ddd24 for master

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress labels Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants