Compare commits
	
		
			6 Commits
		
	
	
		
			v1.4.9
			...
			fad84e12c8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| fad84e12c8 | |||
| 696efc4d79 | |||
| 29868e7101 | |||
| 823db6157c | |||
| 83d14b32d1 | |||
| 2bf7c9fb7d | 
							
								
								
									
										13
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @@ -1,5 +1,18 @@ | ||||
| # Changelog | ||||
|  | ||||
| ## [1.4.10] - 2025-03-30 | ||||
| ### Added | ||||
| - add manual tare functionality for scale | ||||
| - add debounce handling for TTP223 touch sensor | ||||
| - add TTP223 touch sensor support and wiring configuration | ||||
|  | ||||
| ### Changed | ||||
| - update platformio.ini for version v1.4.10 | ||||
|  | ||||
| ### Fixed | ||||
| - update TTP223 pin configuration and adjust touch sensor logic | ||||
|  | ||||
|  | ||||
| ## [1.4.9] - 2025-03-29 | ||||
| ### Changed | ||||
| - update platformio.ini for version v1.4.9 | ||||
|   | ||||
							
								
								
									
										31
									
								
								README.de.md
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								README.de.md
									
									
									
									
									
								
							| @@ -55,19 +55,22 @@ Discord Server: [https://discord.gg/my7Gvaxj2v](https://discord.gg/my7Gvaxj2v) | ||||
| ## Hardware-Anforderungen | ||||
|  | ||||
| ### Komponenten | ||||
| - **ESP32 Entwicklungsboard:** Jede ESP32-Variante. | ||||
| [Amazon Link](https://amzn.eu/d/aXThslf) | ||||
| - **HX711 5kg Wägezellen-Verstärker:** Für Gewichtsmessung. | ||||
| [Amazon Link](https://amzn.eu/d/06A0DLb) | ||||
| - **OLED 0.96 Zoll I2C weiß/gelb Display:** 128x64 SSD1306. | ||||
| [Amazon Link](https://amzn.eu/d/0AuBp2c) | ||||
| - **PN532 NFC NXP RFID-Modul V3:** Für NFC-Tag-Operationen. | ||||
| [Amazon Link](https://amzn.eu/d/jfIuQXb) | ||||
| - **NFC Tags NTAG213 NTA215:** RFID Tag | ||||
| [Amazon Link](https://amzn.eu/d/9Z6mXc1) | ||||
| - **ESP32 Development Board:** Any ESP32 variant. | ||||
| [Amazon Link](https://amzn.to/3FHea6D) | ||||
| - **HX711 5kg Load Cell Amplifier:** For weight measurement. | ||||
| [Amazon Link](https://amzn.to/4ja1KTe) | ||||
| - **OLED 0.96 Zoll I2C white/yellow Display:** 128x64 SSD1306. | ||||
| [Amazon Link](https://amzn.to/445aaa9) | ||||
| - **PN532 NFC NXP RFID-Modul V3:** For NFC tag operations. | ||||
| [Amazon Link](https://amzn.to/4iO6CO4) | ||||
| - **NFC Tags NTAG213 NTAG215:** RFID Tag | ||||
| [Amazon Link](https://amzn.to/3E071xO) | ||||
| - **TTP223 Touch Sensor (optional):** For reTARE per Button/Touch | ||||
| [Amazon Link](https://amzn.to/4hTChMK) | ||||
|  | ||||
| ### Pin-Konfiguration | ||||
| | Komponente        | ESP32 Pin | | ||||
|  | ||||
| ### Pin Konfiguration | ||||
| | Component          | ESP32 Pin | | ||||
| |-------------------|-----------| | ||||
| | HX711 DOUT        | 16        | | ||||
| | HX711 SCK         | 17        | | ||||
| @@ -77,8 +80,10 @@ Discord Server: [https://discord.gg/my7Gvaxj2v](https://discord.gg/my7Gvaxj2v) | ||||
| | PN532 RESET       | 33        | | ||||
| | PN532 SDA         | 21        | | ||||
| | PN532 SCL         | 22        | | ||||
| | TTP223 I/O        | 25        | | ||||
|  | ||||
| **Achte darauf, dass am PN532 die DIP-Schalter auf I2C gestellt sind** | ||||
| **!! Achte darauf, dass am PN532 die DIP-Schalter auf I2C gestellt sind** | ||||
| **Nutze den 3V Pin vom ESP für den Touch Sensor** | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
							
								
								
									
										16
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								README.md
									
									
									
									
									
								
							| @@ -60,15 +60,17 @@ Discord Server: [https://discord.gg/my7Gvaxj2v](https://discord.gg/my7Gvaxj2v) | ||||
|  | ||||
| ### Components | ||||
| - **ESP32 Development Board:** Any ESP32 variant. | ||||
| [Amazon Link](https://amzn.eu/d/aXThslf) | ||||
| [Amazon Link](https://amzn.to/3FHea6D) | ||||
| - **HX711 5kg Load Cell Amplifier:** For weight measurement. | ||||
| [Amazon Link](https://amzn.eu/d/06A0DLb) | ||||
| [Amazon Link](https://amzn.to/4ja1KTe) | ||||
| - **OLED 0.96 Zoll I2C white/yellow Display:** 128x64 SSD1306. | ||||
| [Amazon Link](https://amzn.eu/d/0AuBp2c) | ||||
| [Amazon Link](https://amzn.to/445aaa9) | ||||
| - **PN532 NFC NXP RFID-Modul V3:** For NFC tag operations. | ||||
| [Amazon Link](https://amzn.eu/d/jfIuQXb) | ||||
| [Amazon Link](https://amzn.to/4iO6CO4) | ||||
| - **NFC Tags NTAG213 NTAG215:** RFID Tag | ||||
| [Amazon Link](https://amzn.eu/d/9Z6mXc1) | ||||
| [Amazon Link](https://amzn.to/3E071xO) | ||||
| - **TTP223 Touch Sensor (optional):** For reTARE per Button/Touch | ||||
| [Amazon Link](https://amzn.to/4hTChMK) | ||||
|  | ||||
|  | ||||
| ### Pin Configuration | ||||
| @@ -82,8 +84,10 @@ Discord Server: [https://discord.gg/my7Gvaxj2v](https://discord.gg/my7Gvaxj2v) | ||||
| | PN532 RESET       | 33        | | ||||
| | PN532 SDA         | 21        | | ||||
| | PN532 SCL         | 22        | | ||||
| | TTP223 I/O        | 25        | | ||||
|  | ||||
| **Make sure that the DIP switches on the PN532 are set to I2C** | ||||
| **!! Make sure that the DIP switches on the PN532 are set to I2C** | ||||
| **Use the 3V pin from the ESP for the touch sensor** | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
| ; https://docs.platformio.org/page/projectconf.html | ||||
|  | ||||
| [common] | ||||
| version = "1.4.9" | ||||
| version = "1.4.10" | ||||
| to_old_version = "1.4.0" | ||||
|  | ||||
| ## | ||||
|   | ||||
| @@ -19,6 +19,12 @@ const uint16_t SCALE_LEVEL_WEIGHT = 500; | ||||
| uint16_t defaultScaleCalibrationValue = 430; | ||||
| // ***** HX711 | ||||
|  | ||||
| // ***** TTP223 (Touch Sensor) | ||||
| // TTP223 circuit wiring | ||||
| const uint8_t TTP223_PIN = 25; | ||||
| // ***** TTP223 | ||||
|  | ||||
|  | ||||
| // ***** Display | ||||
| // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) | ||||
| // On an ESP32:   21(SDA),  22(SCL) | ||||
|   | ||||
| @@ -11,6 +11,8 @@ extern const uint8_t LOADCELL_SCK_PIN; | ||||
| extern const uint8_t calVal_eepromAdress; | ||||
| extern const uint16_t SCALE_LEVEL_WEIGHT; | ||||
|  | ||||
| extern const uint8_t TTP223_PIN; | ||||
|  | ||||
| extern const int8_t OLED_RESET; | ||||
| extern const uint8_t SCREEN_ADDRESS; | ||||
| extern const uint8_t SCREEN_WIDTH; | ||||
|   | ||||
							
								
								
									
										36
									
								
								src/main.cpp
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								src/main.cpp
									
									
									
									
									
								
							| @@ -39,7 +39,6 @@ void setup() { | ||||
|   setupWebserver(server); | ||||
|  | ||||
|   // Spoolman API | ||||
|   // api.cpp | ||||
|   initSpoolman(); | ||||
|  | ||||
|   // Bambu MQTT | ||||
| @@ -48,6 +47,7 @@ void setup() { | ||||
|   // NFC Reader | ||||
|   startNfc(); | ||||
|  | ||||
|   // Scale | ||||
|   start_scale(); | ||||
|  | ||||
|   // WDT initialisieren mit 10 Sekunden Timeout | ||||
| @@ -56,6 +56,9 @@ void setup() { | ||||
|  | ||||
|   // Aktuellen Task (loopTask) zum Watchdog hinzufügen | ||||
|   esp_task_wdt_add(NULL); | ||||
|  | ||||
|   // Touch Sensor | ||||
|   pinMode(TTP223_PIN, INPUT_PULLUP); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -84,13 +87,25 @@ uint8_t autoAmsCounter = 0; | ||||
| uint8_t weightSend = 0; | ||||
| int16_t lastWeight = 0; | ||||
|  | ||||
| // WIFI check variables | ||||
| unsigned long lastWifiCheckTime = 0; | ||||
| const unsigned long wifiCheckInterval = 60000; // Überprüfe alle 60 Sekunden (60000 ms) | ||||
|  | ||||
| // Button debounce variables | ||||
| unsigned long lastButtonPress = 0; | ||||
| const unsigned long debounceDelay = 500; // 500 ms debounce delay | ||||
|  | ||||
| // ##### PROGRAM START ##### | ||||
| void loop() { | ||||
|   unsigned long currentMillis = millis(); | ||||
|  | ||||
|   // Überprüfe den Status des Touch Sensors | ||||
|   if (digitalRead(TTP223_PIN) == HIGH && currentMillis - lastButtonPress > debounceDelay)  | ||||
|   { | ||||
|     lastButtonPress = currentMillis; | ||||
|     scaleTareRequest = true; | ||||
|   } | ||||
|  | ||||
|   // Überprüfe regelmäßig die WLAN-Verbindung | ||||
|   if (intervalElapsed(currentMillis, lastWifiCheckTime, wifiCheckInterval))  | ||||
|   { | ||||
| @@ -158,25 +173,6 @@ void loop() { | ||||
|   { | ||||
|     lastWeightReadTime = currentMillis; | ||||
|  | ||||
|     // Prüfen ob die Waage korrekt genullt ist | ||||
|     if ((weight > 0 && weight < 5) || weight < -1) | ||||
|     { | ||||
|       if(scaleTareCounter < 5) | ||||
|       { | ||||
|         scaleTareCounter++; | ||||
|       } | ||||
|       else | ||||
|       { | ||||
|         scaleTareRequest = true; | ||||
|         scaleTareCounter = 0; | ||||
|       } | ||||
|        | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|       scaleTareCounter = 0; | ||||
|     } | ||||
|  | ||||
|     // Prüfen ob das Gewicht gleich bleibt und dann senden | ||||
|     if (weight == lastWeight && weight > 5) | ||||
|     { | ||||
|   | ||||
| @@ -38,11 +38,15 @@ void scale_loop(void * parameter) { | ||||
|   for(;;) { | ||||
|     if (scale.is_ready())  | ||||
|     { | ||||
|       // Waage nochmal Taren, wenn zu lange Abweichung | ||||
|       // Waage manuell Taren | ||||
|       if (scaleTareRequest == true)  | ||||
|       { | ||||
|         Serial.println("Re-Tare scale"); | ||||
|         oledShowMessage("TARE Scale"); | ||||
|         vTaskDelay(pdMS_TO_TICKS(1000)); | ||||
|         scale.tare(); | ||||
|         vTaskDelay(pdMS_TO_TICKS(1000)); | ||||
|         oledShowWeight(0); | ||||
|         scaleTareRequest = false; | ||||
|       } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user