Fix ESP8266 eFuseMac result

This commit is contained in:
Theo Arends 2024-01-28 17:34:15 +01:00
parent af9d4cadd8
commit 886b453e69
6 changed files with 51 additions and 115 deletions

View File

@ -2,30 +2,24 @@
// compressed by tools/unishox/compress-html-uncompressed.py
/////////////////////////////////////////////////////////////////////
const size_t HTTP_GV_PAGE_SIZE = 806;
const char HTTP_GV_PAGE_COMPRESSED[] PROGMEM = "\x3D\x0F\xE1\x10\x98\x1D\x19\x0C\x64\x88\x51\x51\x0D\x20\x8F\xC3\xD0\x55\x0D\x08"
"\xFC\x3D\x05\x3B\x10\xFC\x3D\x2B\x68\x26\x7E\x1F\x5E\x47\x5A\x21\xE2\x18\x5A\x58"
"\x88\xCF\x58\xFB\xF9\xE8\x76\x02\x0D\x43\xD0\x75\xF9\xA1\x5F\x66\x0F\x87\xD9\xF5"
"\xE3\xEC\xFC\x3D\x02\xDE\x34\x5A\x21\xF0\xFB\x11\x98\xB1\x61\x51\x7A\x8C\x82\x65"
"\xE1\x4D\xD1\xF6\xBE\xC2\x3E\x1F\x7E\xA3\x20\x9F\x81\x06\x68\x20\xE2\x80\x8F\x89"
"\x0E\xCB\xF8\x80\xC1\xB1\x0F\xB0\x8F\x87\xDE\x87\x9C\x08\x75\x4C\x59\x9E\x87\x9C"
"\x74\xD0\xF0\xFB\x54\x64\x31\x9F\x0F\xBD\x1B\x63\xCC\xEC\x36\x1D\x7A\x1E\x71\xF6"
"\x7E\x1E\x9E\x0F\xFA\x32\x97\xBE\x19\xF0\xFB\x04\x19\x07\x60\xFB\x1C\x5E\xC0\xCD"
"\x1D\x1D\x0D\x7E\x3E\xCF\xC3\xD0\xEC\x04\x1A\x60\xA1\x83\x82\x0E\xFA\x3F\xB4\x18"
"\xA7\xF0\x50\xC2\xCF\xC3\x3B\xFA\xF3\xF9\x9B\xF9\x0C\xCF\xD1\xF0\xFA\x10\xF0\x67"
"\x7F\x5A\x30\xF8\x7D\x9F\x5E\x3E\xCF\x06\x77\xF5\xEC\x17\xF0\xD9\xF3\x98\xFA\x26"
"\x66\xFA\x8B\xD8\x2F\xE1\xB3\xBA\x7D\x8A\xAA\x18\x79\x9D\x87\x61\xF5\xE3\xCC\xFA"
"\x10\xEC\x66\x6F\xAB\xC7\xD9\xDE\x04\x1C\x3A\xC6\x8C\x0B\x78\x78\xFD\xEF\x53\xF9"
"\x9D\x84\x7C\x3E\xCF\xA1\x01\x07\x29\x19\xEF\xD8\xD2\xF6\x9B\x59\xF0\xFB\x3E\x84"
"\x44\x68\x43\x81\x06\x91\x8F\xB6\x5E\x34\x74\x18\xA2\xF0\xCB\x0C\x11\x6C\x02\x2F"
"\x01\x47\x60\x20\xF2\x78\x3B\x04\x32\x3F\x0F\x41\x34\xCD\x06\x15\xFB\xC7\xC3\xEC"
"\x7B\xFA\x21\xD6\x1E\x75\x5E\xF3\xF9\xF6\x08\x36\x34\x43\xE1\xF6\x35\xFB\xD6\x3C"
"\xC8\x76\x1B\x0F\xB0\x43\xC2\x01\x0A\x79\xD6\x3B\x0D\x88\x56\x88\x23\xE3\xEC\xFC"
"\x3D\x0E\xC1\x34\xCC\x10\x79\x9A\x7F\x04\x3C\x14\x10\x65\x1F\x60\x85\xA9\x3F\x82"
"\x46\x9D\xA3\x6C\x79\x82\x86\x9F\xA3\x6C\x79\x90\xFF\xEC\x60\xC7\xF0\x44\xD4\x41"
"\x07\x0B\x1F\x04\x2A\x2B\x47\xE1\xE9\xA3\x47\x81\x17\x99\x82\xD1\xB6\x3C\xCF\xB0"
"\x41\xE4\x3C\xFB\x56\x15\x1F\x0F\xB2\x1D\x97\xF1\x10\x20\xD5\x04\x6C\xDF\x84\xD0"
"\xEE\xB3\xFE\x04\x4E\x03\xC1\x06\x10\x23\xC8\x3B\x01\x07\x87\xA3\xB0\x55\x0D\x08"
"\xFC";
const size_t HTTP_GV_PAGE_SIZE = 465;
const char HTTP_GV_PAGE_COMPRESSED[] PROGMEM = "\x3D\x0F\xE1\x10\x98\x1D\x19\x0C\x64\x85\x50\xD0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F0\xCD"
"\xC3\xF7\xE7\x55\xBC\x3D\xE4\x7C\x47\xB7\x46\x1E\x67\xD9\xF5\xE3\xEC\xEA\x19\x9F"
"\xA3\xCC\xFB\x3E\x84\x3E\xCE\xA3\x1F\x6C\xBC\x68\xE8\x31\x45\xFB\x1A\x79\x9F\x67"
"\xD0\x88\x8D\x08\x71\xF6\x7B\x8F\x2A\x01\x8B\xC0\x49\xD8\x08\x3A\x49\xD8\x2A\x2B"
"\x86\x84\x7E\x1B";
#define HTTP_GV_PAGE Decompress(HTTP_GV_PAGE_COMPRESSED,HTTP_GV_PAGE_SIZE).c_str()

View File

@ -1,25 +0,0 @@
/////////////////////////////////////////////////////////////////////
// compressed by tools/unishox/compress-html-uncompressed.py
/////////////////////////////////////////////////////////////////////
const size_t HTTP_GV_PAGE_SIZE = 465;
const char HTTP_GV_PAGE_COMPRESSED[] PROGMEM = "\x3D\x0F\xE1\x10\x98\x1D\x19\x0C\x64\x85\x50\xD0\x8F\xC3\xD0\x55\x0D\x09\x05\x7C"
"\x3C\x7C\x3E\xDF\x1F\x67\xE1\xE8\x29\xD8\x87\xE1\xE9\x5B\x41\x33\xF0\xFA\xF2\x3A"
"\xD1\x0F\x10\xC2\xD2\xC4\x46\x7A\xC7\xDF\xCF\x43\xB0\x10\x6A\x1E\x83\x5D\x5A\x0C"
"\x55\xFF\xCE\x8F\x87\xD9\x0B\x2A\x2B\x23\x07\x59\xCF\x9F\x67\xE1\xE8\x43\xAF\xCD"
"\x0A\xFB\x30\x7C\x3E\xCF\xAF\x1F\x67\xE1\xE8\x16\xF1\xA2\xFB\x08\xF8\x7D\xE8\x79"
"\xC7\xD8\x21\x57\x31\x66\x7A\x1E\x71\xD3\x43\xC3\xEC\x10\xB2\x6E\xB1\xAC\xF8\x7D"
"\x99\xEB\x1F\x19\x9F\xA3\xED\x07\x9D\x4F\xA8\xF8\x7D\x8F\xE8\x94\x28\xF8\x23\x33"
"\xD0\xD9\xD6\x3F\xA2\x50\xA3\xA9\x6F\x6D\x6D\x84\x75\xF8\x3B\x09\x9F\x0E\x43\xA3"
"\x3E\xCF\xC3\xD0\xBC\x1F\xF4\x65\x2A\x2B\x32\x18\xCF\x87\xD8\xDC\x10\x58\x4C\xFB"
"\x41\xFF\x3D\xEC\xFE\x8F\x6F\x2F\x7C\x33\xE1\xF6\x43\xC4\x30\xB4\xB0\x10\x78\x25"
"\x23\x31\x6C\xE8\x6B\xF1\xF6\x7E\x1E\x87\x60\x20\xE2\xC0\x8F\xC0\x47\xA8\xC8\x27"
"\xE1\x4D\xD0\x24\xE3\xE0\x83\xC0\xD5\xFB\xCE\xBC\x76\x0D\xBD\xE3\xA0\x7E\xF1\xF6"
"\x7E\x1E\x87\x60\x20\xF1\x1C\x3B\x04\x32\x3F\x0F\x41\x34\xCD\x68\x87\xC3\xEE\xC6"
"\x0C\x3E\xCF\xC3\xD0\xEC\x13\x4C\xC1\x0F\x79\x3F\x07\xF7\x84\xC1\xF3\xA0\xF0\xCD"
"\xC3\xF7\xE7\x55\xBC\x3D\xE4\x7C\x47\xB7\x46\x1E\x67\xD9\xF5\xE3\xEC\xEA\x19\x9F"
"\xA3\xCC\xFB\x3E\x84\x3E\xCE\xA3\x1F\x6C\xBC\x68\xE8\x31\x45\xFB\x1A\x79\x9F\x67"
"\xD0\x88\x8D\x08\x71\xF6\x7B\x8F\x2A\x01\x8B\xC0\x49\xD8\x08\x3A\x49\xD8\x2A\x2B"
"\x86\x84\x7E\x1B";
#define HTTP_GV_PAGE Decompress(HTTP_GV_PAGE_COMPRESSED,HTTP_GV_PAGE_SIZE).c_str()

View File

@ -1,33 +1,24 @@
const char HTTP_GV_PAGE[] PROGMEM =
"<!DOCTYPE HTML>"
"<html>"
"<head>"
"<!DOCTYPE html>"
"<html lang='en'>"
"<head>"
"<title>%s - GPIO Viewer</title>" // SettingsTextEscaped(SET_DEVICENAME).c_str()
"<meta charset='UTF-8'>"
"<base href='%s'>" // GV_BASE_URL
"<link id='defaultStyleSheet' rel='stylesheet' href=''>"
"<link id='boardStyleSheet' rel='stylesheet' href=''>"
"<link rel='icon' href='favicon.ico' type='image/x-icon'>"
"<script src='script/webSocket.js'></script>"
"<script src='script/boardSwitcher.js'></script>"
"<script>"
"var serverPort=%d;" // GV_PORT
"var ip='%s';" // WiFi.localIP().toString().c_str()
"var source=new EventSource('http://%s:%d/events');" // WiFi.localIP().toString().c_str(), GV_PORT
"var sampling_interval='%d';" // Gv.sampling
"var psramSize='%d KB';" // ESP.getPsramSize() / 1024
"var freeSketchSpace='%d KB';" // ESP_getFreeSketchSpace() / 1024
"<link rel='icon' href='favicon.ico'>"
"<meta name='viewport' content='width=device-width, initial-scale=1.0'>"
"<script type='module' crossorigin src='GPIOViewerVue.js'>"
"</script>"
"<link rel='stylesheet' crossorigin href='assets/main.css'>"
"</head>"
"<body>"
"<div class='grid-container'>"
"<div id='messageBox' class='message-box hidden'></div>"
"<header class='header'></header>"
"<div class='image-container'>"
"<div id='imageWrapper' class='image-wrapper'>"
"<img id='boardImage' src='' alt='Board Image'>"
"<div id='indicators'></div>"
"</div>"
"</div>"
"</div>"
"<div id='app'></div>"
"<script>"
"window.gpio_settings = {"
"ip:'%s'," // WiFi.localIP().toString().c_str()
"port:'%d'," // GV_PORT
"freeSketchRam:'%d KB'" // ESP_getFreeSketchSpace() / 1024
"};"
"</script>"
"</body>"
"</html>";

View File

@ -1,24 +0,0 @@
const char HTTP_GV_PAGE[] PROGMEM =
"<!DOCTYPE html>"
"<html lang='en'>"
"<head>"
"<title>%s - GPIO Viewer</title>" // SettingsTextEscaped(SET_DEVICENAME).c_str()
"<meta charset='UTF-8'>"
"<base href='%s'>" // GV_BASE_URL
"<link rel='icon' href='favicon.ico'>"
"<meta name='viewport' content='width=device-width, initial-scale=1.0'>"
"<script type='module' crossorigin src='GPIOViewerVue.js'>"
"</script>"
"<link rel='stylesheet' crossorigin href='assets/main.css'>"
"</head>"
"<body>"
"<div id='app'></div>"
"<script>"
"window.gpio_settings = {"
"ip:'%s'," // WiFi.localIP().toString().c_str()
"port:'%d'," // GV_PORT
"freeSketchRam:'%d KB'" // ESP_getFreeSketchSpace() / 1024
"};"
"</script>"
"</body>"
"</html>";

View File

@ -229,25 +229,24 @@ String ESP_getEfuseMac(void) {
uint32_t mac0 = *(uint32_t*)(0x3FF00050);
uint32_t mac1 = *(uint32_t*)(0x3FF00054);
uint32_t mac3 = *(uint32_t*)(0x3FF0005C);
uint32_t mach = 0;
uint32_t macl = 0;
if (mac3 != 0) {
mach = ((mac3 >> 16) & 0xFF) << 16;
mach |= ((mac3 >> 8) & 0xFF) << 8;
mach |= mac3 & 0xFF;
macl = (mac3 >> 16) & 0xFF;
macl |= ((mac3 >> 8) & 0xFF) << 8;
macl |= (mac3 & 0xFF) << 16;
}
else if (((mac1 >> 16) & 0xFF) == 0) {
mach = 0x18FE34;
macl = 0x34FE18;
}
else if (((mac1 >> 16) & 0xFF) == 1) {
mach = 0xACD074;
macl = 0x74D0AC;
}
String macStr = "";
if (mach > 0) {
macl = ((mac1 >> 8) & 0xFF) << 16;
macl |= (mac1 & 0xFF) << 8;
macl |= (mac0 >> 24) & 0xFF;
if (macl > 0) {
mach = (mac1 >> 8) & 0xFF;
mach |= (mac1 & 0xFF) << 8;
mach |= ((mac0 >> 24) & 0xFF) << 16;
uint64_t maca = ((uint64_t)mach << 24) | macl;
// Need uint64ToString with base 10 as ESP8266 WStrings does not support uint64_t

View File

@ -42,9 +42,9 @@
const char *GVRelease = "1.5.0";
#ifdef USE_UNISHOX_COMPRESSION
#include "./html_compressed/HTTP_GV_PAGE_150.h"
#include "./html_compressed/HTTP_GV_PAGE.h"
#else
#include "./html_uncompressed/HTTP_GV_PAGE_150.h"
#include "./html_uncompressed/HTTP_GV_PAGE.h"
#endif
const char HTTP_GV_EVENT[] PROGMEM =
@ -164,7 +164,7 @@ void GVHandleFreePSRam(void) {
}
void GVHandleSampling(void) {
String jsonResponse = "{\"sampling\": \"" + String(GV.sampling) + "\"}";
String jsonResponse = "{\"sampling\":\"" + String(GV.sampling) + "\"}";
GVWebserverSendJson(jsonResponse);
}
@ -265,7 +265,8 @@ void GVEventDisconnected(void) {
}
void GVCloseEvent(void) {
GVEventSend("{}", "close", millis()); // Closes web page
// GVEventSend("{}", "close", millis()); // Closes web page
GVEventSend("{}", "error", millis()); // Closes web page
GVEventDisconnected();
}