mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
BBQKees board settings/fuse, remove esp32 cpu temperature, dev17
This commit is contained in:
@@ -15,6 +15,10 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
|
||||
- charging pump [#2544](https://github.com/emsesp/EMS-ESP32/issues/2544)
|
||||
- Hybrid CSH5800iG [#2569](https://github.com/emsesp/EMS-ESP32/issues/2569)
|
||||
- Add EMS Device details to Home Assistant MQTT Discovery
|
||||
- Internal sensors of E32V2_2
|
||||
- FW200 display options
|
||||
- CR11 mode settings OFF/MANUAL depends on selTemp
|
||||
- Fuse settings for BBQKees boards
|
||||
|
||||
## Fixed
|
||||
|
||||
@@ -34,3 +38,4 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
|
||||
## Changed
|
||||
|
||||
- show console log with ISO date/time [#2533](https://github.com/emsesp/EMS-ESP32/discussions/2533)
|
||||
- remove ESP32 CPU temperature
|
||||
|
||||
@@ -32,36 +32,36 @@
|
||||
"async-validator": "^4.2.5",
|
||||
"formidable": "^3.5.4",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"magic-string": "^0.30.17",
|
||||
"magic-string": "^0.30.18",
|
||||
"mime-types": "^3.0.1",
|
||||
"preact": "^10.27.0",
|
||||
"preact": "^10.27.1",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-icons": "^5.5.0",
|
||||
"react-router": "^7.8.0",
|
||||
"react-router": "^7.8.2",
|
||||
"react-toastify": "^11.0.5",
|
||||
"typesafe-i18n": "^5.26.2",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.0",
|
||||
"@eslint/js": "^9.33.0",
|
||||
"@babel/core": "^7.28.3",
|
||||
"@eslint/js": "^9.34.0",
|
||||
"@preact/compat": "^18.3.1",
|
||||
"@preact/preset-vite": "^2.10.2",
|
||||
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
||||
"@types/node": "^24.2.1",
|
||||
"@types/react": "^19.1.10",
|
||||
"@types/react-dom": "^19.1.7",
|
||||
"concurrently": "^9.2.0",
|
||||
"eslint": "^9.33.0",
|
||||
"@types/node": "^24.3.0",
|
||||
"@types/react": "^19.1.12",
|
||||
"@types/react-dom": "^19.1.8",
|
||||
"concurrently": "^9.2.1",
|
||||
"eslint": "^9.34.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"prettier": "^3.6.2",
|
||||
"rollup-plugin-visualizer": "^6.0.3",
|
||||
"terser": "^5.43.1",
|
||||
"typescript-eslint": "^8.39.1",
|
||||
"vite": "^7.1.2",
|
||||
"typescript-eslint": "^8.41.0",
|
||||
"vite": "^7.1.3",
|
||||
"vite-plugin-imagemin": "^0.6.1",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
},
|
||||
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
|
||||
"packageManager": "pnpm@10.15.0"
|
||||
}
|
||||
|
||||
1034
interface/pnpm-lock.yaml
generated
1034
interface/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -109,7 +109,7 @@ board_build.filesystem = littlefs
|
||||
lib_deps =
|
||||
bblanchon/ArduinoJson @ 7.4.2
|
||||
ESP32Async/AsyncTCP @ 3.4.7
|
||||
ESP32Async/ESPAsyncWebServer @ 3.7.10
|
||||
ESP32Async/ESPAsyncWebServer @ 3.8.0
|
||||
https://github.com/emsesp/EMS-ESP-Modules.git @ 1.0.8
|
||||
|
||||
;
|
||||
|
||||
@@ -302,7 +302,7 @@ static void setup_commands(std::shared_ptr<Commands> const & commands) {
|
||||
std::vector<int8_t> data; // led, dallas, rx, tx, button, phy_type, eth_power, eth_phy_addr, eth_clock_mode
|
||||
std::string board_profile = Helpers::toUpper(arguments.front());
|
||||
if (!EMSESP::system_.load_board_profile(data, board_profile)) {
|
||||
shell.println("Invalid board profile (S32, E32, E32V2, E32V3, MH-ET, NODEMCU, LOLIN, OLIMEX, OLIMEXPOE, C3MINI, S2MINI, S3MINI, S32S3, CUSTOM)");
|
||||
shell.println("Invalid board profile (S32, E32, E32V2, E32V2_2, MH-ET, NODEMCU, LOLIN, OLIMEX, OLIMEXPOE, C3MINI, S2MINI, S3MINI, S32S3, CUSTOM)");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ void System::reload_settings() {
|
||||
// See https://diyprojects.io/esp32-how-to-use-gpio-digital-io-arduino-code/#.YFpVEq9KhjG
|
||||
// and https://nodemcu.readthedocs.io/en/dev-esp32/modules/gpio/
|
||||
bool System::is_valid_gpio(uint8_t pin, bool has_psram) {
|
||||
#if CONFIG_IDF_TARGET_ESP32 || EMSESP_STANDALONE
|
||||
#if CONFIG_IDF_TARGET_ESP32 || defined(EMSESP_STANDALONE)
|
||||
if ((pin == 1) || (pin >= 6 && pin <= 11) || (pin == 20) || (pin == 24) || (pin >= 28 && pin <= 31) || (pin > 40)
|
||||
|| ((EMSESP::system_.PSram() > 0 || has_psram) && pin >= 16 && pin <= 17)) {
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
@@ -791,10 +791,7 @@ void System::system_check() {
|
||||
last_system_check_ = uuid::get_uptime();
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
uint8_t raw = temprature_sens_read();
|
||||
temperature_ = (raw - 32) / 1.8f; // convert to Celsius
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2
|
||||
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2
|
||||
#if ESP_IDF_VERSION_MAJOR < 5
|
||||
temp_sensor_read_celsius(&temperature_);
|
||||
#else
|
||||
@@ -1433,9 +1430,18 @@ bool System::command_service(const char * cmd, const char * value) {
|
||||
int n;
|
||||
if (!ok && Helpers::value2number(value, n)) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (!strcmp(cmd, "fuse/mfg")) { // && esp_efuse_read_reg(EFUSE_BLK3, 0) == 0) {
|
||||
if (!strcmp(cmd, "fuse/mfg")) {
|
||||
ok = esp_efuse_write_reg(EFUSE_BLK3, 0, (uint32_t)n) == ESP_OK;
|
||||
LOG_INFO("fuse programed with value '%X': %s", n, ok ? "successful" : "failed");
|
||||
ok ? LOG_INFO("fuse programed with value '%X': successful", n) : LOG_ERROR("fuse programed with value '%X': failed", n);
|
||||
|
||||
}
|
||||
if (!strcmp(cmd, "fuse/mfgadd")) {
|
||||
uint8_t reg = 0;
|
||||
while (esp_efuse_read_reg(EFUSE_BLK3, reg) != 0 && reg < 7)
|
||||
reg++;
|
||||
ok = esp_efuse_write_reg(EFUSE_BLK3, reg, (uint32_t)n) == ESP_OK;
|
||||
ok ? LOG_INFO("fuse %d programed with value '%X': successful", reg, n) : LOG_ERROR("fuse %d programed with value '%X': failed", reg, n);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1532,12 +1538,12 @@ void System::get_value_json(JsonObject output, const std::string & circuit, cons
|
||||
if (val.is<bool>()) {
|
||||
output["value"] = val.as<bool>();
|
||||
output["type"] = "boolean";
|
||||
} else if (val.is<String>() || val.is<const char *>() || val.is<std::string>()) {
|
||||
output["value"] = val.as<std::string>();
|
||||
output["type"] = "string";
|
||||
} else {
|
||||
} else if (val.is<float>() || val.is<int>()) {
|
||||
output["value"] = val.as<float>();
|
||||
output["type"] = "number";
|
||||
} else {
|
||||
output["value"] = val.as<std::string>();
|
||||
output["type"] = "string";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2043,7 +2049,7 @@ bool System::ntp_connected() {
|
||||
}
|
||||
|
||||
// see if its a BBQKees Gateway by checking the nvs values
|
||||
String System::getBBQKeesGatewayDetails() {
|
||||
String System::getBBQKeesGatewayDetails(uint8_t detail) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
/*
|
||||
if (!EMSESP::nvs_.isKey("mfg")) {
|
||||
@@ -2072,12 +2078,30 @@ String System::getBBQKeesGatewayDetails() {
|
||||
};
|
||||
uint32_t reg;
|
||||
} gw;
|
||||
gw.reg = esp_efuse_read_reg(EFUSE_BLK3, 0);
|
||||
for (uint8_t reg = 0; reg < 8; reg++) {
|
||||
gw.reg = esp_efuse_read_reg(EFUSE_BLK3, reg);
|
||||
if (reg == 7 || esp_efuse_read_reg(EFUSE_BLK3, reg + 1) == 0)
|
||||
break;
|
||||
}
|
||||
const char * mfg[] = {"unknown", "BBQKees Electronics", "", "", "", "", "", ""};
|
||||
const char * model[] = {"unknown", "S3", "E32V2", "E32V2.2", "S32", "E32", "", "", ""};
|
||||
|
||||
const char * model[] = {"unknown", "S3", "E32V2", "E32V2_2", "S32", "E32", "", "", ""};
|
||||
switch (detail) {
|
||||
case FUSE_VALUE::MFG:
|
||||
return String(mfg[gw.mfg]);
|
||||
case FUSE_VALUE::BOARD:
|
||||
return gw.model ? String(model[gw.model]) : board_profile_;
|
||||
case FUSE_VALUE::REV:
|
||||
return String(gw.rev_major) + "." + String(gw.rev_minor);
|
||||
case FUSE_VALUE::BATCH:
|
||||
return String(2000 + gw.year) + (gw.month < 10 ? "0" : "") + String(gw.month) + String(gw.no);
|
||||
case FUSE_VALUE::FUSE:
|
||||
return "0x" + String(gw.reg, 16);
|
||||
case FUSE_VALUE::ALL:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return gw.reg ? String(mfg[gw.mfg]) + " " + String(model[gw.model]) + " rev." + String(gw.rev_major) + "." + String(gw.rev_minor) + "/"
|
||||
+ String(2000 + gw.year) + "-" + String(gw.month) + "-" + String(gw.no) + " (fuse 0x" + String(gw.reg, 16) + ")"
|
||||
+ String(2000 + gw.year) + (gw.month < 10 ? "0" : "") + String(gw.month) + String(gw.no) + " (fuse 0x" + String(gw.reg, 16) + ")"
|
||||
: "";
|
||||
#else
|
||||
return "";
|
||||
|
||||
@@ -68,6 +68,8 @@ enum SYSTEM_STATUS : uint8_t {
|
||||
SYSTEM_STATUS_RESTART_REQUESTED = 5
|
||||
};
|
||||
|
||||
enum FUSE_VALUE : uint8_t { ALL = 0, MFG = 1, BOARD = 2, REV = 3, BATCH = 4, FUSE = 5 };
|
||||
|
||||
class System {
|
||||
public:
|
||||
void start();
|
||||
@@ -121,7 +123,7 @@ class System {
|
||||
}
|
||||
#endif
|
||||
|
||||
String getBBQKeesGatewayDetails();
|
||||
String getBBQKeesGatewayDetails(uint8_t detail = 0);
|
||||
|
||||
static bool uploadFirmwareURL(const char * url = nullptr);
|
||||
|
||||
@@ -330,7 +332,7 @@ class System {
|
||||
test_set_all_active_ = n;
|
||||
}
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32
|
||||
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2
|
||||
float temperature() {
|
||||
return temperature_;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.7.3-dev.16"
|
||||
#define EMSESP_APP_VERSION "3.7.3-dev.17"
|
||||
|
||||
@@ -112,13 +112,13 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) {
|
||||
// We only do this for BBQKees boards
|
||||
// Note 1: we never set the NVS boot value in the code - this is done on initial pre-loading
|
||||
// Note 2: The board profile is dynamically changed for the session, but the value in the settings file on the FS remains untouched
|
||||
if (!EMSESP::system_.getBBQKeesGatewayDetails().isEmpty()) {
|
||||
String nvs_boot = EMSESP::nvs_.getString("boot");
|
||||
if (!nvs_boot.isEmpty()) {
|
||||
if (EMSESP::system_.getBBQKeesGatewayDetails(FUSE_VALUE::MFG).startsWith("BBQKees")) {
|
||||
String bbq_board = EMSESP::system_.getBBQKeesGatewayDetails(FUSE_VALUE::BOARD);
|
||||
if (!bbq_board.isEmpty()) {
|
||||
#if defined(EMSESP_DEBUG)
|
||||
EMSESP::logger().debug("Overriding board profile with NVS boot value %s", nvs_boot.c_str());
|
||||
EMSESP::logger().info("Overriding board profile with fuse value %s", bbq_board.c_str());
|
||||
#endif
|
||||
settings.board_profile = nvs_boot;
|
||||
settings.board_profile = bbq_board;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
|
||||
root["free_psram"] = ESP.getFreePsram() / 1024;
|
||||
}
|
||||
root["model"] = EMSESP::system_.getBBQKeesGatewayDetails();
|
||||
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32
|
||||
root["temperature"] = Helpers::transformNumFloat(EMSESP::system_.temperature(), 0, EMSESP::system_.fahrenheit() ? 2 : 0); // only 2 decimal places
|
||||
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2
|
||||
root["temperature"] = (int)Helpers::transformNumFloat(EMSESP::system_.temperature(), 0, EMSESP::system_.fahrenheit() ? 2 : 0); // only 2 decimal places
|
||||
#endif
|
||||
|
||||
// check for a factory partition first
|
||||
|
||||
Reference in New Issue
Block a user