Compare commits

...

5 Commits

7 changed files with 84 additions and 40 deletions

View File

@@ -10,6 +10,8 @@ Weitere Bilder finden Sie im [img Ordner](/img/)
oder auf meiner Website: [FilaMan Website](https://www.filaman.app)
Deutsches Erklärvideo: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaOHU)
### Es gibt jetzt auch ein Wiki, dort sind nochmal alle Funktionen beschrieben: [Wiki](https://github.com/ManuelW77/Filaman/wiki)
### ESP32 Hardware-Funktionen
- **Gewichtsmessung:** Verwendung einer Wägezelle mit HX711-Verstärker für präzise Gewichtsverfolgung.
- **NFC-Tag Lesen/Schreiben:** PN532-Modul zum Lesen und Schreiben von Filamentdaten auf NFC-Tags.

View File

@@ -13,6 +13,8 @@ More Images can be found in the [img Folder](/img/)
or my website:[FilaMan Website](https://www.filaman.app)
german explanatory video: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaOHU)
### Now more detailed informations about the usage: [Wiki](https://github.com/ManuelW77/Filaman/wiki)
### ESP32 Hardware Features
- **Weight Measurement:** Using a load cell with HX711 amplifier for precise weight tracking.
- **NFC Tag Reading/Writing:** PN532 module for reading and writing filament data to NFC tags.

View File

@@ -1015,7 +1015,7 @@ input[type="submit"]:disabled,
color: #000;
vertical-align: middle;
margin-left: 0.5rem;
text-shadow: 0 !important;
text-shadow: none !important;
}
.progress-container {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

After

Width:  |  Height:  |  Size: 283 KiB

View File

@@ -30,6 +30,7 @@ void setup() {
// Start Display
setupDisplay();
oledShowMessage("FilaMan v"+String(VERSION));
// WiFiManager
initWiFi();
@@ -99,12 +100,20 @@ const unsigned long amsSendInterval = 60000; // 1 minute
uint8_t weightSend = 0;
int16_t lastWeight = 0;
uint8_t wifiErrorCounter = 0;
unsigned long lastWifiCheckTime = 0;
const unsigned long wifiCheckInterval = 60000; // Überprüfe alle 60 Sekunden (60000 ms)
// ##### PROGRAM START #####
void loop() {
unsigned long currentMillis = millis();
// Überprüfe regelmäßig die WLAN-Verbindung
if (millis() - lastWifiCheckTime > wifiCheckInterval) {
checkWiFiConnection();
lastWifiCheckTime = millis();
}
// Send AMS Data min every Minute
if (currentMillis - lastAmsSendTime >= amsSendInterval)
{

View File

@@ -8,6 +8,7 @@
WiFiManager wm;
bool wm_nonblocking = false;
uint8_t wifiErrorCounter = 0;
void initWiFi() {
// Optimierte WiFi-Einstellungen
@@ -52,4 +53,33 @@ void initWiFi() {
oledShowTopRow();
display.display();
}
}
void checkWiFiConnection() {
if (WiFi.status() != WL_CONNECTED)
{
Serial.println("WiFi connection lost. Reconnecting...");
oledShowTopRow();
oledShowMessage("WiFi reconnecting...");
WiFi.reconnect(); // Versuche, die Verbindung wiederherzustellen
delay(5000); // Warte 5 Sekunden, bevor erneut geprüft wird
if (WiFi.status() != WL_CONNECTED)
{
Serial.println("Failed to reconnect. Restarting WiFi...");
WiFi.disconnect();
delay(1000);
wifiErrorCounter++;
//initWiFi();
}
else
{
wifiErrorCounter = 0;
}
}
if (wifiErrorCounter >= 5)
{
Serial.println("Too many WiFi errors. Restarting...");
ESP.restart();
}
}

View File

@@ -4,5 +4,6 @@
#include <Arduino.h>
void initWiFi();
void checkWiFiConnection();
#endif