Skip to content

Commit

Permalink
Allow the password... password 347
Browse files Browse the repository at this point in the history
ck solostats no longer works 354
Set default cpu freq to 240mhz 338
Suggest difficulty after auth to fix ckpool issue 353
fix: Password visibility toggle 358
Protect against negative frequency and voltage values 326
Fix wifi status not updating after disconnected skot#320 321
Increase the max number of log lines stored in browser 327
Enable WiFi 802.11k 802.11v 365
  • Loading branch information
shufps committed Oct 17, 2024
1 parent df53d77 commit d39c9d1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
11 changes: 9 additions & 2 deletions components/connect/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ static const char *TAG = "wifi station";

static int s_retry_num = 0;

static char s_ip_addr[20]={0};
static char s_ip_addr[20] = {0};
static bool ip_valid = false;

bool connect_get_ip_addr(char *buf, size_t buf_len) {
bool connect_get_ip_addr(char *buf, size_t buf_len)
{
strncpy(buf, s_ip_addr, buf_len);
return ip_valid;
}
Expand Down Expand Up @@ -90,6 +91,7 @@ static void event_handler(void *arg, esp_event_base_t event_base, int32_t event_
ESP_LOGI(TAG, "Device ip: %s", s_ip_addr);
s_retry_num = 0;
xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
MINER_set_wifi_status(WIFI_CONNECTED, 0);
}
}

Expand Down Expand Up @@ -167,6 +169,11 @@ esp_netif_t *wifi_init_sta(const char *wifi_ssid, const char *wifi_pass)
.threshold.authmode = ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD,
// .sae_pwe_h2e = ESP_WIFI_SAE_MODE,
// .sae_h2e_identifier = EXAMPLE_H2E_IDENTIFIER,
.btm_enabled = 1,
.rm_enabled = 1,
.scan_method = WIFI_ALL_CHANNEL_SCAN,
.sort_method = WIFI_CONNECT_AP_BY_SIGNAL,
.pmf_cfg = {.capable = true, .required = false},
},
};
strncpy((char *) wifi_sta_config.sta.ssid, wifi_ssid, sizeof(wifi_sta_config.sta.ssid));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class HomeComponent implements OnInit, OnDestroy {
return `https://solo.d-central.tech/#/app/${address}`;
} else if (info.stratumURL.includes('solo.ckpool.org')) {
const address = info.stratumUser.split('.')[0];
return `https://solostats.ckpool.org/stats/${address}`;
return `https://solo.ckpool.org/users/${address}`;
} else {
return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class LogsComponent implements OnDestroy, AfterViewChecked {
this.websocketSubscription = this.websocketService.ws$.subscribe({
next: (val) => {
this.logs.push(val);
if (this.logs.length > 100) {
if (this.logs.length > 250) {
this.logs.shift();
}
}
Expand Down
4 changes: 2 additions & 2 deletions main/http_server/http_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ static esp_err_t PATCH_update_settings(httpd_req_t *req)
if ((item = cJSON_GetObjectItem(root, "hostname")) != NULL) {
nvs_config_set_string(NVS_CONFIG_HOSTNAME, item->valuestring);
}
if ((item = cJSON_GetObjectItem(root, "coreVoltage")) != NULL) {
if ((item = cJSON_GetObjectItem(root, "coreVoltage")) != NULL && item->valueint > 0) {
nvs_config_set_u16(NVS_CONFIG_ASIC_VOLTAGE, item->valueint);
}
if ((item = cJSON_GetObjectItem(root, "frequency")) != NULL) {
if ((item = cJSON_GetObjectItem(root, "frequency")) != NULL && item->valueint > 0) {
nvs_config_set_u16(NVS_CONFIG_ASIC_FREQ, item->valueint);
}
if ((item = cJSON_GetObjectItem(root, "flipscreen")) != NULL) {
Expand Down
8 changes: 4 additions & 4 deletions main/tasks/stratum_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,17 @@ void StratumTask::stratumLoop(int sock)
// mining.configure - ID: 2
STRATUM_V1_configure_version_rolling(sock);

// mining.suggest_difficulty - ID: 3
STRATUM_V1_suggest_difficulty(sock, CONFIG_STRATUM_DIFFICULTY);

char *username = nvs_config_get_string(NVS_CONFIG_STRATUM_USER, CONFIG_STRATUM_USER);
char *password = nvs_config_get_string(NVS_CONFIG_STRATUM_PASS, CONFIG_STRATUM_PW);

// mining.authorize - ID: 4
// mining.authorize - ID: 3
STRATUM_V1_authenticate(sock, username, password);
free(password);
free(username);

// mining.suggest_difficulty - ID: 4
STRATUM_V1_suggest_difficulty(sock, CONFIG_STRATUM_DIFFICULTY);

while (1) {
if (!is_socket_connected(sock)) {
ESP_LOGE(TAG, "Socket is not connected ...");
Expand Down
2 changes: 2 additions & 0 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ CONFIG_SPIRAM_TYPE_AUTO=y
CONFIG_SPIRAM_USE_CAPS_ALLOC=y
CONFIG_SPIRAM=y

CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP_WIFI_11KV_SUPPORT=y

0 comments on commit d39c9d1

Please sign in to comment.