-
Notifications
You must be signed in to change notification settings - Fork 149
Settings placeholder substitution #164
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
Header files contains duplicates of factory values defined in factory_settings.ini Removed them to simplify the code.
Header files contains duplicates of factory values defined in factory_settings.ini Removed them to simplify the code.
Updated documentation
Header files contains duplicates of factory values defined in factory_settings.ini Removed them to simplify the code.
Use text formatting for default factory values to produce dynamic names.
- this is so src can be built without an exaustive set build-time defines - standardize ordering of defines: factory settings, paths, config
experiment with removing $'s from our format strings (they are being substituted with empty values by pio)
rename FactoryValue to SettingValue, put in own header give example of direct usage of FactorySetting::format in README.md
We can replace dollar sign ($) with a hash (#) to avoid bash variable expansion. |
# Conflicts: # README.md # features.ini
# Conflicts: # factory_settings.ini
Updated to use #{value} seems to work |
# Conflicts: # factory_settings.ini # lib/framework/APSettingsService.h
Have been struggling with odd issues while testing this branch on one of my ESP8266 devices (a nodemcuv2 board). It was exhibiting an unresponsive access point when erasing flash before uploading (effectively a factory reset). Oddly the culprit appears to be the use of flash string helpers and the following change solves the issue (my older nodemcuv0.9 board works fine without this change): I'm not entirely sure why it solves the problem and would love to know if anyone is more enlightened. |
I'm facing a similar problem, |
Thanks, it would be good to know it's not just my device.
…On Wed, Jul 8, 2020 at 2:00 PM Proddy ***@***.***> wrote:
I'm facing a similar problem, esptool.py erase_flash -> upload firmware
brings up an empty Captive Portal page. I'll try the workaround.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#164 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKE4VDAPSB6HSERLCTAX6TR2RUXHANCNFSM4OKPOL2Q>
.
|
Haven't been able to reproduce it unfortunately. I'm back on master now. |
Do we plan to merge this feature into main? |
Think so, it's seemed like a sensible change. IIRC last time I looked at
this I had a strange issue with it on one off my esp8266 devices. I
couldn't see how it was related to the change, perhaps a dodgy flash chip
on that particular device. I'll have another look this eve.
…On Wed, 30 Dec 2020, 05:28 kasedy, ***@***.***> wrote:
Do we plan to merge this feature into main?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#164 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKE4VCE5ABRFQXKFAQDTILSXK3A7ANCNFSM4OKPOL2Q>
.
|
# Conflicts: # factory_settings.ini # lib/framework/WiFiSettingsService.h
I couldn't re-create the issue I saw last time around so this is probs OK to merge. Have caught it up with master and applied the fix from before for good measure. Have run out of time tonight.. will review the code and merge this tomorrow |
I also had this issue in the past. It is not related with the change. I believe the issue is in esp8266-Arduino SDK as it has lots of open tickets. For a long time I used ESPAsyncWiFiManager as it is the most issue free WiFi manager for ESP8266. It has many workarounds to make WiFi work properly. For example it resets wifi before connecting to it [1]. Also it disconnects wifi on reset [2]. I think we should do something similar. By the way I skimmed the other projects. JustWifi and Tasmota have a workaround for WiFi connectivity issue [3] and [4]. [1] https://github.com/alanswx/ESPAsyncWiFiManager/blob/master/ESPAsyncWiFiManager.cpp#L575 |
use chip id and unique id for more secure secret
Just need to replace "chipId" with "salt" to secure the JWT secret properly. It's a pretty significant security hole as it stands. I'm sure I can get PIO to generate a random value for a salt at build time... will look this eve. |
Arduino uses the ESP random number generator for "true random" numbers on both esp32 and esp8266 This makes a better JWT secret and may be useful for other factory defaults too In addition a modification has been made to force the FSPersistance to save the file if applying defaults
I think this might be ready now, another user of the framework spotted an issue with using efuse/chipId for the hostname which this PR also resolves: In addition I have resolved a security issue, where the default JWT secret was previously derived from the station MAC address which may be sniffed from the WiFi network (not great if you care about security!) Thankfully the Arduino random() function was adapted for these devices to use the built-in hardware true random number generator so it offers a good solution for the default JWT secret (with added bonus that it's random rather than derrived and is re-generated on factory reset). Nice. |
Hey @kasedy,
Thx for this, nice little change. The templates weren't working for me as PlatformIO was expanding them to empty strings before handing them off to the build process. I couldn't even get it working by escaping the dollars - strange. Removing the dollar from our placeholders trick though, look OK?
I opted to restore the settings ifndefs. IMO it's nice to have the source code build without any external defines needing to be provided (especially useful if you want to produce a project from the source code which won't be built with PIO).
Just finishing off testing this under various *nix configurations.