Skip to content
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

Update/upgrade OTAWebUpdater.ino example #8839

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

lbernstone
Copy link
Contributor

@lbernstone lbernstone commented Nov 6, 2023

Streamlined a lot of the code
HTML now sends file size
HTML has better progress graphics
HTML redirects back to root after completion
WebServer uses POST and GET to differentiate b/w status
Includes a lot more examples: generate passwords, functionalized setup, ticker, functionalized WebServer response, sending a const file
literal & C-style strings included in a separate header file
Moved to Update library- this does not use ArduinoOTA

@VojtechBartoska VojtechBartoska added Type: Example Issue is related to specific example. Status: Review needed Issue or PR is awaiting review labels Nov 6, 2023
#include <Ticker.h>
#include "html.h"

#define SSID_FORMAT "ESP32-%06X" // 12 chars total
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#define SSID_FORMAT "ESP32-%06lX"

});
server.onNotFound([]() {server.send(200, "text/html", indexHtml);});
server.begin();
Serial.printf("Web Server ready at http://esp32.local or http://%s\n", WiFi.softAPIP().toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WiFi.softAPIP().toString().c_str()

#ifdef PASSWORD
snprintf(passwd, 11, PASSWORD);
#else
snprintf(passwd, 11, "%s", generatePass(10).c_str());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure why the compiler is complaining about truncation, but I suggest you make passwd be 16 bytes long instead.

Copy link
Contributor Author

@lbernstone lbernstone Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size is actually fairly specific, as it allows you to do a wifi: QR code in a 64 bit square. I'll figure it out.

@me-no-dev me-no-dev merged commit 6b287db into espressif:master Nov 9, 2023
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review needed Issue or PR is awaiting review Type: Example Issue is related to specific example.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants