Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df404f5f63
|
||
|
|
7b8c936559
|
||
|
|
17c18ed1c9
|
||
|
|
274e3b359b
|
||
|
|
73c98eb2d1
|
||
|
|
022e882001
|
||
|
|
dc08512397
|
+1
-1
Submodule front-end updated: 01148465b7...420353efc9
@@ -1 +0,0 @@
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ function buildlang() {
|
||||
cp ../rel-tpl/README.txt ${readmefil}
|
||||
sed -i s/%VERS%/${vers}/ ${readmefil}
|
||||
sed -i s/%LANG%/${lang}/ ${readmefil}
|
||||
dt=$(LC_TIME=en_US.UTF-8 date '+%c %Z')
|
||||
dt=$(LC_TIME=en_US.UTF-8 date '+%c')
|
||||
sed -i "s#%DATETIME%#${dt}#" ${readmefil}
|
||||
unix2dos ${readmefil}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "version.h"
|
||||
#include "uart_buffer.h"
|
||||
#include "screen.h"
|
||||
#include "wifimgr.h"
|
||||
|
||||
volatile bool enquiry_suppressed = false;
|
||||
ETSTimer enqTimer;
|
||||
@@ -51,7 +52,17 @@ apars_handle_enq(void)
|
||||
wifi_get_macaddr(SOFTAP_IF, mac);
|
||||
|
||||
char buf100[100];
|
||||
sprintf(buf100, "\x1bXESPTerm "VERSION_STRING" #"GIT_HASH_BACKEND"+"GIT_HASH_FRONTEND" id=%02X%02X%02X\x1b\\", mac[3], mac[4], mac[5]);
|
||||
char *buf = buf100;
|
||||
buf += sprintf(buf, "\x1bX");
|
||||
buf += sprintf(buf, "ESPTerm "VERSION_STRING" ");
|
||||
buf += sprintf(buf, "#"GIT_HASH_BACKEND"+"GIT_HASH_FRONTEND" ");
|
||||
buf += sprintf(buf, "id=%02X%02X%02X ", mac[3], mac[4], mac[5]);
|
||||
int x = getStaIpAsString(buf);
|
||||
if (x) buf += x;
|
||||
else buf--; // remove the trailing space
|
||||
buf += sprintf(buf, "\x1b\\");
|
||||
|
||||
(void)buf;
|
||||
|
||||
// version encased in SOS and ST
|
||||
apars_respond(buf100);
|
||||
|
||||
+6
-7
@@ -63,8 +63,6 @@ requestCb(int http_status,
|
||||
|
||||
struct d2d_request_opts *opts = userArg;
|
||||
|
||||
d2d_dbg("Rx url response, code %d, nonce \"%s\"", http_status, opts->nonce?opts->nonce:"");
|
||||
|
||||
// ensure positive - would be hard to parse
|
||||
if (http_status < 0) http_status = -http_status;
|
||||
|
||||
@@ -77,6 +75,8 @@ requestCb(int http_status,
|
||||
if (opts->max_result_len > 0 && len > opts->max_result_len)
|
||||
len = (int) opts->max_result_len;
|
||||
|
||||
d2d_info("Rx HTTP response, code %d, len %d, nonce \"%s\"", http_status, len, opts->nonce?opts->nonce:"");
|
||||
|
||||
char *bb = buff100;
|
||||
bb += sprintf(bb, "\x1b^h;%d;", http_status);
|
||||
const char *comma = "";
|
||||
@@ -160,7 +160,7 @@ d2d_parse_command(char *msg)
|
||||
FIND_NEXT(ip, ';');
|
||||
const char *payload = msg;
|
||||
|
||||
d2d_dbg("D2D Tx,dest=%s,msg=%s", ip, payload);
|
||||
d2d_info("D2D Tx,dest=%s,msg=%s", ip, payload);
|
||||
sprintf(buff40, "http://%s" API_D2D_MSG, ip);
|
||||
|
||||
httpclient_args args;
|
||||
@@ -203,9 +203,8 @@ d2d_parse_command(char *msg)
|
||||
|
||||
FIND_NEXT(params, ';');
|
||||
|
||||
d2d_info("HTTP request");
|
||||
d2d_dbg("Method %s", method);
|
||||
d2d_dbg("Params %s", params);
|
||||
|
||||
size_t max_buf_len = HTTPCLIENT_DEF_MAX_LEN;
|
||||
size_t max_result_len = 0; // 0 = no truncate
|
||||
uint timeout = HTTPCLIENT_DEF_TIMEOUT_MS;
|
||||
@@ -274,7 +273,7 @@ d2d_parse_command(char *msg)
|
||||
request_pending = true;
|
||||
http_request(&args, no_resp ? requestNoopCb : requestCb);
|
||||
|
||||
d2d_dbg("Done");
|
||||
d2d_dbg("Request sent.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -308,7 +307,7 @@ httpd_cgi_state ICACHE_FLASH_ATTR cgiD2DMessage(HttpdConnData *connData)
|
||||
|
||||
sendResponseToUART("\a");
|
||||
|
||||
d2d_dbg("D2D Rx src="IPSTR",len=%d", ip[0], ip[1], ip[2], ip[3],len);
|
||||
d2d_info("D2D Rx src="IPSTR",len=%d", ip[0], ip[1], ip[2], ip[3],len);
|
||||
|
||||
// Received a msg
|
||||
|
||||
|
||||
+1
-16
@@ -617,22 +617,7 @@ httpd_cgi_state ICACHE_FLASH_ATTR tplWlan(HttpdConnData *connData, char *token,
|
||||
}
|
||||
}
|
||||
else if (streq(token, "sta_active_ip")) {
|
||||
x = wifi_get_opmode();
|
||||
connectStatus = wifi_station_get_connect_status();
|
||||
|
||||
if (x == SOFTAP_MODE || connectStatus != STATION_GOT_IP || wificonf->opmode == SOFTAP_MODE) {
|
||||
strcpy(buff, "");
|
||||
}
|
||||
else {
|
||||
struct ip_info info;
|
||||
wifi_get_ip_info(STATION_IF, &info);
|
||||
sprintf(buff, IPSTR, GOOD_IP2STR(info.ip.addr));
|
||||
|
||||
// sprintf(buff, "ip: "IPSTR", mask: "IPSTR", gw: "IPSTR,
|
||||
// GOOD_IP2STR(info.ip.addr),
|
||||
// GOOD_IP2STR(info.netmask.addr),
|
||||
// GOOD_IP2STR(info.gw.addr));
|
||||
}
|
||||
getStaIpAsString(buff);
|
||||
}
|
||||
|
||||
tplSend(connData, buff, -1);
|
||||
|
||||
+7
-7
@@ -74,12 +74,12 @@ static void ICACHE_FLASH_ATTR prHeapTimerCb(void *arg)
|
||||
if (diff == 0) {
|
||||
if (cnt == 5) {
|
||||
// only every 5 secs if no change
|
||||
dbg("Rx: %2d%c, Tx: %2d%c, Hp: %d", rxp, '%', txp, '%', heap);
|
||||
dbg("Rx/Tx: %d/%d%c, Hp: %d", rxp, txp, '%', heap);
|
||||
cnt = 0;
|
||||
}
|
||||
} else {
|
||||
// report change
|
||||
dbg("Rx: %2d%c, Tx: %2d%c, Hp: %d (%s%d)", rxp, '%', txp, '%', heap, cc, diff);
|
||||
dbg("Rx/Tx: %d/%d%c, Hp: %d (%s%d)", rxp, txp, '%', heap, cc, diff);
|
||||
cnt = 0;
|
||||
}
|
||||
|
||||
@@ -131,11 +131,6 @@ void ICACHE_FLASH_ATTR user_init(void)
|
||||
espFsInit((void *) (webpages_espfs_start));
|
||||
#endif
|
||||
|
||||
#if DEBUG_HEAP
|
||||
// Heap use timer & blink
|
||||
TIMER_START(&prHeapTimer, prHeapTimerCb, HEAP_TIMER_MS, 1);
|
||||
#endif
|
||||
|
||||
// do later (some functions do not work if called from user_init)
|
||||
TIMER_START(&userStartTimer, user_start, 10, 0);
|
||||
}
|
||||
@@ -154,6 +149,11 @@ static void ICACHE_FLASH_ATTR user_start(void *unused)
|
||||
// Print the CANCEL character to indicate the module has restarted
|
||||
// Critically important for client application if any kind of screen persistence / content re-use is needed
|
||||
UART_WriteChar(UART0, CAN, UART_TIMEOUT_US); // 0x18 - 24 - CAN
|
||||
|
||||
#if DEBUG_HEAP
|
||||
// Heap use timer & blink
|
||||
TIMER_START(&prHeapTimer, prHeapTimerCb, HEAP_TIMER_MS, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ---- unused funcs removed from sdk to save space ---
|
||||
|
||||
+3
-4
@@ -10,10 +10,9 @@
|
||||
|
||||
#define FW_V_MAJOR 2
|
||||
#define FW_V_MINOR 1
|
||||
#define FW_V_PATCH 0
|
||||
#define FW_V_SUFFIX "-beta3"
|
||||
//#define FW_V_SUFFIX ""
|
||||
#define FW_CODENAME "Anthill" // 2.1.0
|
||||
#define FW_V_PATCH 1
|
||||
#define FW_V_SUFFIX ""
|
||||
#define FW_CODENAME "Anthill" // 2.1
|
||||
#define FW_CODENAME_QUOTED "\""FW_CODENAME"\""
|
||||
|
||||
#define FW_VERSION STR(FW_V_MAJOR) "." STR(FW_V_MINOR) "." STR(FW_V_PATCH) FW_V_SUFFIX
|
||||
|
||||
@@ -8,6 +8,22 @@
|
||||
WiFiConfigBundle * const wificonf = &persist.current.wificonf;
|
||||
WiFiConfChangeFlags wifi_change_flags;
|
||||
|
||||
int ICACHE_FLASH_ATTR getStaIpAsString(char *buffer)
|
||||
{
|
||||
WIFI_MODE x = wifi_get_opmode();
|
||||
STATION_STATUS connectStatus = wifi_station_get_connect_status();
|
||||
|
||||
if (x == SOFTAP_MODE || connectStatus != STATION_GOT_IP || wificonf->opmode == SOFTAP_MODE) {
|
||||
strcpy(buffer, "");
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
struct ip_info info;
|
||||
wifi_get_ip_info(STATION_IF, &info);
|
||||
return sprintf(buffer, IPSTR, GOOD_IP2STR(info.ip.addr));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore defaults in the WiFi config block.
|
||||
* This is to be called if the WiFi config is corrupted on startup,
|
||||
|
||||
@@ -60,6 +60,8 @@ void wifimgr_restore_defaults(void);
|
||||
|
||||
void wifimgr_apply_settings(void);
|
||||
|
||||
int getStaIpAsString(char *buffer);
|
||||
|
||||
#if DEBUG_WIFI
|
||||
#define wifi_warn warn
|
||||
#define wifi_dbg dbg
|
||||
|
||||
Reference in New Issue
Block a user