Firmware 1.6.1

This commit is contained in:
BitMaker 2023-08-27 11:21:26 +02:00
parent 10d01ff2c7
commit 6677f853e2
17 changed files with 51 additions and 14 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -59,10 +59,7 @@ monitor_speed = 115200
upload_speed = 115200 upload_speed = 115200
# 2 x 4.5MB app, 6.875MB SPIFFS # 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 = huge_app.csv
;board_build.partitions = default.csv
build_flags = build_flags =
-D DEVKITV1=1 -D DEVKITV1=1
@ -73,7 +70,7 @@ lib_deps =
https://github.com/tzapu/WiFiManager.git https://github.com/tzapu/WiFiManager.git
mathertel/OneButton @ ^2.0.3 mathertel/OneButton @ ^2.0.3
arduino-libraries/NTPClient arduino-libraries/NTPClient
;https://github.com/golden-guy/Arduino_wolfssl.git#v5.5.4
[env:TTGO-T-Display] [env:TTGO-T-Display]
platform = espressif32 platform = espressif32

View File

@ -16,7 +16,7 @@
#include "mining.h" #include "mining.h"
#include "monitor.h" #include "monitor.h"
#define CURRENT_VERSION "V1.6.0" #define CURRENT_VERSION "V1.6.1"
//3 seconds WDT //3 seconds WDT
#define WDT_TIMEOUT 3 #define WDT_TIMEOUT 3
@ -27,6 +27,7 @@ OneButton button2(PIN_BUTTON_2);
OpenFontRender render; OpenFontRender render;
extern monitor_data mMonitor;
/**********************⚡ GLOBAL Vars *******************************/ /**********************⚡ GLOBAL Vars *******************************/
TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h
@ -109,9 +110,15 @@ void setup()
tft.fillScreen(TFT_BLACK); tft.fillScreen(TFT_BLACK);
tft.pushImage(0, 0, initWidth, initHeight, initScreen); tft.pushImage(0, 0, initWidth, initHeight, initScreen);
tft.setTextColor(TFT_BLACK); tft.setTextColor(TFT_BLACK);
tft.drawString(CURRENT_VERSION, 24, 130, FONT2); tft.drawString(CURRENT_VERSION, 24, 147, FONT2);
delay(2000); delay(2000);
/******** SHOW LED INIT STATUS (devices without screen) *****/
mMonitor.NerdStatus = NM_waitingConfig;
#ifdef DEVKITV1
doLedStuff(LED_PIN);
#endif
/******** INIT WIFI ************/ /******** INIT WIFI ************/
init_WifiManager(); init_WifiManager();

View File

@ -123,6 +123,7 @@ void runStratumWorker(void *name) {
if(WiFi.status() != WL_CONNECTED){ if(WiFi.status() != WL_CONNECTED){
// WiFi is disconnected, so reconnect now // WiFi is disconnected, so reconnect now
mMonitor.NerdStatus = NM_Connecting;
WiFi.reconnect(); WiFi.reconnect();
vTaskDelay(5000 / portTICK_PERIOD_MS); vTaskDelay(5000 / portTICK_PERIOD_MS);
continue; continue;
@ -248,6 +249,8 @@ void runMiner(void * task_id) {
mMiner.newJob2 = false; //Clear newJob flag mMiner.newJob2 = false; //Clear newJob flag
mMiner.inRun = true; //Set inRun flag mMiner.inRun = true; //Set inRun flag
mMonitor.NerdStatus = NM_hashing;
//Prepare Premining data //Prepare Premining data
nerd_sha256 nerdMidstate; nerd_sha256 nerdMidstate;
//nerdSHA256_context nerdMidstate; //NerdShaplus //nerdSHA256_context nerdMidstate; //NerdShaplus

View File

@ -422,12 +422,28 @@ void show_GlobalHashScreen(unsigned long mElapsed){
background.pushSprite(0,0); background.pushSprite(0,0);
} }
void doLedStuff(int ledPin){ // Variables para controlar el parpadeo con millis()
//State 1: Waiting config - on portal mode unsigned long previousMillis = 0;
//State 2: Config ok - but not hashing
//State 3: Hashing
//State 1: void doLedStuff(int ledPin){
//State 2: unsigned long currentMillis = millis();
switch (mMonitor.NerdStatus) {
case NM_waitingConfig: digitalWrite(ledPin, HIGH); // LED encendido de forma continua
break;
case NM_Connecting: if (currentMillis - previousMillis >= 500) { //0.5sec blink
previousMillis = currentMillis;
digitalWrite(ledPin, !digitalRead(ledPin)); // Cambia el estado del LED
}
break;
case NM_hashing: if (currentMillis - previousMillis >= 100) { //0.1sec blink
previousMillis = currentMillis;
digitalWrite(ledPin, !digitalRead(ledPin)); // Cambia el estado del LED
}
break;
}
} }

View File

@ -29,9 +29,16 @@
#define NEXT_HALVING_EVENT 840000 #define NEXT_HALVING_EVENT 840000
#define HALVING_BLOCKS 210000 #define HALVING_BLOCKS 210000
enum NMState {
NM_waitingConfig,
NM_Connecting,
NM_hashing
};
typedef struct{ typedef struct{
uint8_t screen; uint8_t screen;
bool rotation; bool rotation;
NMState NerdStatus;
}monitor_data; }monitor_data;
typedef struct{ typedef struct{
@ -44,6 +51,8 @@ typedef struct{
int halfHourFee; int halfHourFee;
}global_data; }global_data;
void setup_monitor(void); void setup_monitor(void);
void show_MinerScreen(unsigned long mElapsed); void show_MinerScreen(unsigned long mElapsed);
void show_ClockScreen(unsigned long mElapsed); void show_ClockScreen(unsigned long mElapsed);

View File

@ -11,6 +11,7 @@
#include "media/images.h" #include "media/images.h"
#include <TFT_eSPI.h> // Graphics and font library #include <TFT_eSPI.h> // Graphics and font library
#include "wManager.h" #include "wManager.h"
#include "monitor.h"
// JSON configuration file // JSON configuration file
#define JSON_CONFIG_FILE "/config.json" #define JSON_CONFIG_FILE "/config.json"
@ -19,7 +20,7 @@
bool shouldSaveConfig = false; bool shouldSaveConfig = false;
// Variables to hold data from custom textboxes // Variables to hold data from custom textboxes
char poolString[80] = "public-pool.airdns.org"; char poolString[80] = "public-pool.io";
int portNumber = 21496;//3333; int portNumber = 21496;//3333;
char btcString[80] = "yourBtcAddress"; char btcString[80] = "yourBtcAddress";
int GMTzone = 2; //Currently selected in spain int GMTzone = 2; //Currently selected in spain
@ -30,6 +31,7 @@ WiFiManager wm;
extern TFT_eSPI tft; // tft variable declared on main extern TFT_eSPI tft; // tft variable declared on main
extern monitor_data mMonitor;
void saveConfigFile() void saveConfigFile()
// Save Config in JSON format // Save Config in JSON format
@ -239,6 +241,7 @@ void init_WifiManager()
else else
{ {
//Tratamos de conectar con la configuración inicial ya almacenada //Tratamos de conectar con la configuración inicial ya almacenada
mMonitor.NerdStatus = NM_Connecting;
wm.setCaptivePortalEnable(false); // disable captive portal redirection wm.setCaptivePortalEnable(false); // disable captive portal redirection
if (!wm.autoConnect("NerdMinerAP","MineYourCoins")) if (!wm.autoConnect("NerdMinerAP","MineYourCoins"))
{ {
@ -250,6 +253,8 @@ void init_WifiManager()
} }
} }
mMonitor.NerdStatus = NM_Connecting;
//Conectado a la red Wifi //Conectado a la red Wifi
if(WiFi.status() == WL_CONNECTED){ if(WiFi.status() == WL_CONNECTED){
//tft.pushImage(0, 0, MinerWidth, MinerHeight, MinerScreen); //tft.pushImage(0, 0, MinerWidth, MinerHeight, MinerScreen);