Include pcb version information

This commit is contained in:
2026-03-02 08:37:44 +01:00
parent 294f1731c9
commit 56b9d04cf8
6 changed files with 28 additions and 9 deletions

View File

@@ -181,6 +181,7 @@ void webserver_init() {
server.on("/api/status", HTTP_GET, [](AsyncWebServerRequest *request) {
StaticJsonDocument<512> doc;
doc["version"] = VERSION;
doc["pcbversion"] = PCBVERSION;
int cpu_freq = esp_clk_cpu_freq() / 1000000;
doc["cpuspeed"] = String(cpu_freq) + "MHz";
char ssid[13];
@@ -271,7 +272,7 @@ void webserver_init() {
server.on("/api/update", HTTP_POST, [](AsyncWebServerRequest *request) {
// the request handler is triggered after the upload has finished...
// create the response, add header, and send response
LOGD(TAG, "update called");
LOGI(TAG, "update called");
StaticJsonDocument<100> doc;
if (updateSuccess) {
doc["status"] = "OK";
@@ -289,10 +290,8 @@ void webserver_init() {
}
}, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {
// this is the new image upload part
Serial.print("Retrieving firmware image named: ");
Serial.println(filename);
if (index == 0) {
LOGI(TAG, "Retrieving firmware image named: %s", filename);
if (! Update.begin(UPDATE_SIZE_UNKNOWN)) {
Update.printError(Serial);
updateError = "Update.begin() failed";
@@ -310,7 +309,6 @@ void webserver_init() {
updateError = "Update.end() failed";
}
}
});
server.on("/api/devicelist", HTTP_GET, [](AsyncWebServerRequest *request) {