Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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...01148465b7
@@ -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
-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 %Z')
|
||||
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,6 @@
|
||||
#include "version.h"
|
||||
#include "uart_buffer.h"
|
||||
#include "screen.h"
|
||||
#include "uart_driver.h"
|
||||
|
||||
volatile bool enquiry_suppressed = false;
|
||||
ETSTimer enqTimer;
|
||||
@@ -27,8 +26,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 +47,14 @@ apars_handle_enq(void)
|
||||
{
|
||||
if (enquiry_suppressed) return;
|
||||
|
||||
u8 mac[6];
|
||||
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]);
|
||||
|
||||
// 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.
|
||||
|
||||
+19
-10
@@ -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,
|
||||
@@ -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);
|
||||
@@ -290,14 +299,14 @@ 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);
|
||||
|
||||
|
||||
+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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
+16
-8
@@ -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();
|
||||
|
||||
@@ -139,7 +147,7 @@ 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;
|
||||
|
||||
|
||||
+13
-3
@@ -5,16 +5,26 @@
|
||||
#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_V_SUFFIX "-beta3"
|
||||
//#define FW_V_SUFFIX ""
|
||||
#define FW_CODENAME "Anthill" // 2.1.0
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user