docs: update platformio.ini dependencies and improve version handling in website.cpp
This commit is contained in:
parent
9b29460d64
commit
5cbbe1d231
@ -19,10 +19,11 @@ monitor_speed = 115200
|
|||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
tzapu/WiFiManager @ ^2.0.17
|
tzapu/WiFiManager @ ^2.0.17
|
||||||
#https://github.com/me-no-dev/ESPAsyncWebServer.git#master
|
https://github.com/me-no-dev/ESPAsyncWebServer.git#master
|
||||||
#me-no-dev/AsyncTCP @ ^1.1.1
|
#me-no-dev/AsyncTCP @ ^1.1.1
|
||||||
mathieucarbou/ESPAsyncWebServer @ ^3.6.0
|
https://github.com/esphome/AsyncTCP.git
|
||||||
esp32async/AsyncTCP @ ^3.3.5
|
#mathieucarbou/ESPAsyncWebServer @ ^3.6.0
|
||||||
|
#esp32async/AsyncTCP @ ^3.3.5
|
||||||
bogde/HX711 @ ^0.7.5
|
bogde/HX711 @ ^0.7.5
|
||||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||||
adafruit/Adafruit GFX Library @ ^1.11.11
|
adafruit/Adafruit GFX Library @ ^1.11.11
|
||||||
@ -45,7 +46,7 @@ build_flags =
|
|||||||
-fdata-sections
|
-fdata-sections
|
||||||
-DNDEBUG
|
-DNDEBUG
|
||||||
-mtext-section-literals
|
-mtext-section-literals
|
||||||
'-D VERSION="${common.version}"'
|
-DVERSION=\"${common.version}\"
|
||||||
-DASYNCWEBSERVER_REGEX
|
-DASYNCWEBSERVER_REGEX
|
||||||
-DCORE_DEBUG_LEVEL=3
|
-DCORE_DEBUG_LEVEL=3
|
||||||
-DCONFIG_ARDUHAL_LOG_COLORS=1
|
-DCONFIG_ARDUHAL_LOG_COLORS=1
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
#include "ota.h"
|
#include "ota.h"
|
||||||
#include <Update.h>
|
#include <Update.h>
|
||||||
|
|
||||||
|
#ifndef VERSION
|
||||||
|
#define VERSION "1.1.0"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Cache-Control Header definieren
|
// Cache-Control Header definieren
|
||||||
#define CACHE_CONTROL "max-age=604800" // Cache für 1 Woche
|
#define CACHE_CONTROL "max-age=604800" // Cache für 1 Woche
|
||||||
|
|
||||||
@ -45,7 +49,7 @@ void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventTyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (doc["type"] == "writeNfcTag") {
|
else if (doc["type"] == "writeNfcTag") {
|
||||||
if (doc.containsKey("payload")) {
|
if (doc["payload"].is<JsonObject>()) {
|
||||||
// Versuche NFC-Daten zu schreiben
|
// Versuche NFC-Daten zu schreiben
|
||||||
String payloadString;
|
String payloadString;
|
||||||
serializeJson(doc["payload"], payloadString);
|
serializeJson(doc["payload"], payloadString);
|
||||||
@ -152,7 +156,7 @@ void sendNfcData(AsyncWebSocketClient *client) {
|
|||||||
|
|
||||||
void sendAmsData(AsyncWebSocketClient *client) {
|
void sendAmsData(AsyncWebSocketClient *client) {
|
||||||
if (ams_count > 0) {
|
if (ams_count > 0) {
|
||||||
ws.textAll("{\"type\":\"amsData\", \"payload\":" + amsJsonData + "}");
|
ws.textAll("{\"type\":\"amsData\",\"payload\":" + amsJsonData + "}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +235,7 @@ void setupWebserver(AsyncWebServer &server) {
|
|||||||
html.replace("{{spoolmanUrl}}", spoolmanUrl);
|
html.replace("{{spoolmanUrl}}", spoolmanUrl);
|
||||||
|
|
||||||
JsonDocument doc;
|
JsonDocument doc;
|
||||||
if (loadJsonValue("/bambu_credentials.json", doc) && doc.containsKey("bambu_ip")) {
|
if (loadJsonValue("/bambu_credentials.json", doc) && doc["bambu_ip"].is<JsonObject>()) {
|
||||||
String bambuIp = doc["bambu_ip"].as<String>();
|
String bambuIp = doc["bambu_ip"].as<String>();
|
||||||
String bambuSerial = doc["bambu_serialnr"].as<String>();
|
String bambuSerial = doc["bambu_serialnr"].as<String>();
|
||||||
String bambuCode = doc["bambu_accesscode"].as<String>();
|
String bambuCode = doc["bambu_accesscode"].as<String>();
|
||||||
@ -417,7 +421,8 @@ void setupWebserver(AsyncWebServer &server) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
server.on("/api/version", HTTP_GET, [](AsyncWebServerRequest *request){
|
server.on("/api/version", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
String jsonResponse = "{\"version\": \"" VERSION "\"}";
|
String fm_version = VERSION;
|
||||||
|
String jsonResponse = "{\"version\": \""+ fm_version +"\"}";
|
||||||
request->send(200, "application/json", jsonResponse);
|
request->send(200, "application/json", jsonResponse);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user