feat: update version to v1.2.0 and add upgrade link in HTML files
This commit is contained in:
parent
03cbf82275
commit
4e384d777e
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.1.0</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.0</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -21,6 +21,7 @@
|
||||
<a href="/waage">Scale</a>
|
||||
<a href="/spoolman">Spoolman/Bambu</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="/upgrade">Upgrade</a>
|
||||
</nav>
|
||||
<div class="status-container">
|
||||
<div class="status-item">
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- head --><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.0.2</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.0</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -21,6 +21,7 @@
|
||||
<a href="/waage">Scale</a>
|
||||
<a href="/spoolman">Spoolman/Bambu</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="/upgrade">Upgrade</a>
|
||||
</nav>
|
||||
<div class="status-container">
|
||||
<div class="status-item">
|
||||
@ -33,7 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- head -->
|
||||
|
||||
<div class="container">
|
||||
<h1>FilaMan</h1>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- head --><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.0.2</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.0</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -21,6 +21,7 @@
|
||||
<a href="/waage">Scale</a>
|
||||
<a href="/spoolman">Spoolman/Bambu</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="/upgrade">Upgrade</a>
|
||||
</nav>
|
||||
<div class="status-container">
|
||||
<div class="status-item">
|
||||
@ -33,6 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- head -->
|
||||
|
||||
<div class="connection-status hidden">
|
||||
<div class="spinner"></div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- head --><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.0.2</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.0</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -21,6 +21,7 @@
|
||||
<a href="/waage">Scale</a>
|
||||
<a href="/spoolman">Spoolman/Bambu</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="/upgrade">Upgrade</a>
|
||||
</nav>
|
||||
<div class="status-container">
|
||||
<div class="status-item">
|
||||
@ -33,6 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- head -->
|
||||
|
||||
<script>
|
||||
window.onload = function() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- head --><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.0.2</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.0</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -21,6 +21,7 @@
|
||||
<a href="/waage">Scale</a>
|
||||
<a href="/spoolman">Spoolman/Bambu</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="/upgrade">Upgrade</a>
|
||||
</nav>
|
||||
<div class="status-container">
|
||||
<div class="status-item">
|
||||
@ -33,6 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- head -->
|
||||
|
||||
<div class="content">
|
||||
<h1>Scale Configuration Page</h1>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- head --><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.0.2</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.0</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -21,6 +21,7 @@
|
||||
<a href="/waage">Scale</a>
|
||||
<a href="/spoolman">Spoolman/Bambu</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="/upgrade">Upgrade</a>
|
||||
</nav>
|
||||
<div class="status-container">
|
||||
<div class="status-item">
|
||||
@ -33,6 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- head -->
|
||||
|
||||
<div class="content">
|
||||
<h1>WiFi Configuration Page</h1>
|
||||
|
@ -1,7 +1,10 @@
|
||||
Import("env")
|
||||
import os
|
||||
import re
|
||||
|
||||
def combine_html_files(source, target, env):
|
||||
print("COMBINE HTML FILES")
|
||||
|
||||
html_dir = "./html"
|
||||
header_file = os.path.join(html_dir, "header.html")
|
||||
|
||||
@ -18,14 +21,14 @@ def combine_html_files(source, target, env):
|
||||
with open(file_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Replace placeholder with header content
|
||||
if '{{header}}' in content:
|
||||
new_content = content.replace('{{header}}', header_content)
|
||||
|
||||
# Write back combined content
|
||||
with open(file_path, 'w') as f:
|
||||
f.write(new_content)
|
||||
print(f"Combined header with {filename}")
|
||||
# Replace content between head comments with header content
|
||||
pattern = r'(<!-- head -->).*?(<!-- head -->)'
|
||||
new_content = re.sub(pattern, r'\1' + header_content + r'\2', content, flags=re.DOTALL)
|
||||
|
||||
# Write back combined content
|
||||
with open(file_path, 'w') as f:
|
||||
f.write(new_content)
|
||||
print(f"Combined header with {filename}")
|
||||
|
||||
# Register the script to run before building SPIFFS
|
||||
env.AddPreAction("buildfs", combine_html_files)
|
@ -22,4 +22,4 @@ def replace_version(source, target, env):
|
||||
with open(header_file, 'w') as file:
|
||||
file.write(content)
|
||||
|
||||
env.AddPreAction("buildfs", replace_version)
|
||||
env.AddPreAction("buildfs", replace_version)
|
||||
|
51
src/main.cpp
51
src/main.cpp
@ -1,11 +1,10 @@
|
||||
#include <Arduino.h>
|
||||
#include <WiFi.h>
|
||||
#include <esp_wifi.h>
|
||||
#include <DNSServer.h>
|
||||
#include <WiFiManager.h>
|
||||
#include <ESPmDNS.h>
|
||||
#include <Wire.h>
|
||||
#include <WiFi.h>
|
||||
|
||||
#include "wlan.h"
|
||||
#include "config.h"
|
||||
#include "website.h"
|
||||
#include "api.h"
|
||||
@ -16,12 +15,6 @@
|
||||
#include "esp_task_wdt.h"
|
||||
#include "commonFS.h"
|
||||
|
||||
// ***** WIFI initialisieren
|
||||
WiFiManager wm;
|
||||
bool wm_nonblocking = false;
|
||||
void initWiFi();
|
||||
// ################### Functions
|
||||
|
||||
// ##### SETUP #####
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
@ -97,9 +90,6 @@ void loop() {
|
||||
|
||||
unsigned long currentMillis = millis();
|
||||
|
||||
// Falls WifiManager im nicht blockenden Modus ist
|
||||
//if(wm_nonblocking) wm.process();
|
||||
|
||||
// Send AMS Data min every Minute
|
||||
if (currentMillis - lastAmsSendTime >= amsSendInterval) {
|
||||
lastAmsSendTime = currentMillis;
|
||||
@ -165,40 +155,3 @@ void loop() {
|
||||
yield();
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
|
||||
// ##### Funktionen für Konfiguration #####
|
||||
void initWiFi() {
|
||||
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
||||
|
||||
esp_wifi_set_max_tx_power(72); // Setze maximale Sendeleistung auf 20dBm
|
||||
|
||||
if(wm_nonblocking) wm.setConfigPortalBlocking(false);
|
||||
wm.setConfigPortalTimeout(320); // Portal nach 5min schließen
|
||||
|
||||
oledShowTopRow();
|
||||
oledShowMessage("WiFi Setup");
|
||||
|
||||
bool res;
|
||||
// res = wm.autoConnect(); // auto generated AP name from chipid
|
||||
res = wm.autoConnect("FilaMan"); // anonymous ap
|
||||
// res = wm.autoConnect("spoolman","password"); // password protected ap
|
||||
|
||||
if(!res) {
|
||||
Serial.println("Failed to connect or hit timeout");
|
||||
// ESP.restart();
|
||||
oledShowTopRow();
|
||||
oledShowMessage("WiFi not connected Check Portal");
|
||||
}
|
||||
else {
|
||||
wifiOn = true;
|
||||
|
||||
//if you get here you have connected to the WiFi
|
||||
Serial.println("connected...yeey :)");
|
||||
Serial.print("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
oledShowTopRow();
|
||||
display.display();
|
||||
}
|
||||
}
|
||||
// ##### Funktionen für Konfiguration Ende #####
|
||||
|
45
src/wlan.cpp
Normal file
45
src/wlan.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
#include <Arduino.h>
|
||||
#include "wlan.h"
|
||||
#include <WiFi.h>
|
||||
#include <esp_wifi.h>
|
||||
#include <WiFiManager.h>
|
||||
#include "display.h"
|
||||
#include "config.h"
|
||||
|
||||
WiFiManager wm;
|
||||
bool wm_nonblocking = false;
|
||||
|
||||
void initWiFi() {
|
||||
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
||||
|
||||
esp_wifi_set_max_tx_power(72); // Setze maximale Sendeleistung auf 20dBm
|
||||
|
||||
if(wm_nonblocking) wm.setConfigPortalBlocking(false);
|
||||
wm.setConfigPortalTimeout(320); // Portal nach 5min schließen
|
||||
|
||||
oledShowTopRow();
|
||||
oledShowMessage("WiFi Setup");
|
||||
|
||||
bool res;
|
||||
// res = wm.autoConnect(); // auto generated AP name from chipid
|
||||
res = wm.autoConnect("FilaMan"); // anonymous ap
|
||||
// res = wm.autoConnect("spoolman","password"); // password protected ap
|
||||
|
||||
if(!res) {
|
||||
Serial.println("Failed to connect or hit timeout");
|
||||
// ESP.restart();
|
||||
oledShowTopRow();
|
||||
oledShowMessage("WiFi not connected Check Portal");
|
||||
}
|
||||
else {
|
||||
wifiOn = true;
|
||||
|
||||
//if you get here you have connected to the WiFi
|
||||
Serial.println("connected...yeey :)");
|
||||
Serial.print("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
oledShowTopRow();
|
||||
display.display();
|
||||
}
|
||||
}
|
8
src/wlan.h
Normal file
8
src/wlan.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef WLAN_H
|
||||
#define WLAN_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
void initWiFi();
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user