diff --git a/config-202.cvs b/config-202.cvs new file mode 100644 index 00000000..ab5e9184 --- /dev/null +++ b/config-202.cvs @@ -0,0 +1,24 @@ +key,type,encoding,value +main,namespace,, +hostname,data,string,bitaxe +wifissid,data,string,myssid +wifipass,data,string,password +stratumurl,data,string,public-pool.io +stratumport,data,u16,21496 +stratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe +stratumpass,data,string,x +fbstratumurl,data,string,solo.ckpool.org +fbstratumport,data,u16,3333 +fbstratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe +fbstratumpass,data,string,x +asicfrequency,data,u16,485 +asicvoltage,data,u16,1200 +asicmodel,data,string,BM1366 +devicemodel,data,string,ultra +boardversion,data,string,202 +flipscreen,data,u16,1 +invertfanpol,data,u16,1 +autofanspeed,data,u16,1 +fanspeed,data,u16,100 +selftest,data,u16,0 +overheat_mode,data,u16,0 \ No newline at end of file diff --git a/config-204.cvs b/config-204.cvs index be5100b1..c2a676c5 100644 --- a/config-204.cvs +++ b/config-204.cvs @@ -7,6 +7,10 @@ stratumurl,data,string,public-pool.io stratumport,data,u16,21496 stratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe stratumpass,data,string,x +fbstratumurl,data,string,solo.ckpool.org +fbstratumport,data,u16,3333 +fbstratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe +fbstratumpass,data,string,x asicfrequency,data,u16,485 asicvoltage,data,u16,1200 asicmodel,data,string,BM1366 @@ -16,4 +20,5 @@ flipscreen,data,u16,1 invertfanpol,data,u16,1 autofanspeed,data,u16,1 fanspeed,data,u16,100 -selftest,data,u16,0 \ No newline at end of file +selftest,data,u16,0 +overheat_mode,data,u16,0 \ No newline at end of file diff --git a/config-401.cvs b/config-401.cvs index b75ea691..c8a5b7c3 100644 --- a/config-401.cvs +++ b/config-401.cvs @@ -7,6 +7,10 @@ stratumurl,data,string,public-pool.io stratumport,data,u16,21496 stratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe stratumpass,data,string,x +fbstratumurl,data,string,solo.ckpool.org +fbstratumport,data,u16,3333 +fbstratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe +fbstratumpass,data,string,x asicfrequency,data,u16,490 asicvoltage,data,u16,1166 asicmodel,data,string,BM1368 @@ -16,4 +20,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_mode,data,u16,0 \ No newline at end of file diff --git a/config-402.cvs b/config-402.cvs index b9aaccae..ddb00bf2 100644 --- a/config-402.cvs +++ b/config-402.cvs @@ -7,6 +7,10 @@ stratumurl,data,string,public-pool.io stratumport,data,u16,21496 stratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe stratumpass,data,string,x +fbstratumurl,data,string,solo.ckpool.org +fbstratumport,data,u16,3333 +fbstratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe +fbstratumpass,data,string,x asicfrequency,data,u16,490 asicvoltage,data,u16,1166 asicmodel,data,string,BM1368 @@ -16,4 +20,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_mode,data,u16,0 \ No newline at end of file diff --git a/config-403.cvs b/config-403.cvs index a343a281..f119e086 100644 --- a/config-403.cvs +++ b/config-403.cvs @@ -7,6 +7,10 @@ stratumurl,data,string,public-pool.io stratumport,data,u16,21496 stratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe stratumpass,data,string,x +fbstratumurl,data,string,solo.ckpool.org +fbstratumport,data,u16,3333 +fbstratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe +fbstratumpass,data,string,x asicfrequency,data,u16,490 asicvoltage,data,u16,1166 asicmodel,data,string,BM1368 @@ -16,4 +20,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_mode,data,u16,0 \ No newline at end of file diff --git a/config-601.cvs b/config-601.cvs index 079334ae..7214bb83 100644 --- a/config-601.cvs +++ b/config-601.cvs @@ -7,6 +7,10 @@ stratumurl,data,string,public-pool.io stratumport,data,u16,21496 stratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe stratumpass,data,string,x +fbstratumurl,data,string,solo.ckpool.org +fbstratumport,data,u16,3333 +fbstratumuser,data,string,bc1qnp980s5fpp8l94p5cvttmtdqy8rvrq74qly2yrfmzkdsntqzlc5qkc4rkq.bitaxe +fbstratumpass,data,string,x asicfrequency,data,u16,525 asicvoltage,data,u16,1150 asicmodel,data,string,BM1370 @@ -16,4 +20,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_mode,data,u16,0 \ No newline at end of file diff --git a/main/self_test/self_test.c b/main/self_test/self_test.c index 9cc090d0..2cbf462d 100644 --- a/main/self_test/self_test.c +++ b/main/self_test/self_test.c @@ -57,9 +57,9 @@ static void display_end_screen(GlobalState * GLOBAL_STATE) { case DEVICE_GAMMA: if (OLED_status()) { OLED_clearLine(2); - OLED_writeString(0, 2, " PASS"); + OLED_writeString(0, 2, "TESTS PASS!"); OLED_clearLine(3); - OLED_writeString(0, 3, "PRESS RESET"); + OLED_writeString(0, 3, " PRESS RESET"); } break; default: @@ -120,10 +120,27 @@ static bool core_voltage_pass(GlobalState * GLOBAL_STATE) void self_test(void * pvParameters) { + GlobalState * GLOBAL_STATE = (GlobalState *) pvParameters; ESP_LOGI(TAG, "Running Self Tests"); - GlobalState * GLOBAL_STATE = (GlobalState *) pvParameters; + // Display testing + switch (GLOBAL_STATE->device_model) { + case DEVICE_MAX: + case DEVICE_ULTRA: + case DEVICE_SUPRA: + case DEVICE_GAMMA: + if (!OLED_init()) { + ESP_LOGE(TAG, "OLED init failed!"); + } else { + ESP_LOGI(TAG, "OLED init success!"); + // clear the oled screen + OLED_fill(0); + OLED_writeString(0, 0, "BITAXE SELF TESTING"); + } + break; + default: + } GLOBAL_STATE->ASIC_TASK_MODULE.active_jobs = malloc(sizeof(bm_job *) * 128); GLOBAL_STATE->valid_jobs = malloc(sizeof(uint8_t) * 128); @@ -146,11 +163,6 @@ void self_test(void * pvParameters) default: } - // Init I2C - ESP_ERROR_CHECK(i2c_bitaxe_init()); - ESP_LOGI(TAG, "I2C initialized successfully"); - - switch (GLOBAL_STATE->device_model) { case DEVICE_MAX: case DEVICE_ULTRA: @@ -162,24 +174,6 @@ void self_test(void * pvParameters) default: } - // Display testing - switch (GLOBAL_STATE->device_model) { - case DEVICE_MAX: - case DEVICE_ULTRA: - case DEVICE_SUPRA: - case DEVICE_GAMMA: - if (!OLED_init()) { - ESP_LOGE(TAG, "OLED init failed!"); - } else { - ESP_LOGI(TAG, "OLED init success!"); - // clear the oled screen - OLED_fill(0); - display_msg("SELF TEST...", GLOBAL_STATE); - } - break; - default: - } - uint8_t result = VCORE_init(GLOBAL_STATE); VCORE_set_voltage(nvs_config_get_u16(NVS_CONFIG_ASIC_VOLTAGE, CONFIG_ASIC_VOLTAGE) / 1000.0, GLOBAL_STATE); @@ -284,7 +278,7 @@ void self_test(void * pvParameters) if (chips_detected < 1) { ESP_LOGE(TAG, "SELF TEST FAIL, NO CHIPS DETECTED"); // ESP_LOGE(TAG, "SELF TEST FAIL, INCORRECT NONCE DIFF"); - display_msg("ASIC:FAIL NO CHIPS", GLOBAL_STATE); + display_msg("ASIC:FAIL 0 CHIPS", GLOBAL_STATE); return; } @@ -293,7 +287,7 @@ void self_test(void * pvParameters) if (!core_voltage_pass(GLOBAL_STATE)) { ESP_LOGE(TAG, "SELF TEST FAIL, INCORRECT CORE VOLTAGE"); - display_msg("VCORE: FAIL", GLOBAL_STATE); + display_msg("VCORE:FAIL", GLOBAL_STATE); return; } @@ -304,13 +298,13 @@ void self_test(void * pvParameters) if(GLOBAL_STATE->board_version >= 402 && GLOBAL_STATE->board_version <= 499){ if (!TPS546_power_consumption_pass(POWER_CONSUMPTION_TARGET_402, POWER_CONSUMPTION_MARGIN)) { ESP_LOGE(TAG, "TPS546 Power Draw Failed, target %.2f", (float)POWER_CONSUMPTION_TARGET_402); - display_msg("POWER: FAIL", GLOBAL_STATE); + display_msg("POWER:FAIL", GLOBAL_STATE); return; } } else { if (!INA260_power_consumption_pass(POWER_CONSUMPTION_TARGET_SUB_402, POWER_CONSUMPTION_MARGIN)) { ESP_LOGE(TAG, "INA260 Power Draw Failed, target %.2f", (float)POWER_CONSUMPTION_TARGET_SUB_402); - display_msg("POWER: FAIL", GLOBAL_STATE); + display_msg("POWER:FAIL", GLOBAL_STATE); return; } } @@ -318,7 +312,7 @@ void self_test(void * pvParameters) case DEVICE_GAMMA: if (!TPS546_power_consumption_pass(POWER_CONSUMPTION_TARGET_GAMMA, POWER_CONSUMPTION_MARGIN)) { ESP_LOGE(TAG, "TPS546 Power Draw Failed, target %.2f", (float)POWER_CONSUMPTION_TARGET_GAMMA); - display_msg("POWER: FAIL", GLOBAL_STATE); + display_msg("POWER:FAIL", GLOBAL_STATE); return; } break; @@ -327,11 +321,40 @@ void self_test(void * pvParameters) if (!fan_sense_pass(GLOBAL_STATE)) { ESP_LOGE(TAG, "FAN test failed!"); - display_msg("FAN: WARN", GLOBAL_STATE); + display_msg("FAN:WARN", GLOBAL_STATE); } ESP_LOGI(TAG, "SELF TESTS PASS -- Press RESET to continue"); display_end_screen(GLOBAL_STATE); nvs_config_set_u16(NVS_CONFIG_SELF_TEST, 0); + + //blink tests pass screen + while (1) { + switch (GLOBAL_STATE->device_model) { + case DEVICE_MAX: + case DEVICE_ULTRA: + case DEVICE_SUPRA: + case DEVICE_GAMMA: + if (OLED_status()) { + OLED_clearLine(3); + OLED_writeString(0, 3, " PRESS RESET"); + } + break; + default: + } + vTaskDelay(500 / portTICK_PERIOD_MS); + switch (GLOBAL_STATE->device_model) { + case DEVICE_MAX: + case DEVICE_ULTRA: + case DEVICE_SUPRA: + case DEVICE_GAMMA: + if (OLED_status()) { + OLED_clearLine(3); + } + break; + default: + } + vTaskDelay(500 / portTICK_PERIOD_MS); + } }