Merge pull request #19 from alcar21/feature/minor_fixes
Feature/minor fixes
This commit is contained in:
commit
2e564e076d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
.pio
|
||||
.vscode
|
||||
NerdMinerLog.txt
|
||||
platformio-device-monitor*.log
|
||||
|
@ -47,6 +47,8 @@ If you want you can compile the entire project using Arduino, PlatformIO or Expr
|
||||
After programming, you will only need to setup your Wifi and BTC address.
|
||||
|
||||
1. Connect to NerdMinerAP
|
||||
- AP: NerdMinerAP
|
||||
- PASS: MineYourCoins
|
||||
1. Setup your Wifi Network
|
||||
1. Add your BTCaddress
|
||||
|
||||
|
@ -18,20 +18,22 @@ framework = arduino
|
||||
monitor_filters =
|
||||
esp32_exception_decoder
|
||||
time
|
||||
log2file
|
||||
board_build.arduino.memory_type = qio_opi
|
||||
monitor_speed = 115200
|
||||
upload_speed = 115200
|
||||
|
||||
# 2 x 4.5MB app, 6.875MB SPIFFS
|
||||
;board_build.partitions = large_spiffs_16MB.csv
|
||||
;board_build.partitions = default_8MB.csv
|
||||
board_build.partitions = huge_app.csv
|
||||
;board_build.partitions = default.csv
|
||||
|
||||
build_flags =
|
||||
-D LV_LVGL_H_INCLUDE_SIMPLE
|
||||
-D BOARD_HAS_PSRAM
|
||||
-D ARDUINO_USB_MODE=1
|
||||
-D ARDUINO_USB_CDC_ON_BOOT=1
|
||||
-D DEBUG_MINING=1
|
||||
;-D DEBUG_MINING_SHARE
|
||||
;-D DEBUG_MINING=1
|
||||
lib_deps =
|
||||
https://github.com/takkaO/OpenFontRender
|
||||
bblanchon/ArduinoJson@^6.21.2
|
||||
|
@ -79,6 +79,7 @@ void setup()
|
||||
// Higher prio monitor task
|
||||
Serial.println("");
|
||||
Serial.println("Initiating tasks...");
|
||||
xTaskCreate(runMonitor, "Monitor", 5000, NULL, 4, NULL);
|
||||
|
||||
/******** CREATE MINER TASKS *****/
|
||||
for (size_t i = 0; i < THREADS; i++) {
|
||||
@ -87,10 +88,8 @@ void setup()
|
||||
|
||||
// Start mining tasks
|
||||
BaseType_t res = xTaskCreate(runWorker, name, 30000, (void*)name, 1, NULL);
|
||||
Serial.printf("Starting miner %s %s!\n", name, res == pdPASS? "successful":"failed");
|
||||
Serial.printf("Starting %s %s!\n", name, res == pdPASS? "successful":"failed");
|
||||
}
|
||||
|
||||
Serial.println("NerdMiner v2 started......");
|
||||
}
|
||||
|
||||
void app_error_fault_handler(void *arg) {
|
||||
@ -124,5 +123,4 @@ void loop() {
|
||||
//Run miner on main core when there is time --Currently on test
|
||||
// runMiner();
|
||||
|
||||
runMonitor();
|
||||
}
|
@ -3,7 +3,6 @@
|
||||
#include <WiFi.h>
|
||||
#include <algorithm>
|
||||
#include <TFT_eSPI.h> // Graphics and font library for ILI9341 driver chip
|
||||
#include <limits.h>
|
||||
#include "media/Free_Fonts.h"
|
||||
#include "media/images.h"
|
||||
#include "mbedtls/md.h"
|
||||
@ -33,6 +32,8 @@ extern char btcString[80];
|
||||
extern OpenFontRender render;
|
||||
extern TFT_eSprite background;
|
||||
|
||||
|
||||
|
||||
bool checkValid(unsigned char* hash, unsigned char* target) {
|
||||
bool valid = true;
|
||||
for(uint8_t i=31; i>=0; i--) {
|
||||
@ -44,7 +45,7 @@ bool checkValid(unsigned char* hash, unsigned char* target) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_MINING_SHARE
|
||||
#ifdef DEBUG_MINING
|
||||
if (valid) {
|
||||
Serial.print("\tvalid : ");
|
||||
for (size_t i = 0; i < 32; i++)
|
||||
@ -113,6 +114,13 @@ void getNextExtranonce2(int extranonce2_size, char *extranonce2) {
|
||||
extranonce2[2 * extranonce2_size] = 0;
|
||||
}
|
||||
|
||||
bool verifyPayload (String* line){
|
||||
if(line->length() == 0) return false;
|
||||
line->trim();
|
||||
if(line->isEmpty()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool checkError(const StaticJsonDocument<BUFFER_JSON_DOC> doc) {
|
||||
if (doc["error"].size() == 0) {
|
||||
return false;
|
||||
@ -123,7 +131,7 @@ bool checkError(const StaticJsonDocument<BUFFER_JSON_DOC> doc) {
|
||||
|
||||
void runWorker(void *name) {
|
||||
|
||||
// TEST: https://bitcoin.stackexchange.com/questions/22929/full-example-data-for-scrypt-stratum-client
|
||||
// TEST: https://bitcoin.stackexchange.com/questions/22929/full-example-data-for-scrypt-stratum-client
|
||||
|
||||
Serial.println("");
|
||||
Serial.printf("\n[WORKER] Started. Running %s on core %d\n", (char *)name, xPortGetCoreID());
|
||||
@ -534,6 +542,7 @@ void runWorker(void *name) {
|
||||
|
||||
|
||||
//////////////////THREAD CALLS///////////////////
|
||||
|
||||
//Testeamos hashrate final usando hilo principal
|
||||
//this is currently on test
|
||||
|
||||
@ -573,7 +582,7 @@ void runMiner(void){
|
||||
|
||||
}
|
||||
|
||||
void runMonitor() {
|
||||
void runMonitor(void *name){
|
||||
|
||||
// Serial.println("[MONITOR] started");
|
||||
|
||||
|
@ -4,6 +4,6 @@
|
||||
#define MAX_NONCE 5000000U
|
||||
#define TARGET_NONCE 471136297U
|
||||
|
||||
void runMonitor();
|
||||
void runMonitor(void *name);
|
||||
void runWorker(void *name);
|
||||
void runMiner(void);
|
Loading…
Reference in New Issue
Block a user