diff --git a/bin/0x10000_firmware_v1.4.bin b/bin/0x10000_firmware_v1.4.bin deleted file mode 100644 index 184af60..0000000 Binary files a/bin/0x10000_firmware_v1.4.bin and /dev/null differ diff --git a/bin/bin ESP32-devKit/0x10000_firmware.bin b/bin/bin ESP32-devKit/0x10000_firmware.bin new file mode 100644 index 0000000..fece883 Binary files /dev/null and b/bin/bin ESP32-devKit/0x10000_firmware.bin differ diff --git a/bin/bin ESP32-devKit/0x1000_bootloader.bin b/bin/bin ESP32-devKit/0x1000_bootloader.bin new file mode 100644 index 0000000..bfc27cf Binary files /dev/null and b/bin/bin ESP32-devKit/0x1000_bootloader.bin differ diff --git a/bin/0x8000_partitions.bin b/bin/bin ESP32-devKit/0x8000_partitions.bin similarity index 100% rename from bin/0x8000_partitions.bin rename to bin/bin ESP32-devKit/0x8000_partitions.bin diff --git a/bin/0xe000_boot_app0.bin b/bin/bin ESP32-devKit/0xe000_boot_app0.bin similarity index 100% rename from bin/0xe000_boot_app0.bin rename to bin/bin ESP32-devKit/0xe000_boot_app0.bin diff --git a/bin/0x0000_bootloader.bin b/bin/bin TTGO TDisplay S3/0x0000_bootloader.bin similarity index 100% rename from bin/0x0000_bootloader.bin rename to bin/bin TTGO TDisplay S3/0x0000_bootloader.bin diff --git a/bin/0x10000_firmware_v1.5.2.bin b/bin/bin TTGO TDisplay S3/0x10000_firmware_v1.5.2.bin similarity index 100% rename from bin/0x10000_firmware_v1.5.2.bin rename to bin/bin TTGO TDisplay S3/0x10000_firmware_v1.5.2.bin diff --git a/bin/0x10000_firmware_v1.6.0.bin b/bin/bin TTGO TDisplay S3/0x10000_firmware_v1.6.0.bin similarity index 100% rename from bin/0x10000_firmware_v1.6.0.bin rename to bin/bin TTGO TDisplay S3/0x10000_firmware_v1.6.0.bin diff --git a/bin/0x10000_firmware_v1.5.1.bin b/bin/bin TTGO TDisplay S3/0x10000_firmware_v1.6.1.bin similarity index 60% rename from bin/0x10000_firmware_v1.5.1.bin rename to bin/bin TTGO TDisplay S3/0x10000_firmware_v1.6.1.bin index 7827ef7..bef999e 100644 Binary files a/bin/0x10000_firmware_v1.5.1.bin and b/bin/bin TTGO TDisplay S3/0x10000_firmware_v1.6.1.bin differ diff --git a/bin/bin TTGO TDisplay S3/0x8000_partitions.bin b/bin/bin TTGO TDisplay S3/0x8000_partitions.bin new file mode 100644 index 0000000..1954582 Binary files /dev/null and b/bin/bin TTGO TDisplay S3/0x8000_partitions.bin differ diff --git a/bin/bin TTGO TDisplay S3/0xe000_boot_app0.bin b/bin/bin TTGO TDisplay S3/0xe000_boot_app0.bin new file mode 100644 index 0000000..13562ca Binary files /dev/null and b/bin/bin TTGO TDisplay S3/0xe000_boot_app0.bin differ diff --git a/platformio.ini b/platformio.ini index 8ef599c..f33cba1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -59,10 +59,7 @@ 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 DEVKITV1=1 @@ -73,7 +70,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 + [env:TTGO-T-Display] platform = espressif32 diff --git a/src/NerdMinerV2.ino.cpp b/src/NerdMinerV2.ino.cpp index d99eaa5..c0ebf37 100644 --- a/src/NerdMinerV2.ino.cpp +++ b/src/NerdMinerV2.ino.cpp @@ -16,7 +16,7 @@ #include "mining.h" #include "monitor.h" -#define CURRENT_VERSION "V1.6.0" +#define CURRENT_VERSION "V1.6.1" //3 seconds WDT #define WDT_TIMEOUT 3 @@ -27,6 +27,7 @@ OneButton button2(PIN_BUTTON_2); OpenFontRender render; +extern monitor_data mMonitor; /**********************⚡ GLOBAL Vars *******************************/ TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h @@ -109,9 +110,15 @@ void setup() tft.fillScreen(TFT_BLACK); tft.pushImage(0, 0, initWidth, initHeight, initScreen); tft.setTextColor(TFT_BLACK); - tft.drawString(CURRENT_VERSION, 24, 130, FONT2); + tft.drawString(CURRENT_VERSION, 24, 147, FONT2); delay(2000); + /******** SHOW LED INIT STATUS (devices without screen) *****/ + mMonitor.NerdStatus = NM_waitingConfig; + #ifdef DEVKITV1 + doLedStuff(LED_PIN); + #endif + /******** INIT WIFI ************/ init_WifiManager(); diff --git a/src/mining.cpp b/src/mining.cpp index 38a2174..98d1ed8 100644 --- a/src/mining.cpp +++ b/src/mining.cpp @@ -123,6 +123,7 @@ void runStratumWorker(void *name) { if(WiFi.status() != WL_CONNECTED){ // WiFi is disconnected, so reconnect now + mMonitor.NerdStatus = NM_Connecting; WiFi.reconnect(); vTaskDelay(5000 / portTICK_PERIOD_MS); continue; @@ -248,6 +249,8 @@ void runMiner(void * task_id) { mMiner.newJob2 = false; //Clear newJob flag mMiner.inRun = true; //Set inRun flag + mMonitor.NerdStatus = NM_hashing; + //Prepare Premining data nerd_sha256 nerdMidstate; //nerdSHA256_context nerdMidstate; //NerdShaplus diff --git a/src/monitor.cpp b/src/monitor.cpp index 0592fd5..02f3033 100644 --- a/src/monitor.cpp +++ b/src/monitor.cpp @@ -422,12 +422,28 @@ void show_GlobalHashScreen(unsigned long mElapsed){ background.pushSprite(0,0); } -void doLedStuff(int ledPin){ - //State 1: Waiting config - on portal mode - //State 2: Config ok - but not hashing - //State 3: Hashing +// Variables para controlar el parpadeo con millis() +unsigned long previousMillis = 0; - //State 1: - - //State 2: +void doLedStuff(int ledPin){ + + 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; + } } \ No newline at end of file diff --git a/src/monitor.h b/src/monitor.h index 30ad60d..1e1aaac 100644 --- a/src/monitor.h +++ b/src/monitor.h @@ -29,9 +29,16 @@ #define NEXT_HALVING_EVENT 840000 #define HALVING_BLOCKS 210000 +enum NMState { + NM_waitingConfig, + NM_Connecting, + NM_hashing +}; + typedef struct{ uint8_t screen; bool rotation; + NMState NerdStatus; }monitor_data; typedef struct{ @@ -44,6 +51,8 @@ typedef struct{ int halfHourFee; }global_data; + + void setup_monitor(void); void show_MinerScreen(unsigned long mElapsed); void show_ClockScreen(unsigned long mElapsed); diff --git a/src/wManager.cpp b/src/wManager.cpp index 4bd45c0..48bba09 100644 --- a/src/wManager.cpp +++ b/src/wManager.cpp @@ -11,6 +11,7 @@ #include "media/images.h" #include // Graphics and font library #include "wManager.h" +#include "monitor.h" // JSON configuration file #define JSON_CONFIG_FILE "/config.json" @@ -19,7 +20,7 @@ bool shouldSaveConfig = false; // Variables to hold data from custom textboxes -char poolString[80] = "public-pool.airdns.org"; +char poolString[80] = "public-pool.io"; int portNumber = 21496;//3333; char btcString[80] = "yourBtcAddress"; int GMTzone = 2; //Currently selected in spain @@ -30,6 +31,7 @@ WiFiManager wm; extern TFT_eSPI tft; // tft variable declared on main +extern monitor_data mMonitor; void saveConfigFile() // Save Config in JSON format @@ -239,6 +241,7 @@ void init_WifiManager() else { //Tratamos de conectar con la configuración inicial ya almacenada + mMonitor.NerdStatus = NM_Connecting; wm.setCaptivePortalEnable(false); // disable captive portal redirection if (!wm.autoConnect("NerdMinerAP","MineYourCoins")) { @@ -250,6 +253,8 @@ void init_WifiManager() } } + mMonitor.NerdStatus = NM_Connecting; + //Conectado a la red Wifi if(WiFi.status() == WL_CONNECTED){ //tft.pushImage(0, 0, MinerWidth, MinerHeight, MinerScreen);