Skip to content

Commit

Permalink
Web interface: firmware version
Browse files Browse the repository at this point in the history
  • Loading branch information
DrZlo13 committed Sep 22, 2023
1 parent 03b806d commit f7bf907
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
13 changes: 13 additions & 0 deletions components/svelte-portal/src/tabs/TabSys.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
}
</script>

<!--
"firmware_commit": "03b806d",
"firmware_branch": "zlo/2630-logs-over-wifi",
"firmware_branch_num": "157",
"firmware_version": "0.1.1",
"firmware_build_date": "22-09-2023",
-->
<Grid>
{#await api.get("/api/v1/system/info")}
<Value name="IP"><Spinner /></Value>
Expand All @@ -50,6 +57,12 @@
<Value name="IP" selectable="true">{print_ip(json.ip)}</Value>
<Value name="Mac">{print_mac(json.mac)}</Value>
<Value name="IDF ver">{json.idf_version}</Value>
<Value name="FW commit">
{json.firmware_branch}#{json.firmware_commit}
</Value>
<Value name="FW ver">
{json.firmware_version}/{json.firmware_branch_num}/{json.firmware_build_date}
</Value>
<Value name="Model">
{json.model}.{json.revision}
{json.cores}-core
Expand Down
3 changes: 2 additions & 1 deletion main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ message(STATUS "FW branch: ${FW_GIT_BRANCH}")
message(STATUS "FW branch num: ${FW_GIT_BRANCH_NUM}")
message(STATUS "FW version: ${FW_GIT_VERSION}")

set_property(SOURCE "cli/cli-commands-device-info.c" APPEND PROPERTY COMPILE_OPTIONS ${INFO_FLAGS})
set_property(SOURCE "cli/cli-commands-device-info.c" APPEND PROPERTY COMPILE_OPTIONS ${INFO_FLAGS})
set_property(SOURCE "network-http.c" APPEND PROPERTY COMPILE_OPTIONS ${INFO_FLAGS})
6 changes: 6 additions & 0 deletions main/network-http.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ static esp_err_t system_info_get_handler(httpd_req_t* req) {
esp_chip_info(&chip_info);

cJSON_AddStringToObject(root, "idf_version", IDF_VER);
cJSON_AddStringToObject(root, "firmware_commit", FW_GIT_COMMIT);
cJSON_AddStringToObject(root, "firmware_branch", FW_GIT_BRANCH);
cJSON_AddStringToObject(root, "firmware_branch_num", FW_GIT_BRANCH_NUM);
cJSON_AddStringToObject(root, "firmware_version", FW_GIT_VERSION);
cJSON_AddStringToObject(root, "firmware_build_date", FW_BUILD_DATE);

switch(chip_info.model) {
case CHIP_ESP32:
cJSON_AddStringToObject(root, "model", "ESP32");
Expand Down

0 comments on commit f7bf907

Please sign in to comment.