mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-04-02 08:58:26 +02:00
EMC2101 should read internal temp if BM1366
This commit is contained in:
parent
d4affd7ebb
commit
ef71810bba
@ -71,7 +71,7 @@ uint16_t EMC2101_get_fan_speed(void)
|
||||
return RPM;
|
||||
}
|
||||
|
||||
float EMC2101_get_chip_temp(void)
|
||||
float EMC2101_get_external_temp(void)
|
||||
{
|
||||
uint8_t temp_msb, temp_lsb;
|
||||
uint16_t reading;
|
||||
@ -83,4 +83,11 @@ float EMC2101_get_chip_temp(void)
|
||||
reading >>= 5;
|
||||
|
||||
return (float)reading / 8.0;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t EMC2101_get_internal_temp(void)
|
||||
{
|
||||
uint8_t temp;
|
||||
ESP_ERROR_CHECK(register_read(EMC2101_INTERNAL_TEMP, &temp, 1));
|
||||
return temp;
|
||||
}
|
||||
|
@ -61,6 +61,6 @@ void EMC2101_set_fan_speed(float);
|
||||
// void EMC2101_read(void);
|
||||
uint16_t EMC2101_get_fan_speed(void);
|
||||
void EMC2101_init(void);
|
||||
float EMC2101_get_chip_temp(void);
|
||||
|
||||
float EMC2101_get_external_temp(void);
|
||||
uint8_t EMC2101_get_internal_temp(void);
|
||||
#endif /* EMC2101_H_ */
|
@ -92,6 +92,11 @@
|
||||
<td>{{info.fanSpeed}} <small>RPM</small></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Chip Temperature:</td>
|
||||
<td>{{info.temp}} <small>C</small></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { AfterViewChecked, Component, ElementRef, ViewChild } from '@angular/core';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { interval, Observable, shareReplay, switchMap } from 'rxjs';
|
||||
import { interval, Observable, shareReplay, startWith, switchMap } from 'rxjs';
|
||||
import { LoadingService } from 'src/app/services/loading.service';
|
||||
import { SystemService } from 'src/app/services/system.service';
|
||||
import { WebsocketService } from 'src/app/services/web-socket.service';
|
||||
@ -25,6 +25,7 @@ export class HomeComponent implements AfterViewChecked {
|
||||
) {
|
||||
|
||||
this.info$ = interval(3000).pipe(
|
||||
startWith(() => this.systemService.getInfo()),
|
||||
switchMap(() => {
|
||||
return this.systemService.getInfo()
|
||||
}),
|
||||
|
@ -24,6 +24,7 @@ export class SystemService {
|
||||
"voltage": 5208.75,
|
||||
"current": 2237.5,
|
||||
"fanSpeed": 82,
|
||||
"temp": 60,
|
||||
"hashRate": 0,
|
||||
"bestDiff": "0",
|
||||
"freeHeap": 200504,
|
||||
|
@ -4,6 +4,7 @@ export interface ISystemInfo {
|
||||
voltage: number,
|
||||
current: number,
|
||||
fanSpeed: number,
|
||||
temp: number,
|
||||
hashRate: number,
|
||||
bestDiff: string,
|
||||
freeHeap: number,
|
||||
|
@ -270,8 +270,10 @@ static esp_err_t GET_system_info(httpd_req_t *req)
|
||||
cJSON_AddNumberToObject(root, "voltage", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.voltage);
|
||||
cJSON_AddNumberToObject(root, "current", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.current);
|
||||
cJSON_AddNumberToObject(root, "fanSpeed", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.fan_speed);
|
||||
cJSON_AddNumberToObject(root, "temp", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.chip_temp);
|
||||
cJSON_AddNumberToObject(root, "hashRate", GLOBAL_STATE->SYSTEM_MODULE.current_hashrate);
|
||||
cJSON_AddStringToObject(root, "bestDiff", GLOBAL_STATE->SYSTEM_MODULE.best_diff_string);
|
||||
|
||||
cJSON_AddNumberToObject(root, "freeHeap", esp_get_free_heap_size());
|
||||
cJSON_AddNumberToObject(root, "coreVoltage", ADC_get_vcore());
|
||||
cJSON_AddStringToObject(root, "ssid", ssid);
|
||||
|
@ -46,7 +46,7 @@ void POWER_MANAGEMENT_task(void *pvParameters)
|
||||
while (1)
|
||||
{
|
||||
|
||||
if (read_power)
|
||||
if (read_power == true)
|
||||
{
|
||||
power_management->voltage = INA260_read_voltage();
|
||||
power_management->power = INA260_read_power() / 1000;
|
||||
@ -57,7 +57,7 @@ void POWER_MANAGEMENT_task(void *pvParameters)
|
||||
if (strcmp(ASIC_MODEL, "BM1397") == 0)
|
||||
{
|
||||
|
||||
power_management->chip_temp = EMC2101_get_chip_temp();
|
||||
power_management->chip_temp = EMC2101_get_external_temp();
|
||||
|
||||
// Voltage
|
||||
// We'll throttle between 4.9v and 3.5v
|
||||
@ -125,6 +125,8 @@ void POWER_MANAGEMENT_task(void *pvParameters)
|
||||
}
|
||||
else if (strcmp(ASIC_MODEL, "BM1366") == 0)
|
||||
{
|
||||
power_management->chip_temp = EMC2101_get_internal_temp() + 5;
|
||||
|
||||
if (power_management->fan_speed < 10)
|
||||
{
|
||||
ESP_LOGE(TAG, "Detected fan speed too slow, setting vCore to 0");
|
||||
|
@ -5,6 +5,6 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||
CONFIG_PARTITION_TABLE_MD5=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"
|
||||
CONFIG_ESP_MAXIMUM_RETRY=3
|
||||
CONFIG_ESP_MAXIMUM_RETRY=5
|
||||
CONFIG_HTTPD_WS_SUPPORT=y
|
||||
CONFIG_SPIFFS_OBJ_NAME_LEN=64
|
Loading…
x
Reference in New Issue
Block a user