-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Compile time lock PIN definition #4307
base: 0_15
Are you sure you want to change the base?
Conversation
How do I set this? I tried |
Either: |
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.
A few things I noticed:
- This only works if you have a fresh installation (erased flash).
- On the first boot it does not ask for the pin. Only after the 2nd boot does it ask for the pin.
WLED_GLOBAL bool wifiLock _INIT(false); // prevents access to WiFi settings when OTA lock is enabled | ||
WLED_GLOBAL bool aOtaEnabled _INIT(true); // ArduinoOTA allows easy updates directly from the IDE. Careful, it does not auto-disable when OTA lock is on | ||
WLED_GLOBAL char settingsPIN[5] _INIT(""); // PIN for settings pages | ||
WLED_GLOBAL bool otaLock _INIT(false); // prevents OTA firmware updates without password. ALWAYS enable if system exposed to any public networks |
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.
Revert unrelated whitespace changes please
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.
I want to keep comments aligned. Personal preference.
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.
That's fine for when making changes, not for unrelated code
It's bad practice to apply formatting changes to code not related to the PR, it creates harder to review PRs and breaks the history of each line making debugging issues harder as git blame will make it appear the code has changed more recently that it has and with incorrect description
Yes, that is expected. The code does not modify existing configuration.
Then a check where a bug is is in order. Though that may be good as it will allow to set WiFi credentials (unfortunately that will be available only once). |
There's one more thing that needs to be done: allow WiFi settings to be available until WiFi is configured. |
I would prefer that the WiFi settings be locked when I set a pin (as they are now). I think this would be the expected behavior when I set a pin. |
I specifically mentioned "configured" WiFi. Even if you run it unconnected in AP mode. |
Adds ability to define default settings PIN at compile time (instead of no PIN defined).
Requested by a friend.