Compare commits
5 Commits
v1.3.96
...
46cd953b80
Author | SHA1 | Date | |
---|---|---|---|
46cd953b80 | |||
c645035bbe | |||
9e76620cd3 | |||
faddda6201 | |||
de9c1706c0 |
@@ -10,6 +10,8 @@ Weitere Bilder finden Sie im [img Ordner](/img/)
|
|||||||
oder auf meiner Website: [FilaMan Website](https://www.filaman.app)
|
oder auf meiner Website: [FilaMan Website](https://www.filaman.app)
|
||||||
Deutsches Erklärvideo: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaOHU)
|
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
|
### ESP32 Hardware-Funktionen
|
||||||
- **Gewichtsmessung:** Verwendung einer Wägezelle mit HX711-Verstärker für präzise Gewichtsverfolgung.
|
- **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.
|
- **NFC-Tag Lesen/Schreiben:** PN532-Modul zum Lesen und Schreiben von Filamentdaten auf NFC-Tags.
|
||||||
|
@@ -13,6 +13,8 @@ More Images can be found in the [img Folder](/img/)
|
|||||||
or my website:[FilaMan Website](https://www.filaman.app)
|
or my website:[FilaMan Website](https://www.filaman.app)
|
||||||
german explanatory video: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaOHU)
|
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
|
### ESP32 Hardware Features
|
||||||
- **Weight Measurement:** Using a load cell with HX711 amplifier for precise weight tracking.
|
- **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.
|
- **NFC Tag Reading/Writing:** PN532 module for reading and writing filament data to NFC tags.
|
||||||
|
@@ -1015,7 +1015,7 @@ input[type="submit"]:disabled,
|
|||||||
color: #000;
|
color: #000;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
text-shadow: 0 !important;
|
text-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-container {
|
.progress-container {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 283 KiB After Width: | Height: | Size: 283 KiB |
11
src/main.cpp
11
src/main.cpp
@@ -30,6 +30,7 @@ void setup() {
|
|||||||
|
|
||||||
// Start Display
|
// Start Display
|
||||||
setupDisplay();
|
setupDisplay();
|
||||||
|
oledShowMessage("FilaMan v"+String(VERSION));
|
||||||
|
|
||||||
// WiFiManager
|
// WiFiManager
|
||||||
initWiFi();
|
initWiFi();
|
||||||
@@ -99,12 +100,20 @@ const unsigned long amsSendInterval = 60000; // 1 minute
|
|||||||
|
|
||||||
uint8_t weightSend = 0;
|
uint8_t weightSend = 0;
|
||||||
int16_t lastWeight = 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 #####
|
// ##### PROGRAM START #####
|
||||||
void loop() {
|
void loop() {
|
||||||
unsigned long currentMillis = millis();
|
unsigned long currentMillis = millis();
|
||||||
|
|
||||||
|
// Überprüfe regelmäßig die WLAN-Verbindung
|
||||||
|
if (millis() - lastWifiCheckTime > wifiCheckInterval) {
|
||||||
|
checkWiFiConnection();
|
||||||
|
lastWifiCheckTime = millis();
|
||||||
|
}
|
||||||
|
|
||||||
// Send AMS Data min every Minute
|
// Send AMS Data min every Minute
|
||||||
if (currentMillis - lastAmsSendTime >= amsSendInterval)
|
if (currentMillis - lastAmsSendTime >= amsSendInterval)
|
||||||
{
|
{
|
||||||
|
96
src/wlan.cpp
96
src/wlan.cpp
@@ -8,48 +8,78 @@
|
|||||||
|
|
||||||
WiFiManager wm;
|
WiFiManager wm;
|
||||||
bool wm_nonblocking = false;
|
bool wm_nonblocking = false;
|
||||||
|
uint8_t wifiErrorCounter = 0;
|
||||||
|
|
||||||
void initWiFi() {
|
void initWiFi() {
|
||||||
// Optimierte WiFi-Einstellungen
|
// Optimierte WiFi-Einstellungen
|
||||||
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
||||||
WiFi.setSleep(false); // disable sleep mode
|
WiFi.setSleep(false); // disable sleep mode
|
||||||
esp_wifi_set_ps(WIFI_PS_NONE);
|
esp_wifi_set_ps(WIFI_PS_NONE);
|
||||||
|
|
||||||
// Maximale Sendeleistung
|
// Maximale Sendeleistung
|
||||||
WiFi.setTxPower(WIFI_POWER_19_5dBm); // Set maximum transmit power
|
WiFi.setTxPower(WIFI_POWER_19_5dBm); // Set maximum transmit power
|
||||||
|
|
||||||
// Optimiere TCP/IP Stack
|
// Optimiere TCP/IP Stack
|
||||||
esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N);
|
esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N);
|
||||||
|
|
||||||
// Aktiviere WiFi-Roaming für bessere Stabilität
|
// Aktiviere WiFi-Roaming für bessere Stabilität
|
||||||
esp_wifi_set_rssi_threshold(-80);
|
esp_wifi_set_rssi_threshold(-80);
|
||||||
|
|
||||||
if(wm_nonblocking) wm.setConfigPortalBlocking(false);
|
if(wm_nonblocking) wm.setConfigPortalBlocking(false);
|
||||||
wm.setConfigPortalTimeout(320); // Portal nach 5min schließen
|
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();
|
oledShowTopRow();
|
||||||
oledShowMessage("WiFi Setup");
|
display.display();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool res;
|
void checkWiFiConnection() {
|
||||||
// res = wm.autoConnect(); // auto generated AP name from chipid
|
if (WiFi.status() != WL_CONNECTED)
|
||||||
res = wm.autoConnect("FilaMan"); // anonymous ap
|
{
|
||||||
// res = wm.autoConnect("spoolman","password"); // password protected ap
|
Serial.println("WiFi connection lost. Reconnecting...");
|
||||||
|
oledShowTopRow();
|
||||||
if(!res) {
|
oledShowMessage("WiFi reconnecting...");
|
||||||
Serial.println("Failed to connect or hit timeout");
|
WiFi.reconnect(); // Versuche, die Verbindung wiederherzustellen
|
||||||
// ESP.restart();
|
delay(5000); // Warte 5 Sekunden, bevor erneut geprüft wird
|
||||||
oledShowTopRow();
|
if (WiFi.status() != WL_CONNECTED)
|
||||||
oledShowMessage("WiFi not connected Check Portal");
|
{
|
||||||
|
Serial.println("Failed to reconnect. Restarting WiFi...");
|
||||||
|
WiFi.disconnect();
|
||||||
|
delay(1000);
|
||||||
|
wifiErrorCounter++;
|
||||||
|
//initWiFi();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
wifiOn = true;
|
{
|
||||||
|
wifiErrorCounter = 0;
|
||||||
//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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wifiErrorCounter >= 5)
|
||||||
|
{
|
||||||
|
Serial.println("Too many WiFi errors. Restarting...");
|
||||||
|
ESP.restart();
|
||||||
|
}
|
||||||
|
}
|
@@ -4,5 +4,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
void initWiFi();
|
void initWiFi();
|
||||||
|
void checkWiFiConnection();
|
||||||
|
|
||||||
#endif
|
#endif
|
Reference in New Issue
Block a user