diff --git a/components/audio_client/audio_client.cpp b/components/audio_client/audio_client.cpp index 7b575bc..13f5823 100644 --- a/components/audio_client/audio_client.cpp +++ b/components/audio_client/audio_client.cpp @@ -19,9 +19,9 @@ static const char *TAG = "audio_client"; #define WS_BUFFER_SIZE 8192 /* Status image constants */ -#define STATUS_IMG_W 120 -#define STATUS_IMG_H 120 -#define STATUS_IMG_BYTES (STATUS_IMG_W * STATUS_IMG_H / 8) /* 1800 */ +#define STATUS_IMG_W 200 +#define STATUS_IMG_H 200 +#define STATUS_IMG_BYTES (STATUS_IMG_W * STATUS_IMG_H / 8) /* 5000 */ static esp_websocket_client_handle_t s_client = NULL; static CodecPort *s_codec = NULL; diff --git a/components/dashboard_ui/dashboard_ui.c b/components/dashboard_ui/dashboard_ui.c index 5124580..e55db60 100644 --- a/components/dashboard_ui/dashboard_ui.c +++ b/components/dashboard_ui/dashboard_ui.c @@ -227,12 +227,12 @@ static void create_time_bar(lv_obj_t *parent) static void create_main_section(lv_obj_t *parent) { - /* === Left column: Services === */ + /* === Left column: Services + Pi Vitals === */ create_label(parent, 4, MAIN_Y + 2, &InziuIosevka_Slab_CC_12px, "SERVICES"); tbl_services = lv_table_create(parent); lv_obj_set_pos(tbl_services, 4, MAIN_Y + 16); - lv_obj_set_size(tbl_services, 190, 180); + lv_obj_set_size(tbl_services, 190, 68); lv_table_set_col_cnt(tbl_services, 2); lv_table_set_col_width(tbl_services, 0, 110); lv_table_set_col_width(tbl_services, 1, 65); @@ -251,19 +251,19 @@ static void create_main_section(lv_obj_t *parent) /* Auto-scroll timer: 3 second period */ s_scroll_timer = lv_timer_create(scroll_timer_cb, 3000, NULL); - /* === Right column: Pi Vitals + Local Sensors === */ - int rx = RIGHT_COL_X; + /* === Left column: Pi Vitals (below services) === */ + int rx = 0; int row_h = 18; /* vertical spacing per stat row */ int lbl_w = 36; /* width reserved for "CPU " etc */ int bar_w = 82; int bar_h = 12; int val_x = rx + 4 + lbl_w + bar_w + 4; /* value label after bar */ - int temp_x = rx + 156; /* TEMP column, right of value labels */ + int temp_x = rx + 160; /* TEMP column, right of value labels */ - /* Pi Vitals header */ - create_label(parent, rx + 4, MAIN_Y + 2, &InziuIosevka_Slab_CC_12px, "PI VITALS"); + /* Pi Vitals header — Y=162 */ + create_label(parent, rx + 4, 162, &InziuIosevka_Slab_CC_12px, "PI VITALS"); - int ry = MAIN_Y + 18; + int ry = 176; /* CPU [========] 12% TEMP */ create_label(parent, rx + 4, ry, &InziuIosevka_Slab_CC_12px, "CPU"); @@ -288,10 +288,10 @@ static void create_main_section(lv_obj_t *parent) ry += row_h; lbl_uptime = create_label(parent, rx + 4, ry, &InziuIosevka_Slab_CC_12px, "Uptime: --h"); - /* === Status image (120x120, bottom-right above bot bar) === */ + /* === Right column: Status image (200x200) === */ img_status = lv_img_create(parent); - lv_obj_set_pos(img_status, 280, 156); - lv_obj_set_size(img_status, 120, 120); + lv_obj_set_pos(img_status, 200, MAIN_Y + 2); + lv_obj_set_size(img_status, 200, 200); lv_obj_set_style_bg_color(img_status, lv_color_white(), 0); lv_obj_set_style_bg_opa(img_status, LV_OPA_COVER, 0); } diff --git a/pi/contents_server.py b/pi/contents_server.py index d61834e..40546c5 100644 --- a/pi/contents_server.py +++ b/pi/contents_server.py @@ -6,7 +6,7 @@ connected ESP32 dashboard client on port 8766. Protocol: Status image: - 1. Text frame: {"type":"status_image","width":120,"height":120} + 1. Text frame: {"type":"status_image","width":200,"height":200} 2. Binary frame: 1-bit monochrome bitmap Alarm audio: diff --git a/pi/image_handler.py b/pi/image_handler.py index 24aa94b..4e00bc7 100644 --- a/pi/image_handler.py +++ b/pi/image_handler.py @@ -9,12 +9,12 @@ from PIL import Image log = logging.getLogger(__name__) IMG_DIR = Path(__file__).parent / "assets" / "img" -STATUS_IMG_SIZE = 120 +STATUS_IMG_SIZE = 200 MONOCHROME_THRESHOLD = 180 def load_status_image(path: Path) -> bytes: - """Load a PNG, convert to 1-bit 120x120 monochrome bitmap (MSB-first, black=1). + """Load a PNG, convert to 1-bit 200x200 monochrome bitmap (MSB-first, black=1). Transparent pixels are composited onto white so they don't render as black. """