Include pcb version information
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user