WIP: Fix job interval timing (#249)

* add extended nonce debugging

* switch to semaphore for job timing

* clean up nonce debugging. hardcode 1366 job interval to 2s and show when new jobs are sent

* set nonce range to 0x0F0000 set job interval to 20s. better stratum debugging,

* testing out longer intervals on 1368

* looking at exact serial commands sent

* fix log value digit count

* add core from nonce debug

* set BM1366 initial chip difficulty to 32

* add version rolling debug

* improve debug printing again

* fix diff

* fix core_id extraction

* printf fix

* debug cleanup

* setup BM1368 for testing. reg10 to S21 default, job interval @ 0.5s

* set init diff on 1366 and 1368 back to 256

---------

Co-authored-by: Georges Palauqui <g.palauqui@gptechinno.com>
This commit is contained in:
Skot
2024-07-07 09:05:31 -04:00
committed by GitHub
parent 248df91543
commit 04c8b80287
10 changed files with 111 additions and 84 deletions

View File

@ -356,7 +356,7 @@ void STRATUM_V1_configure_version_rolling(int socket, uint32_t * version_mask)
"{\"id\": %d, \"method\": \"mining.configure\", \"params\": [[\"version-rolling\"], {\"version-rolling.mask\": "
"\"ffffffff\"}]}\n",
send_uid++);
ESP_LOGI(TAG, "tx: %s", configure_msg);
debug_stratum_tx(configure_msg);
write(socket, configure_msg, strlen(configure_msg));
return;
@ -364,5 +364,15 @@ void STRATUM_V1_configure_version_rolling(int socket, uint32_t * version_mask)
static void debug_stratum_tx(const char * msg)
{
//remove the trailing newline
char * newline = strchr(msg, '\n');
if (newline != NULL) {
*newline = '\0';
}
ESP_LOGI(TAG, "tx: %s", msg);
//put it back!
if (newline != NULL) {
*newline = '\n';
}
}