Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df404f5f63
|
||
|
|
7b8c936559
|
||
|
|
17c18ed1c9
|
||
|
|
274e3b359b
|
||
|
|
73c98eb2d1
|
||
|
|
022e882001
|
||
|
|
dc08512397
|
||
|
|
6c1ab28e75
|
||
|
|
2796709624
|
||
|
|
d2edcd7fd5
|
||
|
|
76272530ec
|
||
|
|
a514601897
|
||
|
|
935e05a56a
|
@@ -170,6 +170,7 @@ add_definitions(
|
||||
-DICACHE_FLASH_ATTR=
|
||||
-DICACHE_RODATA_ATTR=
|
||||
-DFLAG_GZIP=2
|
||||
-DESP_LANG="en"
|
||||
|
||||
-DGIT_HASH_BACKEND="asdf"
|
||||
-DGIT_HASH_FRONTEND="asdf"
|
||||
|
||||
@@ -62,6 +62,10 @@ LIBS = c gcc hal phy pp net80211 wpa main lwip crypto
|
||||
#Add in esphttpd lib
|
||||
LIBS += esphttpd
|
||||
|
||||
ifndef ESP_LANG
|
||||
ESP_LANG = en
|
||||
endif
|
||||
|
||||
# compiler flags using during compilation of source files -ggdb
|
||||
CFLAGS = -Os -std=gnu99 -Werror -Wpointer-arith -Wundef -Wall -Wl,-EL -fno-inline-functions \
|
||||
-nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH \
|
||||
@@ -69,7 +73,7 @@ CFLAGS = -Os -std=gnu99 -Werror -Wpointer-arith -Wundef -Wall -Wl,-EL -fno-inli
|
||||
|
||||
CFLAGS += -DGIT_HASH_BACKEND='"$(shell git rev-parse --short HEAD)"'
|
||||
CFLAGS += -DGIT_HASH_FRONTEND='"$(shell cd front-end && git rev-parse --short HEAD)"'
|
||||
CFLAGS += -D__TIMEZONE__='"$(shell date +%Z)"'
|
||||
CFLAGS += -D__TIMEZONE__='"$(shell date +%Z)"' -DESP_LANG='"$(ESP_LANG)"'
|
||||
|
||||
ifdef GLOBAL_CFLAGS
|
||||
CFLAGS += $(GLOBAL_CFLAGS)
|
||||
@@ -211,19 +215,7 @@ all: checkdirs
|
||||
$(Q) make actual_all -j4 -B
|
||||
|
||||
release:
|
||||
ESP_LANG=cs make web
|
||||
make actual_all -j4
|
||||
cp firmware/0x00000.bin release/0x00000.bin
|
||||
cp firmware/0x40000.bin release/0x40000-CS.bin
|
||||
|
||||
ESP_LANG=en make web
|
||||
make actual_all -j4
|
||||
cp firmware/0x40000.bin release/0x40000-EN.bin
|
||||
|
||||
ESP_LANG=de make web
|
||||
make actual_all -j4
|
||||
cp firmware/0x40000.bin release/0x40000-DE.bin
|
||||
|
||||
$(Q) ./release.sh
|
||||
|
||||
actual_all: parser $(TARGET_OUT) $(FW_BASE)
|
||||
|
||||
|
||||
+1
-1
Submodule front-end updated: 69e5b77447...420353efc9
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Created by MightyPork on 2017/10/03.
|
||||
//
|
||||
// helper for building release packages
|
||||
//
|
||||
// Run with `tcc -run`
|
||||
//
|
||||
|
||||
#include "user/version.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void main() {
|
||||
printf(FW_VERSION);
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
|
||||
+1
-1
Submodule libesphttpd updated: 348420959b...e4ecf0724e
@@ -0,0 +1,21 @@
|
||||
This is a release archive of ESPTerm,
|
||||
the VT100 terminal emulator for ESP8266.
|
||||
|
||||
--------------------------------------------
|
||||
Version: %VERS%
|
||||
Locale : %LANG%
|
||||
Built : %DATETIME%
|
||||
--------------------------------------------
|
||||
|
||||
Source repository:
|
||||
https://github.com/espterm/espterm-firmware
|
||||
|
||||
Report any bugs to our bug-tracker at
|
||||
https://github.com/espterm/espterm-firmware/issues
|
||||
or send them to out mailing list
|
||||
espterm-dev@googlegroups.com
|
||||
|
||||
On-line demo is available at
|
||||
https://espterm.github.io/term.html
|
||||
|
||||
[EOF]
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The parameters ESPTOOL, ESPPORT and ESPBAUD can be customized
|
||||
# - export your preferred values in .bashrc
|
||||
|
||||
echo -e "\e[32;1mFlashing ESPTerm %VERS% (%LANG%)\e[0m"
|
||||
|
||||
if [ -z ${ESPTOOL} ]; then
|
||||
ESPTOOL='esptool'
|
||||
which ${ESPTOOL} &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
ESPTOOL='esptool.py'
|
||||
which ${ESPTOOL} &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e '\e[31;1mesptool not found!\e[0m'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -z ESPPORT ] && ESPPORT=/dev/ttyUSB0
|
||||
[ -z ESPBAUD ] && ESPBAUD=460800
|
||||
|
||||
set -x
|
||||
${ESPTOOL} --port ${ESPPORT} --baud ${ESPBAUD} \
|
||||
write_flash 0x00000 '%FILE0%' 0x40000 '%FILE4%'
|
||||
@@ -1,2 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!flash-tpl.sh
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
vers=$(tcc -run get_version.c)
|
||||
else
|
||||
vers=$1
|
||||
fi
|
||||
|
||||
git pull
|
||||
|
||||
echo -n -e "\e[1;36mBuilding packages for version $vers\e[0m"
|
||||
|
||||
cd front-end
|
||||
git pull
|
||||
cd ..
|
||||
|
||||
function buildlang() {
|
||||
lang=$1
|
||||
|
||||
echo -e "\n\e[33;1m------ Building \"${lang}\" package ------\e[0m\n"
|
||||
|
||||
make clean
|
||||
ESP_LANG=${lang} make web
|
||||
ESP_LANG=${lang} make actual_all -B -j4
|
||||
|
||||
cd release
|
||||
|
||||
destdir="$vers-$lang"
|
||||
file0=${vers}-0x00000-${lang}.bin
|
||||
file4=${vers}-0x40000-${lang}.bin
|
||||
[ -e ${destdir} ] && rm -r ${destdir}
|
||||
mkdir ${destdir}
|
||||
cp ../firmware/0x00000.bin ${destdir}/${file0}
|
||||
cp ../firmware/0x40000.bin ${destdir}/${file4}
|
||||
|
||||
flashsh=${destdir}/flash.sh
|
||||
cp ../rel-tpl/flash.sh ${flashsh}
|
||||
sed -i s/%FILE0%/${file0}/ ${flashsh}
|
||||
sed -i s/%FILE4%/${file4}/ ${flashsh}
|
||||
sed -i s/%VERS%/${vers}/ ${flashsh}
|
||||
sed -i s/%LANG%/${lang}/ ${flashsh}
|
||||
chmod +x ${flashsh}
|
||||
|
||||
readmefil=${destdir}/README.txt
|
||||
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')
|
||||
sed -i "s#%DATETIME%#${dt}#" ${readmefil}
|
||||
unix2dos ${readmefil}
|
||||
|
||||
cd ${destdir}
|
||||
sha256sum ${file0} ${file4} README.txt flash.sh > checksums.txt
|
||||
cd ..
|
||||
|
||||
targetfile=espterm-${vers}-${lang}.zip
|
||||
[[ -e ${targetfile}.zip ]] && rm ${targetfile}.zip
|
||||
pwd
|
||||
zip -9 ${targetfile} ${destdir}/*
|
||||
cd ..
|
||||
}
|
||||
|
||||
if [ -z "$ESP_LANG" ]; then
|
||||
buildlang cs
|
||||
buildlang en
|
||||
buildlang de
|
||||
else
|
||||
buildlang ${ESP_LANG}
|
||||
fi
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "version.h"
|
||||
#include "uart_buffer.h"
|
||||
#include "screen.h"
|
||||
#include "uart_driver.h"
|
||||
#include "wifimgr.h"
|
||||
|
||||
volatile bool enquiry_suppressed = false;
|
||||
ETSTimer enqTimer;
|
||||
@@ -27,8 +27,8 @@ void ICACHE_FLASH_ATTR enqTimerCb(void *unused)
|
||||
void ICACHE_FLASH_ATTR
|
||||
apars_respond(const char *str)
|
||||
{
|
||||
UART_WriteString(UART0, str, UART_TIMEOUT_US);
|
||||
//UART_SendAsync(str, -1);
|
||||
// Using the Tx buffer causes issues with large data (eg. from http requests)
|
||||
UART_SendAsync(str, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,8 +48,24 @@ apars_handle_enq(void)
|
||||
{
|
||||
if (enquiry_suppressed) return;
|
||||
|
||||
u8 mac[6];
|
||||
wifi_get_macaddr(SOFTAP_IF, mac);
|
||||
|
||||
char buf100[100];
|
||||
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("\x1bXESPTerm " FIRMWARE_VERSION "\x1b\\");
|
||||
apars_respond(buf100);
|
||||
|
||||
// Throttle enquiry - this is a single-character-invoked response,
|
||||
// so it tends to happen randomly when throwing garbage at the ESP.
|
||||
|
||||
+25
-17
@@ -7,13 +7,14 @@
|
||||
#include "version.h"
|
||||
#include "ansi_parser_callbacks.h"
|
||||
#include "api.h"
|
||||
#include "uart_driver.h"
|
||||
#include <httpclient.h>
|
||||
#include <esp_utils.h>
|
||||
|
||||
#define D2D_TIMEOUT_MS 2000
|
||||
|
||||
#define D2D_HEADERS \
|
||||
"User-Agent: ESPTerm "FIRMWARE_VERSION" like curl wget HTTPie\r\n" \
|
||||
"User-Agent: ESPTerm "VERSION_STRING" like curl wget HTTPie\r\n" \
|
||||
"Content-Type: text/plain; charset=utf-8\r\n" \
|
||||
"Accept-Encoding: identity\r\n" \
|
||||
"Accept-Charset: utf-8\r\n" \
|
||||
@@ -29,6 +30,14 @@ struct d2d_request_opts {
|
||||
|
||||
volatile bool request_pending = false;
|
||||
|
||||
// NOTE! We bypass the async buffer here - used for user input and
|
||||
// responses to queries {apars_respond()}. In rare situations this could
|
||||
// lead to a race condition and mixing two different messages
|
||||
static inline void ICACHE_FLASH_ATTR sendResponseToUART(const char *str)
|
||||
{
|
||||
UART_WriteString(UART0, str, UART_TIMEOUT_US);
|
||||
}
|
||||
|
||||
static void ICACHE_FLASH_ATTR
|
||||
requestNoopCb(int http_status,
|
||||
char *response_headers,
|
||||
@@ -54,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;
|
||||
|
||||
@@ -68,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 = "";
|
||||
@@ -95,7 +104,7 @@ requestCb(int http_status,
|
||||
// semicolon only if more data is to be sent
|
||||
if (opts->want_head || opts->want_body) sprintf(bb, ";");
|
||||
|
||||
apars_respond(buff100);
|
||||
sendResponseToUART(buff100);
|
||||
|
||||
//d2d_dbg("Headers (part) %100s", response_headers);
|
||||
//d2d_dbg("Body (part) %100s", response_body);
|
||||
@@ -107,8 +116,8 @@ requestCb(int http_status,
|
||||
response_headers[len] = 0;
|
||||
opts->want_body = false; // soz, it wouldn't fit
|
||||
}
|
||||
apars_respond(response_headers);
|
||||
if(opts->want_body) apars_respond("\r\n");
|
||||
sendResponseToUART(response_headers);
|
||||
if(opts->want_body) sendResponseToUART("\r\n");
|
||||
}
|
||||
|
||||
if(opts->want_body) {
|
||||
@@ -117,10 +126,10 @@ requestCb(int http_status,
|
||||
response_body[len - (opts->want_head*(headers_size+2))] = 0;
|
||||
}
|
||||
|
||||
apars_respond(response_body);
|
||||
sendResponseToUART(response_body);
|
||||
}
|
||||
|
||||
apars_respond("\a");
|
||||
sendResponseToUART("\a");
|
||||
|
||||
free(opts->nonce);
|
||||
free(opts);
|
||||
@@ -151,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;
|
||||
@@ -194,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;
|
||||
@@ -265,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;
|
||||
}
|
||||
|
||||
@@ -290,16 +298,16 @@ httpd_cgi_state ICACHE_FLASH_ATTR cgiD2DMessage(HttpdConnData *connData)
|
||||
u8 *ip = connData->remote_ip;
|
||||
char buf[20];
|
||||
sprintf(buf, "\x1b^m;"IPSTR";L=%d;", ip[0], ip[1], ip[2], ip[3], (int)len);
|
||||
apars_respond(buf);
|
||||
sendResponseToUART(buf);
|
||||
|
||||
if (connData->post && connData->post->buff)
|
||||
apars_respond(connData->post->buff);
|
||||
sendResponseToUART(connData->post->buff);
|
||||
else if (connData->getArgs)
|
||||
apars_respond(connData->getArgs);
|
||||
sendResponseToUART(connData->getArgs);
|
||||
|
||||
apars_respond("\a");
|
||||
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
-1
@@ -44,7 +44,7 @@ tplAbout(HttpdConnData *connData, char *token, void **arg)
|
||||
if (token == NULL) return HTTPD_CGI_DONE;
|
||||
|
||||
if (streq(token, "vers_fw")) {
|
||||
tplSend(connData, FIRMWARE_VERSION, -1);
|
||||
tplSend(connData, VERSION_STRING, -1);
|
||||
}
|
||||
else if (streq(token, "date")) {
|
||||
tplSend(connData, __DATE__, -1);
|
||||
|
||||
+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);
|
||||
|
||||
@@ -52,6 +52,7 @@ void ICACHE_FLASH_ATTR UART_Init(void)
|
||||
|
||||
// U0RXD
|
||||
PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD);
|
||||
PIN_PULLUP_DIS(PERIPHS_IO_MUX_U0RXD_U);
|
||||
|
||||
// U1TXD (GPIO2)
|
||||
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U, FUNC_U1TXD_BK);
|
||||
|
||||
+23
-15
@@ -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;
|
||||
}
|
||||
|
||||
@@ -104,14 +104,22 @@ void ICACHE_FLASH_ATTR user_init(void)
|
||||
wifi_station_set_auto_connect(false);
|
||||
wifi_set_opmode(NULL_MODE); // saves to flash if changed - this might avoid the current spike on startup?
|
||||
|
||||
printf("\r\n");
|
||||
banner("====== ESPTerm ======");
|
||||
banner_info("Firmware (c) Ondrej Hruska, 2017");
|
||||
banner_info(TERMINAL_GITHUB_REPO);
|
||||
banner_info("");
|
||||
banner_info("Version "FIRMWARE_VERSION",");
|
||||
u8 mac[6];
|
||||
wifi_get_macaddr(SOFTAP_IF, mac);
|
||||
|
||||
banner_gap();
|
||||
banner("================ ESPTerm ================");
|
||||
banner_info();
|
||||
banner_info("Project by Ondrej Hruska, 2017");
|
||||
banner_info();
|
||||
banner_info(TERMINAL_GITHUB_REPO_NOPROTO);
|
||||
banner_info();
|
||||
banner_info("Version "FW_VERSION" ("ESP_LANG"), code name "FW_CODENAME_QUOTED);
|
||||
banner_info(" back-end #"GIT_HASH_BACKEND" front-end #"GIT_HASH_FRONTEND);
|
||||
banner_info(" built "__DATE__" at "__TIME__" "__TIMEZONE__);
|
||||
printf("\r\n");
|
||||
banner_info();
|
||||
banner_info("Device ID: %02X%02X%02X", mac[3], mac[4], mac[5]);
|
||||
banner_gap();
|
||||
|
||||
ioInit();
|
||||
|
||||
@@ -123,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);
|
||||
}
|
||||
@@ -139,13 +142,18 @@ static void ICACHE_FLASH_ATTR user_start(void *unused)
|
||||
|
||||
captdnsInit();
|
||||
httpdInit(routes, 80);
|
||||
httpdSetName("ESPTerm " FIRMWARE_VERSION);
|
||||
httpdSetName("ESPTerm " VERSION_STRING);
|
||||
|
||||
ansi_parser_inhibit = false;
|
||||
|
||||
// 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 ---
|
||||
|
||||
+14
-5
@@ -5,16 +5,25 @@
|
||||
#ifndef ESP_VT100_FIRMWARE_VERSION_H
|
||||
#define ESP_VT100_FIRMWARE_VERSION_H
|
||||
|
||||
#include "helpers.h"
|
||||
#define STR_HELPER(x) #x
|
||||
#define STR(x) STR_HELPER(x)
|
||||
|
||||
#define FW_V_MAJOR 2
|
||||
#define FW_V_MINOR 1
|
||||
#define FW_V_PATCH 0
|
||||
#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
|
||||
|
||||
#define VERSION_STRING FW_VERSION " " FW_CODENAME_QUOTED
|
||||
|
||||
#define FIRMWARE_VERSION STR(FW_V_MAJOR) "." STR(FW_V_MINOR) "." STR(FW_V_PATCH) " \"" FW_CODENAME "\""
|
||||
#define FIRMWARE_VERSION_NUM (FW_V_MAJOR*1000 + FW_V_MINOR*10 + FW_V_PATCH) // this is used in ID queries
|
||||
#define TERMINAL_GITHUB_REPO "https://github.com/espterm/espterm-firmware"
|
||||
|
||||
#define TERMINAL_GITHUB_REPO_NOPROTO "github.com/espterm/espterm-firmware"
|
||||
#define TERMINAL_GITHUB_REPO "https://"TERMINAL_GITHUB_REPO_NOPROTO
|
||||
|
||||
#define TERMINAL_GITHUB_REPO_FRONT "https://github.com/espterm/espterm-front-end"
|
||||
|
||||
#endif //ESP_VT100_FIRMWARE_VERSION_H
|
||||
|
||||
@@ -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