-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Bugfix for incorrect wifi-hardware timing #4558
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
Conversation
WalkthroughThe modification in this change introduces a 5-millisecond delay in the Changes
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
wled00/wled.cpp (1)
763-763: LGTM! Consider adding a comment explaining the delay's purpose.The 5ms delay is a reasonable fix for WiFi hardware initialization issues on C3 devices. While not the most elegant solution, it's a pragmatic approach given the lack of documentation on exact timing requirements.
Consider adding a comment explaining the delay's purpose:
WiFi.disconnect(true); // close old connections - delay(5); // wait for hardware to be ready + delay(5); // wait for WiFi hardware to stabilize (fixes AP initialization on C3 devices)Future improvements could include:
- Making the delay configurable per device type
- Investigating hardware status registers to implement a proper wait-until-ready check
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
wled00/wled.cpp(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (12)
- GitHub Check: wled_build / Build Enviornments (esp32_wrover)
- GitHub Check: wled_build / Build Enviornments (esp32s3_4M_qspi)
- GitHub Check: wled_build / Build Enviornments (esp32s3dev_8MB_opi)
- GitHub Check: wled_build / Build Enviornments (esp32s3dev_16MB_opi)
- GitHub Check: wled_build / Build Enviornments (esp32c3dev)
- GitHub Check: wled_build / Build Enviornments (lolin_s2_mini)
- GitHub Check: wled_build / Build Enviornments (esp32_eth)
- GitHub Check: wled_build / Build Enviornments (esp32dev_V4)
- GitHub Check: wled_build / Build Enviornments (esp32dev)
- GitHub Check: wled_build / Build Enviornments (esp8266_2m_compat)
- GitHub Check: wled_build / Build Enviornments (nodemcuv2_compat)
- GitHub Check: wled_build / Build Enviornments (nodemcuv2)
|
BTW I am making modifications to connection handling in |
this fixes the AP not initializing on some hardware due to incorrect timing.
Adding this short delay fixes it on tested C3 devices. I did not find any documentation stating how much delay is required.
@blazoncek is there any downside to adding this delay for all devices? The delay is not the cleanest solution, it would be better to check the state of the wifi hardware but I have no idea what to check.
Summary by CodeRabbit