on device wifi
All checks were successful
ESP32 Build & Release / build (push) Successful in 6m41s

This commit is contained in:
2026-09-12 13:09:47 +02:00
parent 80eab1752c
commit d691febfe4
13 changed files with 1340 additions and 224 deletions

View File

@@ -988,13 +988,23 @@ static void view_device_info(void)
storage_manager_count_cached(&json_c, &jpg_c);
uint32_t free_heap = esp_get_free_heap_size();
const char *ssid = wifi_manager_get_connected_ssid();
int rssi = wifi_manager_get_rssi();
char wifi_line[32];
if (wifi_manager_connected() && ssid && strlen(ssid) > 0) {
snprintf(wifi_line, sizeof(wifi_line), "%s (%ddB)", ssid, rssi);
} else {
snprintf(wifi_line, sizeof(wifi_line), "Disconnected");
}
lv_obj_t *lbl_keys = lv_label_create(box);
lv_obj_set_width(lbl_keys, 75);
lv_obj_set_style_text_font(lbl_keys, &lv_font_montserrat_14, 0);
lv_obj_set_style_text_color(lbl_keys, lv_color_hex(0x00E5FF), 0);
lv_label_set_text(lbl_keys,
"VERSION:\n"
"WI-FI IP:\n"
"WI-FI:\n"
"IP ADDR:\n"
"HOTSPOT:\n"
"STORAGE:\n"
"CARDS:\n"
@@ -1010,6 +1020,7 @@ static void view_device_info(void)
lv_obj_set_style_text_color(lbl_vals, lv_color_hex(COLOR_AMBER), 0);
lv_obj_set_style_text_align(lbl_vals, LV_TEXT_ALIGN_RIGHT, 0);
lv_label_set_text_fmt(lbl_vals,
"%s\n"
"%s\n"
"%s\n"
"192.168.4.1\n"
@@ -1020,6 +1031,7 @@ static void view_device_info(void)
"ESP32+ST7789\n"
"MFRC522",
ota_manager_get_current_version(),
wifi_line,
wifi_manager_get_ip(),
(int)(used_b / 1024), (int)(total_b / 1024),
json_c,
@@ -1093,14 +1105,27 @@ static void view_ota(void)
lv_obj_set_style_text_color(t, lv_color_hex(0x00E676), 0);
lv_obj_align(t, LV_ALIGN_TOP_MID, 0, 8);
char target_str[32];
if (strlen(rel->remote_hash) >= 7) {
snprintf(target_str, sizeof(target_str), "%.8s", rel->remote_hash);
} else {
snprintf(target_str, sizeof(target_str), "%s", rel->tag_name);
}
lv_obj_t *v = lv_label_create(box);
lv_label_set_text_fmt(v, "TARGET: %s", rel->tag_name);
lv_label_set_text_fmt(v, "NEW: %s", target_str);
lv_obj_set_style_text_font(v, &lv_font_montserrat_20, 0);
lv_obj_set_style_text_color(v, lv_color_hex(0xFFCC00), 0);
lv_obj_align(v, LV_ALIGN_TOP_MID, 0, 38);
const char *cur_sha = ota_manager_get_running_sha256();
char cur_str[32];
if (strlen(cur_sha) >= 7) {
snprintf(cur_str, sizeof(cur_str), "%.8s", cur_sha);
} else {
snprintf(cur_str, sizeof(cur_str), "%.8s", cur_ver);
}
lv_obj_t *c = lv_label_create(box);
lv_label_set_text_fmt(c, "Current: %s", cur_ver);
lv_label_set_text_fmt(c, "Current: %s", cur_str);
lv_obj_set_style_text_font(c, &lv_font_montserrat_14, 0);
lv_obj_set_style_text_color(c, lv_color_white(), 0);
lv_obj_align(c, LV_ALIGN_TOP_MID, 0, 70);
@@ -1131,6 +1156,14 @@ static void view_ota(void)
case OTA_STATUS_UP_TO_DATE: {
const char *cur_ver = ota_manager_get_current_version();
const char *cur_sha = ota_manager_get_running_sha256();
char disp_ver[32];
if (strlen(cur_sha) >= 7) {
snprintf(disp_ver, sizeof(disp_ver), "%.8s", cur_sha);
} else {
snprintf(disp_ver, sizeof(disp_ver), "%s", cur_ver);
}
lv_obj_t *box = lv_obj_create(lv_scr_act());
lv_obj_set_size(box, DISP_W - 24, 180);
lv_obj_align(box, LV_ALIGN_CENTER, 0, -10);
@@ -1146,7 +1179,7 @@ static void view_ota(void)
lv_obj_align(t, LV_ALIGN_TOP_MID, 0, 15);
lv_obj_t *v = lv_label_create(box);
lv_label_set_text_fmt(v, "Version: %s\n\nNo newer releases\nfound on Gitea.", cur_ver);
lv_label_set_text_fmt(v, "Hash: %s\n\nNo newer releases\nfound on Gitea.", disp_ver);
lv_obj_set_style_text_font(v, &lv_font_montserrat_14, 0);
lv_obj_set_style_text_color(v, lv_color_white(), 0);
lv_obj_set_style_text_align(v, LV_TEXT_ALIGN_CENTER, 0);