feat: update version to v1.2.0 and add upgrade link in HTML files
This commit is contained in:
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
|
Reference in New Issue
Block a user