Fix add delay pool connection + building on any ESP32
- Added a 5sec delay after not being able to connect with pool. - Compile code to work on any ESP32 dev kit
This commit is contained in:
parent
cde810a515
commit
d42fc0c9fa
@ -10,7 +10,7 @@
|
||||
|
||||
[platformio]
|
||||
globallib_dir = lib
|
||||
default_envs = NerminerV2 ;, ESP32-devKitv1 TTGO-T-Display
|
||||
default_envs = NerminerV2, ESP32-devKitv1; TTGO-T-Display
|
||||
|
||||
[env:NerminerV2]
|
||||
platform = espressif32
|
||||
@ -42,7 +42,7 @@ lib_deps =
|
||||
https://github.com/tzapu/WiFiManager.git
|
||||
mathertel/OneButton @ ^2.0.3
|
||||
arduino-libraries/NTPClient
|
||||
https://github.com/golden-guy/Arduino_wolfssl.git#v5.5.4
|
||||
;https://github.com/golden-guy/Arduino_wolfssl.git#v5.5.4
|
||||
|
||||
|
||||
[env:ESP32-devKitv1]
|
||||
@ -60,12 +60,10 @@ 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
|
||||
board_build.partitions = huge_app.csv
|
||||
;board_build.partitions = default.csv
|
||||
|
||||
build_flags =
|
||||
-D ARDUINO_USB_MODE=1
|
||||
-U FREERTOS
|
||||
;-D DEBUG_MINING=1
|
||||
lib_deps =
|
||||
https://github.com/takkaO/OpenFontRender
|
||||
@ -73,11 +71,11 @@ lib_deps =
|
||||
https://github.com/tzapu/WiFiManager.git
|
||||
mathertel/OneButton @ ^2.0.3
|
||||
arduino-libraries/NTPClient
|
||||
https://github.com/golden-guy/Arduino_wolfssl.git#v5.5.4
|
||||
;https://github.com/golden-guy/Arduino_wolfssl.git#v5.5.4
|
||||
|
||||
[env:TTGO-T-Display]
|
||||
platform = espressif32
|
||||
board = esp-wrover-kit
|
||||
board = esp32dev ;esp-wrover-kit
|
||||
framework = arduino
|
||||
monitor_filters =
|
||||
esp32_exception_decoder
|
||||
@ -92,7 +90,6 @@ upload_speed = 115200
|
||||
board_build.partitions = huge_app.csv
|
||||
|
||||
;build_flags =
|
||||
; -D ARDUINO_USB_MODE=1
|
||||
;-D DEBUG_MINING=1
|
||||
lib_deps =
|
||||
https://github.com/takkaO/OpenFontRender
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <WiFi.h>
|
||||
#include <esp_task_wdt.h>
|
||||
#include <TFT_eSPI.h> // Graphics and font library for ILI9341 driver chip
|
||||
#include <wolfssl/wolfcrypt/sha256.h>
|
||||
//#include <wolfssl/wolfcrypt/sha256.h>
|
||||
#include "ShaTests/nerdSHA256.h"
|
||||
#include "media/Free_Fonts.h"
|
||||
#include "media/images.h"
|
||||
@ -43,10 +43,10 @@ monitor_data mMonitor;
|
||||
bool isMinerSuscribed = false;
|
||||
unsigned long mLastTXtoPool = millis();
|
||||
|
||||
void checkPoolConnection(void) {
|
||||
bool checkPoolConnection(void) {
|
||||
|
||||
if (client.connected()) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
isMinerSuscribed = false;
|
||||
@ -65,7 +65,10 @@ void checkPoolConnection(void) {
|
||||
WiFi.hostByName(poolString, serverIP);
|
||||
Serial.printf("Resolved DNS got: %s\n", serverIP.toString());
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//Implements a socketKeepAlive function and
|
||||
@ -140,7 +143,9 @@ void runStratumWorker(void *name) {
|
||||
//portNumber = 3333;
|
||||
//strcpy(btcString,"test");
|
||||
|
||||
checkPoolConnection();
|
||||
if(!checkPoolConnection())
|
||||
//If server not reachable add 5sec delay bettween connection petitions
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
|
||||
if(!isMinerSuscribed){
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user