Always print full provisioning receipt and early quick-connect details on boot#300
Always print full provisioning receipt and early quick-connect details on boot#300
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request aims to significantly improve the first-boot experience and ongoing device accessibility by ensuring critical provisioning and quick-connect information is always readily available via the serial console. By removing first-boot gating and reordering print statements, users can now access device credentials and connection details much earlier and more consistently, streamlining the setup and management process. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the boot process to always print the full provisioning receipt and quick-connect details, which improves user experience by reducing first-boot friction. The changes are logical and align with the stated goals. I've identified an opportunity to improve maintainability by refactoring duplicated code into a helper function.
Note: Security Review did not run due to the size of the PR.
| #if FEATURE_WIFI_AP | ||
| Serial.println("[PROV] Quick connect:"); | ||
| Serial.printf("[PROV] WiFi SSID : %s\n", g_device.ap_ssid); | ||
| Serial.printf("[PROV] WiFi PASS : %s\n", g_device.ap_password); | ||
| Serial.printf("[PROV] URL : %s://canary.local (or %s://%s)\n", | ||
| g_tls_enabled ? "https" : "http", | ||
| g_tls_enabled ? "https" : "http", | ||
| WiFi.softAPIP().toString().c_str()); | ||
| Serial.printf("[PROV] API TOKEN : %s\n", g_device.api_token_str); | ||
| #endif |
There was a problem hiding this comment.
This block of code is nearly identical to the one added earlier in the setup() function (lines 4248-4259) for printing early quick-connect details. To avoid code duplication and improve maintainability, consider refactoring this logic into a helper function.
For example, you could create a function like print_quick_connect_details:
static void print_quick_connect_details(const char* title) {
#if FEATURE_WIFI_AP
if (g_device.initialized) {
Serial.println(title);
Serial.printf("[PROV] WiFi SSID : %s\n", g_device.ap_ssid);
Serial.printf("[PROV] WiFi PASS : %s\n", g_device.ap_password);
Serial.printf("[PROV] URL : %s://canary.local (or %s://%s)\n",
g_tls_enabled ? "https" : "http",
g_tls_enabled ? "https" : "http",
WiFi.softAPIP().toString().c_str());
Serial.printf("[PROV] API TOKEN : %s\n", g_device.api_token_str);
}
#endif
}Then you could replace both blocks with calls to this function:
print_quick_connect_details("[PROV] Quick connect (early):");
and
print_quick_connect_details("[PROV] Quick connect:");
This would make the code cleaner and easier to manage if the quick-connect details need to be changed in the future.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66c5c9fc19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: ERRERLabs <5740957+kmay89@users.noreply.github.com>
Motivation
Description
token) is printed on every boot.AP SSID,AP PASS,URLandAPI TOKENimmediately after WiFi AP startup whenFEATURE_WIFI_APis enabled.tls_cert_fp) and conditionalFEATURE_WIFI_APhandling.Testing
arduino/canary_wapfirmware (platformbuild for the target) and the build succeeded.Codex Task