From 1a8d3cb3326cbc34dd99a78e10d18834ed4db42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Tue, 26 Sep 2017 11:30:58 +0200 Subject: [PATCH] show real sdk version, make tpw setting actually work --- esphttpdconfig.mk | 4 ++-- libesphttpd | 2 +- user/cgi_main.c | 3 ++- user/cgi_system.c | 12 ++++++++++-- user/persist.h | 4 ++-- user/screen.c | 25 ++++++++++++++----------- user/version.h | 4 ++-- user/wifimgr.c | 4 ++++ 8 files changed, 37 insertions(+), 21 deletions(-) diff --git a/esphttpdconfig.mk b/esphttpdconfig.mk index 639eb23..617b057 100644 --- a/esphttpdconfig.mk +++ b/esphttpdconfig.mk @@ -43,12 +43,12 @@ GLOBAL_CFLAGS = \ -DDEBUG_CAPTDNS=0 \ -DDEBUG_HTTP=0 \ -DDEBUG_ESPFS=0 \ - -DDEBUG_PERSIST=0 \ + -DDEBUG_PERSIST=1 \ -DDEBUG_UTFCACHE=0 \ -DDEBUG_CGI=0 \ -DDEBUG_WIFI=0 \ -DDEBUG_WS=0 \ - -DDEBUG_ANSI=0 \ + -DDEBUG_ANSI=1 \ -DDEBUG_ANSI_NOIMPL=1 \ -DDEBUG_INPUT=0 \ -DDEBUG_HEAP=1 \ diff --git a/libesphttpd b/libesphttpd index 24f9a37..3479ab3 160000 --- a/libesphttpd +++ b/libesphttpd @@ -1 +1 @@ -Subproject commit 24f9a371eb5c0804dcc6657f99449ef07788140c +Subproject commit 3479ab3efcb4581669370cde6a607f936ff5515a diff --git a/user/cgi_main.c b/user/cgi_main.c index f2f6977..da13a41 100644 --- a/user/cgi_main.c +++ b/user/cgi_main.c @@ -68,7 +68,8 @@ tplAbout(HttpdConnData *connData, char *token, void **arg) tplSend(connData, httpdGetVersion(), -1); } else if (streq(token, "vers_sdk")) { - tplSend(connData, STR(ESP_SDK_VERSION), -1); + //tplSend(connData, STR(ESP_SDK_VERSION), -1); + tplSend(connData, system_get_sdk_version(), -1); } else if (streq(token, "hash_backend")) { tplSend(connData, GIT_HASH_BACKEND, -1); diff --git a/user/cgi_system.c b/user/cgi_system.c index e958f4f..01fc61b 100755 --- a/user/cgi_system.c +++ b/user/cgi_system.c @@ -234,10 +234,18 @@ tplSystemCfg(HttpdConnData *connData, char *token, void **arg) if (streq(token, "pwlock")) { sprintf(buff, "%d", sysconf->pwlock); } - - if (streq(token, "access_name")) { + else if (streq(token, "access_name")) { sprintf(buff, "%s", sysconf->access_name); } + else if (streq(token, "def_access_name")) { + sprintf(buff, "%s", DEF_ACCESS_NAME); + } + else if (streq(token, "def_access_pw")) { + sprintf(buff, "%s", DEF_ACCESS_PW); + } + else if (streq(token, "def_admin_pw")) { + sprintf(buff, "%s", DEFAULT_ADMIN_PW); + } tplSend(connData, buff, -1); return HTTPD_CGI_DONE; diff --git a/user/persist.h b/user/persist.h index 50fa0f5..57692ed 100644 --- a/user/persist.h +++ b/user/persist.h @@ -18,7 +18,7 @@ // Changing this could be used to force-erase the config area // after a firmware upgrade -#define CHECKSUM_SALT 5 +#define CHECKSUM_SALT 6 #define APPCONF_SIZE 1900 @@ -52,7 +52,7 @@ typedef struct { // the entire block should be 1024 bytes long (for compatibilit uint32_t checksum; // computed before write and tested on load. If it doesn't match, values are reset to hard defaults. } AppConfigBundle; -#define ADMINCONF_VERSION 0 +#define ADMINCONF_VERSION 1 #define ADMINCONF_SIZE 256 typedef struct { diff --git a/user/screen.c b/user/screen.c index 78c4712..3a7af28 100644 --- a/user/screen.c +++ b/user/screen.c @@ -339,6 +339,20 @@ screen_reset_do(bool size, bool labels) scr.tab_stops[i] = 0x80808080; } + if (labels) { + strcpy(termconf_live.title, termconf->title); + + for (int i = 1; i <= TERM_BTN_COUNT; i++) { + strcpy(termconf_live.btn[i], termconf->btn[i]); + strcpy(termconf_live.btn_msg[i], termconf->btn_msg[i]); + } + + termconf_live.show_buttons = termconf->show_buttons; + termconf_live.show_config_links = termconf->show_config_links; + + screen_notifyChange(CHANGE_LABELS); + } + // initial values in the save buffer in case of receiving restore without storing first opt_backup.cursors_alt_mode = scr.cursors_alt_mode; opt_backup.reverse_video = scr.reverse_video; @@ -355,17 +369,6 @@ screen_reset_do(bool size, bool labels) opt_backup.show_config_links = termconf_live.show_config_links; NOTIFY_DONE(); - - if (labels) { - strcpy(termconf_live.title, termconf->title); - - for (int i = 1; i <= TERM_BTN_COUNT; i++) { - strcpy(termconf_live.btn[i], termconf->btn[i]); - strcpy(termconf_live.btn_msg[i], termconf->btn_msg[i]); - } - - screen_notifyChange(CHANGE_LABELS); - } } /** diff --git a/user/version.h b/user/version.h index 8a32be1..9b13ea3 100644 --- a/user/version.h +++ b/user/version.h @@ -6,8 +6,8 @@ #define ESP_VT100_FIRMWARE_VERSION_H #define FW_V_MAJOR 1 -#define FW_V_MINOR 1 -#define FW_V_PATCH 2 +#define FW_V_MINOR 2 +#define FW_V_PATCH 0 #define FIRMWARE_VERSION STR(FW_V_MAJOR) "." STR(FW_V_MINOR) "." STR(FW_V_PATCH) #define FIRMWARE_VERSION_NUM (FW_V_MAJOR*1000 + FW_V_MINOR*10 + FW_V_PATCH) // this is used in ID queries diff --git a/user/wifimgr.c b/user/wifimgr.c index 2d20f9e..f1acc8e 100644 --- a/user/wifimgr.c +++ b/user/wifimgr.c @@ -187,6 +187,10 @@ wifimgr_apply_settings(void) configure_ap(); } + // tpw seems to be common - but info is scarce + // at any rate seems to do no harm to have it here + system_phy_set_max_tpw(wificonf->tpw); + wifi_change_flags.ap = false; wifi_change_flags.sta = false;