Skip to content

Commit

Permalink
Merge pull request #8 from StafLoker/release/2.2.1
Browse files Browse the repository at this point in the history
Release v2.2.1
  • Loading branch information
StafLoker authored Feb 26, 2025
2 parents 20cb629 + 1bdea2a commit db1f6b7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 38 deletions.
Binary file added bin/EspWOL.bin
Binary file not shown.
13 changes: 6 additions & 7 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -873,22 +873,21 @@ <h3>Updating</h3>
document.body.classList.add('blurred');

let progress = 0;
const duration = 30000;
const duration = 30000; // 30 seconds
const stepTime = 200; // ms
const increment = 100 / (duration / stepTime); // Increase per step

function updateProgress() {
if (progress < 100) {
progress += 100 / (duration / 100);
progress += increment;
updatingBar.style.width = `${progress}%`;
} else {
clearInterval(progressInterval);
location.reload();
}
}

const progressInterval = setInterval(updateProgress, 200);

setTimeout(() => {
location.reload();
}, duration);
const progressInterval = setInterval(updateProgress, stepTime);
}, 1000);
} catch (error) {
setTimeout(() => {
Expand Down
15 changes: 6 additions & 9 deletions dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -874,23 +874,20 @@ <h3>Updating</h3>

let progress = 0;
const duration = 30000; // 30 seconds
const stepTime = 200; // ms
const increment = 100 / (duration / stepTime); // Increase per step

// Function to increment the progress
function updateProgress() {
if (progress < 100) {
progress += 100 / (duration / 100); // Increase by 1% every 100ms
progress += increment;
updatingBar.style.width = `${progress}%`;
} else {
clearInterval(progressInterval); // Stop the interval when it reaches 100%
clearInterval(progressInterval);
location.reload();
}
}

// Start the interval to update the progress every 200ms
const progressInterval = setInterval(updateProgress, 200);

setTimeout(() => {
location.reload();
}, duration);
const progressInterval = setInterval(updateProgress, stepTime);
}
} catch (error) {
disabledLoaderButton(button, `Update`);
Expand Down
22 changes: 12 additions & 10 deletions firmware/EspWOL/EspWOL.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#if ENABLE_STANDARD_OTA == 1
#include <ArduinoOTA.h>
#define ArduinoOTA_PORT 8266
#endif

#include <AutoOTA.h>
Expand All @@ -39,7 +40,7 @@
#include "memory.h"
#include "api.h"

#define VERSION "2.2.0"
#define VERSION "2.2.1"

AutoOTA ota(VERSION, "StafLoker/EspWOL");

Expand Down Expand Up @@ -91,7 +92,8 @@ std::map<int, GTimer<millis>> timers;
void setupOTA() {
ArduinoOTA.setHostname(hostname);
ArduinoOTA.setPassword((const char*)"ber#912NerYi");
ArduinoOTA.begin();
ArduinoOTA.setPort(ArduinoOTA_PORT);
ArduinoOTA.begin(false);
}
#endif

Expand Down Expand Up @@ -152,6 +154,10 @@ void setup() {
// Set up mDNS responder
// the fully-qualified domain name is "wol.local"
MDNS.begin(hostname);
MDNS.addService("http", "tcp", 80);
#if ENABLE_STANDARD_OTA == 1
MDNS.enableArduino(ArduinoOTA_PORT, true);
#endif
#endif

server.on("/", HTTP_GET, handleRoot);
Expand All @@ -172,25 +178,21 @@ void setup() {
});
server.begin();

#if ENABLE_mDNS == 1
MDNS.addService("http", "tcp", 80);
#endif

setupPeriodicPingToHosts();
}

void loop() {

#if ENABLE_STANDARD_OTA == 1
ArduinoOTA.handle();
#endif

#if ENABLE_mDNS == 1
MDNS.update();
#endif

server.handleClient();

#if ENABLE_STANDARD_OTA == 1
ArduinoOTA.handle();
#endif

checkTimers();

delay(1); // Reduce power consumption by 60% with a delay https://hackaday.com/2022/10/28/esp8266-web-server-saves-60-power-with-a-1-ms-delay/
Expand Down
15 changes: 6 additions & 9 deletions firmware/EspWOL/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -876,23 +876,20 @@ const char htmlPage[] PROGMEM = R"rawliteral(
let progress = 0;
const duration = 30000; // 30 seconds
const stepTime = 200; // ms
const increment = 100 / (duration / stepTime); // Increase per step
// Function to increment the progress
function updateProgress() {
if (progress < 100) {
progress += 100 / (duration / 100); // Increase by 1% every 100ms
progress += increment;
updatingBar.style.width = `${progress}%`;
} else {
clearInterval(progressInterval); // Stop the interval when it reaches 100%
clearInterval(progressInterval);
location.reload();
}
}
// Start the interval to update the progress every 200ms
const progressInterval = setInterval(updateProgress, 200);
setTimeout(() => {
location.reload();
}, duration);
const progressInterval = setInterval(updateProgress, stepTime);
}
} catch (error) {
disabledLoaderButton(button, `Update`);
Expand Down
6 changes: 3 additions & 3 deletions project.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "EspWOL",
"about": "ESP8266 Wake On Lan web server with modern ui",
"version": "2.2.0",
"notes": "Added mDNS support. Now you can access the web page using a domain name. Enhance UI user experience.",
"version": "2.2.1",
"notes": "Fix detection of OTA. Enhance UI user experience.",
"builds": [
{
"chipFamily": "ESP8266",
"parts": [
{
"path": "https://github.com/StafLoker/EspWOL/releases/latest/download/EspWOL.bin",
"path": "https://raw.githubusercontent.com/StafLoker/EspWOL/main/bin/EspWOL.bin",
"offset": 0
}
]
Expand Down

0 comments on commit db1f6b7

Please sign in to comment.