@@ -48,7 +48,7 @@ void POWER_MANAGEMENT_task(void * pvParameters)
48
48
pid_setPoint = (double )nvs_config_get_u16 (NVS_CONFIG_TEMP_TARGET , pid_setPoint );
49
49
pid_init (& pid , & pid_input , & pid_output , & pid_setPoint , pid_p , pid_i , pid_d , PID_P_ON_E , PID_DIRECT );
50
50
pid_set_sample_time (& pid , POLL_RATE - 1 );
51
- pid_set_output_limits (& pid , 15 , 100 );
51
+ pid_set_output_limits (& pid , 25 , 100 );
52
52
pid_set_mode (& pid , AUTOMATIC );
53
53
pid_set_controller_direction (& pid , PID_REVERSE );
54
54
pid_initialize (& pid );
@@ -110,9 +110,15 @@ void POWER_MANAGEMENT_task(void * pvParameters)
110
110
Thermal_set_fan_percent (GLOBAL_STATE -> device_model , pid_output / 100.0 );
111
111
ESP_LOGI (TAG , "Temp: %.1f°C, SetPoint: %.1f°C, Output: %.1f%%" , pid_input , pid_setPoint , pid_output );
112
112
} else {
113
- ESP_LOGW (TAG , "Ignoring invalid temperature reading: %.1f°C" , power_management -> chip_temp_avg );
113
+ // Set fan to 70% in AP mode when temperature reading is invalid
114
+ if (GLOBAL_STATE -> SYSTEM_MODULE .ap_enabled ) {
115
+ ESP_LOGW (TAG , "AP mode with invalid temperature reading: %.1f°C - Setting fan to 70%%" , power_management -> chip_temp_avg );
116
+ power_management -> fan_perc = 70 ;
117
+ Thermal_set_fan_percent (GLOBAL_STATE -> device_model , 0.7 );
118
+ } else {
119
+ ESP_LOGW (TAG , "Ignoring invalid temperature reading: %.1f°C" , power_management -> chip_temp_avg );
120
+ }
114
121
}
115
-
116
122
} else {
117
123
float fs = (float ) nvs_config_get_u16 (NVS_CONFIG_FAN_SPEED , 100 );
118
124
power_management -> fan_perc = fs ;
0 commit comments