Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,64 @@ <h4 class="text-500">Loading dashboard...</h4>

<div class="status-item">
<div class="status-item-header">
<span>ASIC Frequency</span>
<span class="status-value">{{info.frequency}} MHz</span>
<span>Input Current</span>
<span class="status-value">{{info.current | number: '1.1-1'}}A</span>
</div>
<div class="progress-container">
<p-progressBar [value]="(info.current / (info.maxPower / info.voltage * 1.1)) * 100" styleClass="custom-progress">
<ng-template pTemplate="content" let-value></ng-template>
</p-progressBar>
<div class="voltage-marker" [style.left]="(1 / 1.1 * 100) + '%'">
<span class="marker-label">{{info.maxPower / info.voltage | number:'1.1-1'}}A</span>
</div>
</div>
<div class="status-warning" *ngIf="info.current > info.maxPower / info.voltage * 0.9">
⚠️ High current draw
</div>
<p-progressBar [value]="(info.frequency / maxFrequency) * 100" styleClass="custom-progress">
<ng-template pTemplate="content" let-value></ng-template>
</p-progressBar>
</div>

<div class="status-item">
<div class="status-item-header">
<span>Measured ASIC Voltage</span>
<span>VR Voltage</span>
<span class="status-value">{{info.coreVoltageActual}}V</span>
</div>
<p-progressBar [value]="(info.coreVoltageActual / 1.8) * 100" styleClass="custom-progress">
<div class="progress-container">
<p-progressBar [value]="(info.coreVoltageActual / 1.8) * 100" styleClass="custom-progress">
<ng-template pTemplate="content" let-value></ng-template>
</p-progressBar>
<div class="voltage-marker" [style.left]="(info.coreVoltage / 1.8) * 100 + '%'">
<span class="marker-label">{{info.coreVoltage}}V</span>
</div>
</div>
</div>

<div class="status-item" *ngIf="info.vrCurrent != null && info.vrCurrent > 0">
<div class="status-item-header">
<span>VR Current</span>
<span class="status-value">{{info.vrCurrent | number: '1.1-1'}}A</span>
</div>
<div class="progress-container">
<p-progressBar [value]="(info.vrCurrent / 42) * 100" styleClass="custom-progress">
<ng-template pTemplate="content" let-value></ng-template>
</p-progressBar>
<div class="voltage-marker" [style.left]="(40 / 42) * 100 + '%'">
<span class="marker-label">40A</span>
</div>
</div>
<div class="status-warning" *ngIf="info.vrCurrent >= 38 && info.vrCurrent < 40">
⚠️ High VR current — approaching limit
</div>
<div class="status-warning" *ngIf="info.vrCurrent >= 40">
🔥 VR overcurrent — protection may activate
</div>
</div>

<div class="status-item">
<div class="status-item-header">
<span>ASIC Frequency</span>
<span class="status-value">{{info.frequency}} MHz</span>
</div>
<p-progressBar [value]="(info.frequency / maxFrequency) * 100" styleClass="custom-progress">
<ng-template pTemplate="content" let-value></ng-template>
</p-progressBar>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export class HomeComponent {
info.power = Number.parseFloat(info.power.toFixed(1))
info.voltage = Number.parseFloat((info.voltage / 1000).toFixed(1))
info.current = Number.parseFloat((info.current / 1000).toFixed(1))
info.coreVoltageActual = Number.parseFloat((info.coreVoltageActual / 1000).toFixed(2))
info.coreVoltageActual = Number.parseFloat(info.coreVoltageActual.toFixed(3))
info.coreVoltage = Number.parseFloat((info.coreVoltage / 1000).toFixed(2))
info.temp = Number.parseFloat(info.temp.toFixed(1))
if (info.chiptemp1) info.chiptemp1 = Number.parseFloat(info.chiptemp1.toFixed(1))
Expand Down
3 changes: 2 additions & 1 deletion main/http_server/axe-os/src/app/services/system.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class SystemService {
power: 42.670,
voltage: 12208.75,
current: 2237.5,
vrCurrent: 34.5,
temp: 60,
vrTemp: 55,
maxPower: 55,
Expand All @@ -36,7 +37,7 @@ export class SystemService {
freeHeapSpiram: 50504,
isPSRAMAvailable: 1,
coreVoltage: 1200,
coreVoltageActual: 1200,
coreVoltageActual: 1.234,
hostname: "BitForge",
macAddr: "2C:54:91:88:C9:E3",
ssid: "default",
Expand Down
1 change: 1 addition & 0 deletions main/http_server/axe-os/src/models/ISystemInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface ISystemInfo {
power: number,
voltage: number,
current: number,
vrCurrent?: number,
temp: number,
vrTemp: number,
maxPower: number,
Expand Down
3 changes: 2 additions & 1 deletion main/http_server/http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ static esp_err_t GET_system_info(httpd_req_t * req)
cJSON_AddNumberToObject(root, "power", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.power);
cJSON_AddNumberToObject(root, "voltage", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.voltage);
cJSON_AddNumberToObject(root, "current", Power_get_current(GLOBAL_STATE));
cJSON_AddNumberToObject(root, "vrCurrent", Power_get_vr_current(GLOBAL_STATE));
cJSON_AddNumberToObject(root, "temp", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.chip_temp_avg);
cJSON_AddNumberToObject(root, "vrTemp", GLOBAL_STATE->POWER_MANAGEMENT_MODULE.vr_temp);
cJSON_AddNumberToObject(root, "maxPower", Power_get_max_settings(GLOBAL_STATE));
Expand All @@ -643,7 +644,7 @@ static esp_err_t GET_system_info(httpd_req_t * req)
cJSON_AddNumberToObject(root, "freeHeapInternal", heap_caps_get_free_size(MALLOC_CAP_INTERNAL));
cJSON_AddNumberToObject(root, "freeHeapSpiram", heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
cJSON_AddNumberToObject(root, "coreVoltage", nvs_config_get_u16(NVS_CONFIG_ASIC_VOLTAGE, CONFIG_ASIC_VOLTAGE));
cJSON_AddNumberToObject(root, "coreVoltageActual", VCORE_get_voltage_mv(GLOBAL_STATE));
cJSON_AddNumberToObject(root, "coreVoltageActual", Power_get_vr_voltage(GLOBAL_STATE));
cJSON_AddNumberToObject(root, "frequency", nvs_config_get_u16(NVS_CONFIG_ASIC_FREQ, CONFIG_ASIC_FREQUENCY));
cJSON_AddStringToObject(root, "ssid", ssid);
cJSON_AddStringToObject(root, "macAddr", formattedMac);
Expand Down
22 changes: 22 additions & 0 deletions main/power/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,28 @@ int Power_get_nominal_voltage(GlobalState * GLOBAL_STATE) {
}
}

float Power_get_vr_voltage(GlobalState * GLOBAL_STATE) {

switch (GLOBAL_STATE->device_model) {
case BITFORGE_NANO:
return TPS546_get_vout();
default:
}

return 0.0;
}

float Power_get_vr_current(GlobalState * GLOBAL_STATE) {

switch (GLOBAL_STATE->device_model) {
case BITFORGE_NANO:
return TPS546_get_iout();
default:
}

return 0.0;
}

float Power_get_vreg_temp(GlobalState * GLOBAL_STATE) {

switch (GLOBAL_STATE->device_model) {
Expand Down
2 changes: 2 additions & 0 deletions main/power/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
esp_err_t Power_disable(GlobalState * GLOBAL_STATE);

float Power_get_current(GlobalState * GLOBAL_STATE);
float Power_get_vr_voltage(GlobalState * GLOBAL_STATE);
float Power_get_vr_current(GlobalState * GLOBAL_STATE);
float Power_get_power(GlobalState * GLOBAL_STATE);
float Power_get_input_voltage(GlobalState * GLOBAL_STATE);
float Power_get_vreg_temp(GlobalState * GLOBAL_STATE);
Expand Down