Compare commits
No commits in common. "d2be75217506fdf26ab87a3581e78bb69b0a03a2" and "024056cb7db59cf2b3f11e69686577df4147778f" have entirely different histories.
d2be752175
...
024056cb7d
37
CHANGELOG.md
37
CHANGELOG.md
@ -1,42 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [1.4.8] - 2025-03-29
|
|
||||||
### Changed
|
|
||||||
- update platformio.ini for version v1.4.8
|
|
||||||
- Merge pull request #30 from janecker/main
|
|
||||||
- Merge branch 'testing' into main
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- improve HTTP client configuration and clear update documents after API calls
|
|
||||||
- Fixes memory leak in HTTPClient by disabling connection reuse
|
|
||||||
- update reload logic after removing and saving Bambu credentials for better cache handling
|
|
||||||
|
|
||||||
|
|
||||||
## [1.4.7] - 2025-03-27
|
|
||||||
### Added
|
|
||||||
- add forced cache refresh after removing and saving Bambu credentials
|
|
||||||
- add functionality to remove Bambu credentials and update API handling
|
|
||||||
- add rfid_bambu.html and update bambu connection handling
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- update platformio.ini for version v1.4.7
|
|
||||||
- Merge branch 'testing'
|
|
||||||
- update remove button for Bambu credentials with red background
|
|
||||||
- Merge pull request #28 from tugsi/main
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- handle Bambu connection state by introducing bambuDisabled flag
|
|
||||||
- Fix rfid.js-Failure with X1-Series, if you wanna send a Spool to AMS: - Uncaught TypeError: Cannot read properties of undefined (reading 'replace') at handleSpoolIn (rfid.js:493:67) at HTMLButtonElement.onclick ((Index):1:1) handleSpoolIn @ rfid.js:493 onclick @ (Index):1
|
|
||||||
|
|
||||||
|
|
||||||
## [1.4.6] - 2025-03-26
|
|
||||||
### Changed
|
|
||||||
- update platformio.ini for version v1.4.6
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- handle potential undefined value for tray_info_idx in handleSpoolIn function, by @tugsi
|
|
||||||
|
|
||||||
|
|
||||||
## [1.4.5] - 2025-03-25
|
## [1.4.5] - 2025-03-25
|
||||||
### Changed
|
### Changed
|
||||||
- update platformio.ini for version v1.4.5
|
- update platformio.ini for version v1.4.5
|
||||||
|
@ -57,31 +57,6 @@
|
|||||||
toggleOctoFields();
|
toggleOctoFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
function removeBambuCredentials() {
|
|
||||||
fetch('/api/bambu?remove=true')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.success) {
|
|
||||||
document.getElementById('bambuIp').value = '';
|
|
||||||
document.getElementById('bambuSerial').value = '';
|
|
||||||
document.getElementById('bambuCode').value = '';
|
|
||||||
document.getElementById('autoSend').checked = false;
|
|
||||||
document.getElementById('autoSendTime').value = '';
|
|
||||||
document.getElementById('bambuStatusMessage').innerText = 'Bambu Credentials removed!';
|
|
||||||
// Reload with forced cache refresh after short delay
|
|
||||||
setTimeout(() => {
|
|
||||||
window.location.reload(true);
|
|
||||||
window.location.href = '/';
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
|
||||||
document.getElementById('bambuStatusMessage').innerText = 'Error while removing Bambu Credentials.';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
document.getElementById('bambuStatusMessage').innerText = 'Error while removing: ' + error.message;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkSpoolmanInstance() {
|
function checkSpoolmanInstance() {
|
||||||
const url = document.getElementById('spoolmanUrl').value;
|
const url = document.getElementById('spoolmanUrl').value;
|
||||||
const spoolmanOctoEnabled = document.getElementById('spoolmanOctoEnabled').checked;
|
const spoolmanOctoEnabled = document.getElementById('spoolmanOctoEnabled').checked;
|
||||||
@ -114,11 +89,6 @@
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.healthy) {
|
if (data.healthy) {
|
||||||
document.getElementById('bambuStatusMessage').innerText = 'Bambu Credentials saved!';
|
document.getElementById('bambuStatusMessage').innerText = 'Bambu Credentials saved!';
|
||||||
// Reload with forced cache refresh after short delay
|
|
||||||
setTimeout(() => {
|
|
||||||
window.location.reload(true);
|
|
||||||
window.location.href = '/';
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('bambuStatusMessage').innerText = 'Error while saving Bambu Credentials.';
|
document.getElementById('bambuStatusMessage').innerText = 'Error while saving Bambu Credentials.';
|
||||||
}
|
}
|
||||||
@ -192,7 +162,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button style="margin: 0;" onclick="saveBambuCredentials()">Save Bambu Credentials</button>
|
<button style="margin: 0;" onclick="saveBambuCredentials()">Save Bambu Credentials</button>
|
||||||
<button style="margin: 0; background-color: red;" onclick="removeBambuCredentials()">Remove Credentials</button>
|
|
||||||
<p id="bambuStatusMessage"></p>
|
<p id="bambuStatusMessage"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
version = "1.4.8"
|
version = "1.4.5"
|
||||||
to_old_version = "1.4.0"
|
to_old_version = "1.4.0"
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -94,8 +94,6 @@ void sendToApi(void *parameter) {
|
|||||||
String octoToken = params->octoToken;
|
String octoToken = params->octoToken;
|
||||||
|
|
||||||
HTTPClient http;
|
HTTPClient http;
|
||||||
http.setReuse(false);
|
|
||||||
|
|
||||||
http.begin(spoolsUrl);
|
http.begin(spoolsUrl);
|
||||||
http.addHeader("Content-Type", "application/json");
|
http.addHeader("Content-Type", "application/json");
|
||||||
if (octoEnabled && octoToken != "") http.addHeader("X-Api-Key", octoToken);
|
if (octoEnabled && octoToken != "") http.addHeader("X-Api-Key", octoToken);
|
||||||
@ -113,7 +111,6 @@ void sendToApi(void *parameter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
http.end();
|
http.end();
|
||||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
|
||||||
|
|
||||||
// Speicher freigeben
|
// Speicher freigeben
|
||||||
delete params;
|
delete params;
|
||||||
@ -168,8 +165,6 @@ bool updateSpoolTagId(String uidString, const char* payload) {
|
|||||||
NULL // Task-Handle (nicht benötigt)
|
NULL // Task-Handle (nicht benötigt)
|
||||||
);
|
);
|
||||||
|
|
||||||
updateDoc.clear();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,8 +201,6 @@ uint8_t updateSpoolWeight(String spoolId, uint16_t weight) {
|
|||||||
NULL // Task-Handle (nicht benötigt)
|
NULL // Task-Handle (nicht benötigt)
|
||||||
);
|
);
|
||||||
|
|
||||||
updateDoc.clear();
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,8 +238,6 @@ bool updateSpoolOcto(int spoolId) {
|
|||||||
NULL // Task-Handle (nicht benötigt)
|
NULL // Task-Handle (nicht benötigt)
|
||||||
);
|
);
|
||||||
|
|
||||||
updateDoc.clear();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,32 +38,6 @@ int ams_count = 0;
|
|||||||
String amsJsonData; // Speichert das fertige JSON für WebSocket-Clients
|
String amsJsonData; // Speichert das fertige JSON für WebSocket-Clients
|
||||||
AMSData ams_data[MAX_AMS]; // Definition des Arrays;
|
AMSData ams_data[MAX_AMS]; // Definition des Arrays;
|
||||||
|
|
||||||
bool removeBambuCredentials() {
|
|
||||||
if (BambuMqttTask) {
|
|
||||||
vTaskDelete(BambuMqttTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!removeJsonValue("/bambu_credentials.json")) {
|
|
||||||
Serial.println("Fehler beim Löschen der Bambu-Credentials.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Löschen der globalen Variablen
|
|
||||||
g_bambu_ip = "";
|
|
||||||
g_bambu_accesscode = "";
|
|
||||||
g_bambu_serialnr = "";
|
|
||||||
bambu_ip = nullptr;
|
|
||||||
bambu_accesscode = nullptr;
|
|
||||||
bambu_serialnr = nullptr;
|
|
||||||
autoSendToBambu = false;
|
|
||||||
autoSetToBambuSpoolId = 0;
|
|
||||||
ams_count = 0;
|
|
||||||
amsJsonData = "";
|
|
||||||
|
|
||||||
bambuDisabled = true;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool saveBambuCredentials(const String& ip, const String& serialnr, const String& accesscode, bool autoSend, const String& autoSendTime) {
|
bool saveBambuCredentials(const String& ip, const String& serialnr, const String& accesscode, bool autoSend, const String& autoSendTime) {
|
||||||
if (BambuMqttTask) {
|
if (BambuMqttTask) {
|
||||||
vTaskDelete(BambuMqttTask);
|
vTaskDelete(BambuMqttTask);
|
||||||
|
@ -32,7 +32,6 @@ extern bool autoSendToBambu;
|
|||||||
extern int autoSetToBambuSpoolId;
|
extern int autoSetToBambuSpoolId;
|
||||||
extern bool bambuDisabled;
|
extern bool bambuDisabled;
|
||||||
|
|
||||||
bool removeBambuCredentials();
|
|
||||||
bool loadBambuCredentials();
|
bool loadBambuCredentials();
|
||||||
bool saveBambuCredentials(const String& bambu_ip, const String& bambu_serialnr, const String& bambu_accesscode, const bool autoSend, const String& autoSendTime);
|
bool saveBambuCredentials(const String& bambu_ip, const String& bambu_serialnr, const String& bambu_accesscode, const bool autoSend, const String& autoSendTime);
|
||||||
bool setupMqtt();
|
bool setupMqtt();
|
||||||
|
@ -1,20 +1,6 @@
|
|||||||
#include "commonFS.h"
|
#include "commonFS.h"
|
||||||
#include <LittleFS.h>
|
#include <LittleFS.h>
|
||||||
|
|
||||||
bool removeJsonValue(const char* filename) {
|
|
||||||
File file = LittleFS.open(filename, "r");
|
|
||||||
if (!file) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
file.close();
|
|
||||||
if (!LittleFS.remove(filename)) {
|
|
||||||
Serial.print("Fehler beim Löschen der Datei: ");
|
|
||||||
Serial.println(filename);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool saveJsonValue(const char* filename, const JsonDocument& doc) {
|
bool saveJsonValue(const char* filename, const JsonDocument& doc) {
|
||||||
File file = LittleFS.open(filename, "w");
|
File file = LittleFS.open(filename, "w");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <LittleFS.h>
|
#include <LittleFS.h>
|
||||||
|
|
||||||
bool removeJsonValue(const char* filename);
|
|
||||||
bool saveJsonValue(const char* filename, const JsonDocument& doc);
|
bool saveJsonValue(const char* filename, const JsonDocument& doc);
|
||||||
bool loadJsonValue(const char* filename, JsonDocument& doc);
|
bool loadJsonValue(const char* filename, JsonDocument& doc);
|
||||||
void initializeFileSystem();
|
void initializeFileSystem();
|
||||||
|
@ -313,15 +313,6 @@ void setupWebserver(AsyncWebServer &server) {
|
|||||||
|
|
||||||
// Route für das Überprüfen der Bambu-Instanz
|
// Route für das Überprüfen der Bambu-Instanz
|
||||||
server.on("/api/bambu", HTTP_GET, [](AsyncWebServerRequest *request){
|
server.on("/api/bambu", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
if (request->hasParam("remove")) {
|
|
||||||
if (removeBambuCredentials()) {
|
|
||||||
request->send(200, "application/json", "{\"success\": true}");
|
|
||||||
} else {
|
|
||||||
request->send(500, "application/json", "{\"success\": false, \"error\": \"Fehler beim Löschen der Bambu-Credentials\"}");
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!request->hasParam("bambu_ip") || !request->hasParam("bambu_serialnr") || !request->hasParam("bambu_accesscode")) {
|
if (!request->hasParam("bambu_ip") || !request->hasParam("bambu_serialnr") || !request->hasParam("bambu_accesscode")) {
|
||||||
request->send(400, "application/json", "{\"success\": false, \"error\": \"Missing parameter\"}");
|
request->send(400, "application/json", "{\"success\": false, \"error\": \"Missing parameter\"}");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user