diff --git a/config.cvs.example b/config.cvs.example
index 6afb47148..7315b50b4 100644
--- a/config.cvs.example
+++ b/config.cvs.example
@@ -16,4 +16,5 @@ flipscreen,data,u16,1
invertfanpol,data,u16,1
autofanspeed,data,u16,1
fanspeed,data,u16,100
-selftest,data,u16,1
\ No newline at end of file
+selftest,data,u16,1
+overheat,data,u16,0
\ No newline at end of file
diff --git a/main/http_server/axe-os/src/app/components/edit/edit.component.html b/main/http_server/axe-os/src/app/components/edit/edit.component.html
index 5af1eab3f..07facc967 100644
--- a/main/http_server/axe-os/src/app/components/edit/edit.component.html
+++ b/main/http_server/axe-os/src/app/components/edit/edit.component.html
@@ -147,6 +147,13 @@
+
diff --git a/main/http_server/axe-os/src/app/components/edit/edit.component.ts b/main/http_server/axe-os/src/app/components/edit/edit.component.ts
index 54aa8bab8..4a24d471d 100644
--- a/main/http_server/axe-os/src/app/components/edit/edit.component.ts
+++ b/main/http_server/axe-os/src/app/components/edit/edit.component.ts
@@ -137,6 +137,7 @@ export class EditComponent implements OnInit {
autofanspeed: [info.autofanspeed == 1, [Validators.required]],
invertfanpolarity: [info.invertfanpolarity == 1, [Validators.required]],
fanspeed: [info.fanspeed, [Validators.required]],
+ overheat: [info.overheat, [Validators.required]]
});
this.form.controls['autofanspeed'].valueChanges.pipe(
@@ -174,6 +175,8 @@ export class EditComponent implements OnInit {
delete form.stratumPassword;
}
+ form.overheat = form.overheat ? 1 : 0;
+
this.systemService.updateSystem(this.uri, form)
.pipe(this.loadingService.lockUIUntilComplete())
.subscribe({
diff --git a/main/http_server/axe-os/src/app/services/system.service.ts b/main/http_server/axe-os/src/app/services/system.service.ts
index 2267b7f27..aa8a11d63 100644
--- a/main/http_server/axe-os/src/app/services/system.service.ts
+++ b/main/http_server/axe-os/src/app/services/system.service.ts
@@ -56,7 +56,8 @@ export class SystemService {
fanrpm: 0,
boardtemp1: 30,
- boardtemp2: 40
+ boardtemp2: 40,
+ overheat: 0
}
).pipe(delay(1000));
}
diff --git a/main/http_server/axe-os/src/models/ISystemInfo.ts b/main/http_server/axe-os/src/models/ISystemInfo.ts
index a93895079..9647045d6 100644
--- a/main/http_server/axe-os/src/models/ISystemInfo.ts
+++ b/main/http_server/axe-os/src/models/ISystemInfo.ts
@@ -36,5 +36,6 @@ export interface ISystemInfo {
coreVoltageActual: number,
boardtemp1?: number,
- boardtemp2?: number
+ boardtemp2?: number,
+ overheat: number
}
diff --git a/main/http_server/http_server.c b/main/http_server/http_server.c
index d1a594709..0c00da684 100644
--- a/main/http_server/http_server.c
+++ b/main/http_server/http_server.c
@@ -296,6 +296,9 @@ static esp_err_t PATCH_update_settings(httpd_req_t * req)
if ((item = cJSON_GetObjectItem(root, "flipscreen")) != NULL) {
nvs_config_set_u16(NVS_CONFIG_FLIP_SCREEN, item->valueint);
}
+ if ((item = cJSON_GetObjectItem(root, "overheat")) != NULL) {
+ nvs_config_set_u16(NVS_CONFIG_OVERHEAT_MODE, 0);
+ }
if ((item = cJSON_GetObjectItem(root, "invertscreen")) != NULL) {
nvs_config_set_u16(NVS_CONFIG_INVERT_SCREEN, item->valueint);
}
@@ -412,6 +415,7 @@ static esp_err_t GET_system_info(httpd_req_t * req)
cJSON_AddStringToObject(root, "runningPartition", esp_ota_get_running_partition()->label);
cJSON_AddNumberToObject(root, "flipscreen", nvs_config_get_u16(NVS_CONFIG_FLIP_SCREEN, 1));
+ cJSON_AddNumberToObject(root, "overheat", nvs_config_get_u16(NVS_CONFIG_OVERHEAT_MODE,0));
cJSON_AddNumberToObject(root, "invertscreen", nvs_config_get_u16(NVS_CONFIG_INVERT_SCREEN, 0));
cJSON_AddNumberToObject(root, "invertfanpolarity", nvs_config_get_u16(NVS_CONFIG_INVERT_FAN_POLARITY, 1));
diff --git a/main/nvs_config.h b/main/nvs_config.h
index 84dd4fe2a..c5f318d52 100644
--- a/main/nvs_config.h
+++ b/main/nvs_config.h
@@ -24,6 +24,7 @@
#define NVS_CONFIG_FAN_SPEED "fanspeed"
#define NVS_CONFIG_BEST_DIFF "bestdiff"
#define NVS_CONFIG_SELF_TEST "selftest"
+#define NVS_CONFIG_OVERHEAT_MODE "overheat_mode"
#define NVS_CONFIG_SWARM "swarmconfig"
diff --git a/main/system.c b/main/system.c
index 960d42c93..f19ffa487 100644
--- a/main/system.c
+++ b/main/system.c
@@ -118,6 +118,28 @@ static void _init_system(GlobalState * GLOBAL_STATE)
netif = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF");
}
+static void _show_overheat_screen(GlobalState * GLOBAL_STATE)
+{
+ switch (GLOBAL_STATE->device_model) {
+ case DEVICE_MAX:
+ case DEVICE_ULTRA:
+ case DEVICE_SUPRA:
+ if (OLED_status()) {
+ OLED_clearLine(0);
+ OLED_clearLine(1);
+ OLED_clearLine(2);
+ OLED_clearLine(3);
+ OLED_writeString(0, 0, "DEVICE OVERHEATED");
+ OLED_writeString(0, 1, "Please check");
+ OLED_writeString(0, 2, "webUI for more");
+ OLED_writeString(0, 3, "information");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
static void _update_hashrate(GlobalState * GLOBAL_STATE)
{
SystemModule * module = &GLOBAL_STATE->SYSTEM_MODULE;
@@ -485,6 +507,15 @@ void SYSTEM_task(void * pvParameters)
}
while (1) {
+ // Check for overheat mode
+ uint16_t overheat_mode = nvs_config_get_u16(NVS_CONFIG_OVERHEAT_MODE, 0);
+
+ if (overheat_mode == 1) {
+ _show_overheat_screen(GLOBAL_STATE);
+ vTaskDelay(5000 / portTICK_PERIOD_MS); // Update every 5 seconds
+ continue; // Skip the normal screen cycle
+ }
+
// Automatically cycle through screens
for (int screen = 0; screen < 3; screen++) {
_clear_display(GLOBAL_STATE);
diff --git a/main/tasks/power_management_task.c b/main/tasks/power_management_task.c
index 4f1c54b69..03968db4d 100644
--- a/main/tasks/power_management_task.c
+++ b/main/tasks/power_management_task.c
@@ -197,6 +197,7 @@ void POWER_MANAGEMENT_task(void * pvParameters)
nvs_config_set_u16(NVS_CONFIG_ASIC_FREQ, 50);
nvs_config_set_u16(NVS_CONFIG_FAN_SPEED, 100);
nvs_config_set_u16(NVS_CONFIG_AUTO_FAN_SPEED, 0);
+ nvs_config_set_u16(NVS_CONFIG_OVERHEAT_MODE, 1);
exit(EXIT_FAILURE);
}