Compare commits

...

38 Commits
v2.0.2 ... main

Author SHA1 Message Date
e0d641c817 docs: update changelog and header for version v2.0.6
All checks were successful
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m6s
2025-09-03 15:38:07 +02:00
40fdb667fa docs: update platformio.ini for version v2.0.6 2025-09-03 15:38:07 +02:00
8f6ecb350f fix: correct progress bar message and update tare function description 2025-09-03 15:37:57 +02:00
16887f5248 docs: update changelog and header for version v2.0.5
Some checks failed
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 3m14s
2025-09-03 15:28:10 +02:00
a7b06c9b97 docs: update platformio.ini for version v2.0.5 2025-09-03 15:28:09 +02:00
666c929483 fix: update progress bar message from "Tare scale" to "Searching scale"
fix: Scale tare function after boot
2025-09-03 15:28:03 +02:00
301109c37b docs: update changelog and header for version v2.0.4-beta2
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m18s
2025-09-03 15:18:51 +02:00
d43fceebbc docs: update platformio.ini for beta version v2.0.4-beta2 2025-09-03 15:18:50 +02:00
2c435e5c98 refactor: adjust auto tare counter threshold and reposition tare check in scale loop 2025-09-03 15:18:43 +02:00
f9aa7f2e6b docs: update changelog and header for version v2.0.4-beta1
All checks were successful
Release Workflow / detect-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m58s
2025-09-03 15:06:50 +02:00
f810bc5352 docs: update platformio.ini for beta version v2.0.4-beta1 2025-09-03 15:06:50 +02:00
043c2d4fa8 refactor: improve auto tare logic and reset conditions in scale handling 2025-09-03 15:06:31 +02:00
f5a1debd7d docs: update changelog and header for version v2.0.4
All checks were successful
Release Workflow / detect-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m10s
2025-09-02 18:49:42 +02:00
37309da185 docs: update platformio.ini for version v2.0.4 2025-09-02 18:49:42 +02:00
bcb7c039e2 refactor: filter out automatic release documentation commits in changelog categorization 2025-09-02 18:49:25 +02:00
98ec5b9846 refactor: disable auto tare and weight filter reset in scale loop 2025-09-02 18:47:02 +02:00
f0d1692ae1 docs: update changelog and header for version v2.0.3
All checks were successful
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m4s
2025-09-02 18:37:07 +02:00
10587276c2 docs: update platformio.ini for version v2.0.3 2025-09-02 18:37:07 +02:00
e74f6076b2 docs: update changelog and header for version v2.0.2-beta6
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m8s
2025-09-02 18:24:37 +02:00
2ee60ce430 docs: update platformio.ini for beta version v2.0.2-beta6 2025-09-02 18:24:37 +02:00
5db80d3670 fix: set scale tare request to true in setup function 2025-09-02 18:24:32 +02:00
2b195ed9ea fix: correct assignment operator in scale tare request handling 2025-09-02 18:23:36 +02:00
45a623cff6 docs: update changelog and header for version v2.0.2-beta5
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m40s
2025-09-02 18:15:19 +02:00
b4a06d0f2a docs: update platformio.ini for beta version v2.0.2-beta5 2025-09-02 18:15:19 +02:00
85cff3923c fix: correct tare scale request handling in tareScale function 2025-09-02 18:15:13 +02:00
d9469eaa42 docs: update changelog and header for version v2.0.2-beta4
All checks were successful
Release Workflow / detect-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m1s
2025-09-02 18:02:29 +02:00
16c3a65cca docs: update platformio.ini for beta version v2.0.2-beta4 2025-09-02 18:02:29 +02:00
51335456e3 fix: reset weight filter after tare scale operation 2025-09-02 18:02:24 +02:00
77fbacc681 docs: update changelog and header for version v2.0.2-beta3
All checks were successful
Release Workflow / detect-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m58s
2025-09-02 17:45:33 +02:00
b4f1fc3b0a docs: update platformio.ini for beta version v2.0.2-beta3 2025-09-02 17:45:33 +02:00
3a82175bb6 fix: correct tare scale function to set scaleTareRequest flag 2025-09-02 17:45:21 +02:00
b80184bf23 docs: update changelog and header for version v2.0.2-beta2
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m56s
2025-09-02 17:36:39 +02:00
0f63880d1f docs: update platformio.ini for beta version v2.0.2-beta2 2025-09-02 17:36:38 +02:00
0baa1d286e feat: add updateOctoSpoolId for OctoPrint integration and change autoSetToBambuSpoolId type to uint16_t 2025-09-02 17:36:34 +02:00
100328b1d6 docs: update changelog and header for version v2.0.2-beta1
All checks were successful
Release Workflow / detect-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m52s
2025-09-02 17:15:34 +02:00
9ec5bca652 docs: update platformio.ini for beta version v2.0.2-beta1 2025-09-02 17:15:34 +02:00
1dba2b2f23 fix: reset weight counter logic and update spool ID in loop function 2025-09-02 17:15:27 +02:00
cca0bd9dbe fix: reduce delay in start_scale function and reset weight after tare 2025-09-01 14:03:08 +02:00
10 changed files with 214 additions and 37 deletions

View File

@@ -1,5 +1,176 @@
# Changelog # Changelog
## [2.0.6] - 2025-09-03
### Fixed
- correct progress bar message and update tare function description
## [2.0.5] - 2025-09-03
### Changed
- adjust auto tare counter threshold and reposition tare check in scale loop
- improve auto tare logic and reset conditions in scale handling
### Fixed
- update progress bar message from 'Tare scale' to 'Searching scale'
- Scale tare function after boot
## [2.0.4-beta2] - 2025-09-03
### Changed
- adjust auto tare counter threshold and reposition tare check in scale loop
- improve auto tare logic and reset conditions in scale handling
## [2.0.4-beta1] - 2025-09-03
### Changed
- improve auto tare logic and reset conditions in scale handling
## [2.0.4] - 2025-09-02
### Changed
- filter out automatic release documentation commits in changelog categorization
- disable auto tare and weight filter reset in scale loop
## [2.0.3] - 2025-09-02
### Added
- add updateOctoSpoolId for OctoPrint integration and change autoSetToBambuSpoolId type to uint16_t
### Changed
- update platformio.ini for version v2.0.3
- update changelog and header for version v2.0.2-beta6
- update platformio.ini for beta version v2.0.2-beta6
- update changelog and header for version v2.0.2-beta5
- update platformio.ini for beta version v2.0.2-beta5
- update changelog and header for version v2.0.2-beta4
- update platformio.ini for beta version v2.0.2-beta4
- update changelog and header for version v2.0.2-beta3
- update platformio.ini for beta version v2.0.2-beta3
- update changelog and header for version v2.0.2-beta2
- update platformio.ini for beta version v2.0.2-beta2
- update changelog and header for version v2.0.2-beta1
- update platformio.ini for beta version v2.0.2-beta1
### Fixed
- set scale tare request to true in setup function
- correct assignment operator in scale tare request handling
- correct tare scale request handling in tareScale function
- reset weight filter after tare scale operation
- correct tare scale function to set scaleTareRequest flag
- reset weight counter logic and update spool ID in loop function
- reduce delay in start_scale function and reset weight after tare
## [2.0.2-beta6] - 2025-09-02
### Added
- add updateOctoSpoolId for OctoPrint integration and change autoSetToBambuSpoolId type to uint16_t
### Changed
- update platformio.ini for beta version v2.0.2-beta6
- update changelog and header for version v2.0.2-beta5
- update platformio.ini for beta version v2.0.2-beta5
- update changelog and header for version v2.0.2-beta4
- update platformio.ini for beta version v2.0.2-beta4
- update changelog and header for version v2.0.2-beta3
- update platformio.ini for beta version v2.0.2-beta3
- update changelog and header for version v2.0.2-beta2
- update platformio.ini for beta version v2.0.2-beta2
- update changelog and header for version v2.0.2-beta1
- update platformio.ini for beta version v2.0.2-beta1
### Fixed
- set scale tare request to true in setup function
- correct assignment operator in scale tare request handling
- correct tare scale request handling in tareScale function
- reset weight filter after tare scale operation
- correct tare scale function to set scaleTareRequest flag
- reset weight counter logic and update spool ID in loop function
- reduce delay in start_scale function and reset weight after tare
## [2.0.2-beta5] - 2025-09-02
### Added
- add updateOctoSpoolId for OctoPrint integration and change autoSetToBambuSpoolId type to uint16_t
### Changed
- update platformio.ini for beta version v2.0.2-beta5
- update changelog and header for version v2.0.2-beta4
- update platformio.ini for beta version v2.0.2-beta4
- update changelog and header for version v2.0.2-beta3
- update platformio.ini for beta version v2.0.2-beta3
- update changelog and header for version v2.0.2-beta2
- update platformio.ini for beta version v2.0.2-beta2
- update changelog and header for version v2.0.2-beta1
- update platformio.ini for beta version v2.0.2-beta1
### Fixed
- correct tare scale request handling in tareScale function
- reset weight filter after tare scale operation
- correct tare scale function to set scaleTareRequest flag
- reset weight counter logic and update spool ID in loop function
- reduce delay in start_scale function and reset weight after tare
## [2.0.2-beta4] - 2025-09-02
### Added
- add updateOctoSpoolId for OctoPrint integration and change autoSetToBambuSpoolId type to uint16_t
### Changed
- update platformio.ini for beta version v2.0.2-beta4
- update changelog and header for version v2.0.2-beta3
- update platformio.ini for beta version v2.0.2-beta3
- update changelog and header for version v2.0.2-beta2
- update platformio.ini for beta version v2.0.2-beta2
- update changelog and header for version v2.0.2-beta1
- update platformio.ini for beta version v2.0.2-beta1
### Fixed
- reset weight filter after tare scale operation
- correct tare scale function to set scaleTareRequest flag
- reset weight counter logic and update spool ID in loop function
- reduce delay in start_scale function and reset weight after tare
## [2.0.2-beta3] - 2025-09-02
### Added
- add updateOctoSpoolId for OctoPrint integration and change autoSetToBambuSpoolId type to uint16_t
### Changed
- update platformio.ini for beta version v2.0.2-beta3
- update changelog and header for version v2.0.2-beta2
- update platformio.ini for beta version v2.0.2-beta2
- update changelog and header for version v2.0.2-beta1
- update platformio.ini for beta version v2.0.2-beta1
### Fixed
- correct tare scale function to set scaleTareRequest flag
- reset weight counter logic and update spool ID in loop function
- reduce delay in start_scale function and reset weight after tare
## [2.0.2-beta2] - 2025-09-02
### Added
- add updateOctoSpoolId for OctoPrint integration and change autoSetToBambuSpoolId type to uint16_t
### Changed
- update platformio.ini for beta version v2.0.2-beta2
- update changelog and header for version v2.0.2-beta1
- update platformio.ini for beta version v2.0.2-beta1
### Fixed
- reset weight counter logic and update spool ID in loop function
- reduce delay in start_scale function and reset weight after tare
## [2.0.2-beta1] - 2025-09-02
### Changed
- update platformio.ini for beta version v2.0.2-beta1
### Fixed
- reset weight counter logic and update spool ID in loop function
- reduce delay in start_scale function and reset weight after tare
## [2.0.2] - 2025-09-01 ## [2.0.2] - 2025-09-01
### Added ### Added
- add weight check and update spool weight in writeJsonToTag function - add weight check and update spool weight in writeJsonToTag function

View File

@@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html ; https://docs.platformio.org/page/projectconf.html
[common] [common]
version = "2.0.2" version = "2.0.6"
to_old_version = "1.5.10" to_old_version = "1.5.10"
## ##

View File

@@ -42,6 +42,12 @@ def categorize_commit(commit_msg):
"""Categorize commit messages based on conventional commits""" """Categorize commit messages based on conventional commits"""
lower_msg = commit_msg.lower() lower_msg = commit_msg.lower()
# Filter out automatic release documentation commits
if ('docs:' in lower_msg and
('update changelog and header for version' in lower_msg or
'update platformio.ini for' in lower_msg)):
return None # Skip these commits
# Check for breaking changes first # Check for breaking changes first
if ('!' in commit_msg and any(x in lower_msg for x in ['feat!', 'fix!', 'chore!', 'refactor!'])) or \ if ('!' in commit_msg and any(x in lower_msg for x in ['feat!', 'fix!', 'chore!', 'refactor!'])) or \
'breaking change' in lower_msg or 'breaking:' in lower_msg: 'breaking change' in lower_msg or 'breaking:' in lower_msg:
@@ -77,11 +83,12 @@ def get_changes_from_git():
for commit in commits: for commit in commits:
if commit: if commit:
category = categorize_commit(commit) category = categorize_commit(commit)
# Clean up commit message if category is not None: # Skip commits that return None (filtered out)
clean_msg = re.sub(r'^(feat|fix|chore|docs|style|refactor|perf|test)(\(.*\))?!?:', '', commit).strip() # Clean up commit message
# Remove BREAKING CHANGE prefix if present clean_msg = re.sub(r'^(feat|fix|chore|docs|style|refactor|perf|test)(\(.*\))?!?:', '', commit).strip()
clean_msg = re.sub(r'^breaking change:\s*', '', clean_msg, flags=re.IGNORECASE).strip() # Remove BREAKING CHANGE prefix if present
changes[category].append(clean_msg) clean_msg = re.sub(r'^breaking change:\s*', '', clean_msg, flags=re.IGNORECASE).strip()
changes[category].append(clean_msg)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
print("Error: Failed to get git commits") print("Error: Failed to get git commits")

View File

@@ -21,6 +21,7 @@ uint16_t foundVendorId = 0; // Store ID of found vendor
uint16_t foundFilamentId = 0; // Store ID of found filament uint16_t foundFilamentId = 0; // Store ID of found filament
uint16_t createdFilamentId = 0; // Store ID of newly created filament uint16_t createdFilamentId = 0; // Store ID of newly created filament
uint16_t createdSpoolId = 0; // Store ID of newly created spool uint16_t createdSpoolId = 0; // Store ID of newly created spool
uint16_t updateOctoSpoolId = 0; // Store spool ID for OctoPrint update
bool spoolmanConnected = false; bool spoolmanConnected = false;
bool spoolmanExtraFieldsChecked = false; bool spoolmanExtraFieldsChecked = false;
TaskHandle_t* apiTask; TaskHandle_t* apiTask;

View File

@@ -33,6 +33,7 @@ extern bool sendOctoUpdate;
extern String octoUrl; extern String octoUrl;
extern String octoToken; extern String octoToken;
extern bool spoolmanConnected; extern bool spoolmanConnected;
extern uint16_t updateOctoSpoolId;
bool checkSpoolmanInstance(); bool checkSpoolmanInstance();
bool saveSpoolmanUrl(const String& url, bool octoOn, const String& octoWh, const String& octoTk); bool saveSpoolmanUrl(const String& url, bool octoOn, const String& octoWh, const String& octoTk);

View File

@@ -21,7 +21,7 @@ TaskHandle_t BambuMqttTask;
bool bambuDisabled = false; bool bambuDisabled = false;
bool bambu_connected = false; bool bambu_connected = false;
int autoSetToBambuSpoolId = 0; uint16_t autoSetToBambuSpoolId = 0;
BambuCredentials bambuCredentials; BambuCredentials bambuCredentials;

View File

@@ -37,7 +37,7 @@ extern bool bambu_connected;
extern int ams_count; extern int ams_count;
extern AMSData ams_data[MAX_AMS]; extern AMSData ams_data[MAX_AMS];
//extern bool autoSendToBambu; //extern bool autoSendToBambu;
extern int autoSetToBambuSpoolId; extern uint16_t autoSetToBambuSpoolId;
extern bool bambuDisabled; extern bool bambuDisabled;
extern BambuCredentials bambuCredentials; extern BambuCredentials bambuCredentials;

View File

@@ -59,6 +59,7 @@ void setup() {
// Scale // Scale
start_scale(touchSensorConnected); start_scale(touchSensorConnected);
scaleTareRequest = true;
// WDT initialisieren mit 10 Sekunden Timeout // WDT initialisieren mit 10 Sekunden Timeout
bool panic = true; // Wenn true, löst ein WDT-Timeout einen System-Panik aus bool panic = true; // Wenn true, löst ein WDT-Timeout einen System-Panik aus
@@ -196,17 +197,6 @@ void loop() {
{ {
lastWeightReadTime = currentMillis; lastWeightReadTime = currentMillis;
// Prüfen ob die Waage korrekt genullt ist
// Abweichung von 2g ignorieren
if (autoTare && (weight > 2 && weight < 7) || weight < -2)
{
scale_tare_counter++;
}
else
{
scale_tare_counter = 0;
}
// Prüfen ob das Gewicht gleich bleibt und dann senden // Prüfen ob das Gewicht gleich bleibt und dann senden
if (abs(weight - lastWeight) <= 2 && weight > 5) if (abs(weight - lastWeight) <= 2 && weight > 5)
{ {
@@ -220,7 +210,6 @@ void loop() {
} }
// reset weight counter after writing tag // reset weight counter after writing tag
// TBD: what exactly is the logic behind this?
if (currentMillis - lastWeightReadTime >= weightReadInterval && nfcReaderState != NFC_IDLE && nfcReaderState != NFC_READ_SUCCESS) if (currentMillis - lastWeightReadTime >= weightReadInterval && nfcReaderState != NFC_IDLE && nfcReaderState != NFC_READ_SUCCESS)
{ {
weigthCouterToApi = 0; weigthCouterToApi = 0;
@@ -243,6 +232,10 @@ void loop() {
{ {
autoSetToBambuSpoolId = activeSpoolId.toInt(); autoSetToBambuSpoolId = activeSpoolId.toInt();
} }
if (octoEnabled)
{
updateOctoSpoolId = activeSpoolId.toInt();
}
} }
else else
{ {
@@ -272,7 +265,7 @@ void loop() {
if(octoEnabled && sendOctoUpdate && spoolmanApiState == API_IDLE) if(octoEnabled && sendOctoUpdate && spoolmanApiState == API_IDLE)
{ {
updateSpoolOcto(autoSetToBambuSpoolId); updateSpoolOcto(updateOctoSpoolId);
sendOctoUpdate = false; sendOctoUpdate = false;
} }
} }

View File

@@ -141,7 +141,7 @@ uint8_t setAutoTare(bool autoTareValue) {
uint8_t tareScale() { uint8_t tareScale() {
Serial.println("Tare scale"); Serial.println("Tare scale");
scale.tare(); scale.tare();
resetWeightFilter(); // Reset stabilization filter after tare resetWeightFilter();
return 1; return 1;
} }
@@ -151,6 +151,7 @@ void scale_loop(void * parameter) {
Serial.println("Scale Loop started"); Serial.println("Scale Loop started");
Serial.println("++++++++++++++++++++++++++++++"); Serial.println("++++++++++++++++++++++++++++++");
//scaleTareRequest == true;
// Initialize weight filter // Initialize weight filter
resetWeightFilter(); resetWeightFilter();
lastMeasurementTime = millis(); lastMeasurementTime = millis();
@@ -162,17 +163,8 @@ void scale_loop(void * parameter) {
if (currentTime - lastMeasurementTime >= MEASUREMENT_INTERVAL_MS) { if (currentTime - lastMeasurementTime >= MEASUREMENT_INTERVAL_MS) {
if (scale.is_ready()) if (scale.is_ready())
{ {
// Waage automatisch Taren, wenn zu lange Abweichung
if (autoTare && scale_tare_counter >= 5)
{
Serial.println("Auto Tare scale");
scale.tare();
resetWeightFilter(); // Reset filter after auto tare
scale_tare_counter = 0;
}
// Waage manuell Taren // Waage manuell Taren
if (scaleTareRequest == true) if (scaleTareRequest == true || (autoTare && scale_tare_counter >= 20))
{ {
Serial.println("Re-Tare scale"); Serial.println("Re-Tare scale");
oledShowMessage("TARE Scale"); oledShowMessage("TARE Scale");
@@ -182,6 +174,8 @@ void scale_loop(void * parameter) {
vTaskDelay(pdMS_TO_TICKS(1000)); vTaskDelay(pdMS_TO_TICKS(1000));
oledShowWeight(0); oledShowWeight(0);
scaleTareRequest = false; scaleTareRequest = false;
scale_tare_counter = 0;
weight = 0; // Reset global weight variable after tare
} }
// Get raw weight reading // Get raw weight reading
@@ -195,6 +189,17 @@ void scale_loop(void * parameter) {
weight = stabilizedWeight; weight = stabilizedWeight;
} }
// Prüfen ob die Waage korrekt genullt ist
// Abweichung von 2g ignorieren
if (autoTare && (rawWeight > 2 && rawWeight < 7) || rawWeight < -2)
{
scale_tare_counter++;
}
else
{
scale_tare_counter = 0;
}
// Debug output for monitoring (can be removed in production) // Debug output for monitoring (can be removed in production)
static unsigned long lastDebugTime = 0; static unsigned long lastDebugTime = 0;
if (currentTime - lastDebugTime > 2000) { // Print every 2 seconds if (currentTime - lastDebugTime > 2000) { // Print every 2 seconds
@@ -237,7 +242,7 @@ void start_scale(bool touchSensorConnected) {
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN); scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
oledShowProgressBar(6, 7, DISPLAY_BOOT_TEXT, "Tare scale"); oledShowProgressBar(6, 7, DISPLAY_BOOT_TEXT, "Serching scale");
for (uint16_t i = 0; i < 3000; i++) { for (uint16_t i = 0; i < 3000; i++) {
yield(); yield();
vTaskDelay(pdMS_TO_TICKS(1)); vTaskDelay(pdMS_TO_TICKS(1));
@@ -257,9 +262,6 @@ void start_scale(bool touchSensorConnected) {
// Display Gewicht // Display Gewicht
oledShowWeight(0); oledShowWeight(0);
vTaskDelay(1000 / portTICK_PERIOD_MS);
scale.tare();
Serial.println("starte Scale Task"); Serial.println("starte Scale Task");
BaseType_t result = xTaskCreatePinnedToCore( BaseType_t result = xTaskCreatePinnedToCore(
scale_loop, /* Function to implement the task */ scale_loop, /* Function to implement the task */

View File

@@ -81,7 +81,9 @@ void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventTyp
else if (doc["type"] == "scale") { else if (doc["type"] == "scale") {
uint8_t success = 0; uint8_t success = 0;
if (doc["payload"] == "tare") { if (doc["payload"] == "tare") {
success = tareScale(); scaleTareRequest = true;
success = 1;
//success = tareScale();
} }
if (doc["payload"] == "calibrate") { if (doc["payload"] == "calibrate") {