Skip to content

Improved status messages and prompts in WiFi updater sketch #73

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

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ void setup() {
if (err) {
// Reformat if we can't mount the filesystem
// this should only happen on the first boot
Serial.println("No filesystem found, formatting...");
Serial.println("No filesystem containing the WiFi firmware was found.");
Serial.println("Usually that means that the WiFi firmware has not been installed yet"
" or was overwritten with another firmware.\n");
Serial.println("Formatting the filsystem to install the firmware and certificates...\n");
err = wifi_data_fs.reformat(&wifi_data);
}

Expand All @@ -43,10 +46,11 @@ void setup() {
if ((dir = opendir("/wlan")) != NULL) {
/* print all the files and directories within directory */
while ((ent = readdir (dir)) != NULL) {
Serial.println(ent->d_name);
Serial.println("Searching for WiFi firmware file " + String(ent->d_name) + " ...");
String fullname = "/wlan/" + String(ent->d_name);
if (fullname == "/wlan/4343WA1.BIN") {
Serial.println("Firmware found! Force update? [Y/n]");
Serial.println("A WiFi firmware is already installed. "
"Do you want to install the firmware anyway? Y/[n]");
while (1) {
if (Serial.available()) {
int c = Serial.read();
Expand Down Expand Up @@ -86,7 +90,7 @@ void setup() {
}
fclose(fp);

Serial.println("Firmware and certificates updated!");
Serial.println("\nFirmware and certificates updated!");
}

void loop() {
Expand Down