From 29ffe62ba875e119662bbea23a76bb7d0a41e585 Mon Sep 17 00:00:00 2001 From: Claudio Benvenuti Date: Thu, 12 Oct 2023 15:19:24 +0200 Subject: [PATCH 1/5] fix regression introduced in 25db0a4 that prevented T-Display_V1 display to updates; fix for displayDriver.h case sensitive filename --- src/drivers/displays/amoledDisplayDriver.cpp | 4 ++-- src/drivers/displays/display.h | 2 +- src/drivers/displays/dongleDisplayDriver.cpp | 4 ++-- src/drivers/displays/esp23_2432s028r.cpp | 4 ++-- src/drivers/displays/noDisplayDriver.cpp | 4 ++-- src/drivers/displays/tDisplayDriver.cpp | 4 ++-- src/drivers/displays/tDisplayV1Driver.cpp | 7 ++----- src/drivers/displays/t_qtDisplayDriver.cpp | 4 ++-- 8 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/drivers/displays/amoledDisplayDriver.cpp b/src/drivers/displays/amoledDisplayDriver.cpp index 4abc576..67fb27c 100644 --- a/src/drivers/displays/amoledDisplayDriver.cpp +++ b/src/drivers/displays/amoledDisplayDriver.cpp @@ -1,4 +1,4 @@ -#include "DisplayDriver.h" +#include "displayDriver.h" #ifdef AMOLED_DISPLAY @@ -243,4 +243,4 @@ DisplayDriver amoledDisplayDriver = { 0, WIDTH, HEIGHT}; -#endif \ No newline at end of file +#endif diff --git a/src/drivers/displays/display.h b/src/drivers/displays/display.h index 2a4a469..f1d321b 100644 --- a/src/drivers/displays/display.h +++ b/src/drivers/displays/display.h @@ -1,7 +1,7 @@ #ifndef DISPLAY_H #define DISPLAY_H -#include "DisplayDriver.h" +#include "displayDriver.h" extern DisplayDriver *currentDisplayDriver; diff --git a/src/drivers/displays/dongleDisplayDriver.cpp b/src/drivers/displays/dongleDisplayDriver.cpp index 9e27d0f..28d45f4 100644 --- a/src/drivers/displays/dongleDisplayDriver.cpp +++ b/src/drivers/displays/dongleDisplayDriver.cpp @@ -1,4 +1,4 @@ -#include "DisplayDriver.h" +#include "displayDriver.h" #ifdef DONGLE_DISPLAY @@ -216,4 +216,4 @@ DisplayDriver dongleDisplayDriver = { WIDTH, HEIGHT}; -#endif \ No newline at end of file +#endif diff --git a/src/drivers/displays/esp23_2432s028r.cpp b/src/drivers/displays/esp23_2432s028r.cpp index 3e783f2..00d3c89 100644 --- a/src/drivers/displays/esp23_2432s028r.cpp +++ b/src/drivers/displays/esp23_2432s028r.cpp @@ -1,4 +1,4 @@ -#include "DisplayDriver.h" +#include "displayDriver.h" #ifdef ESP32_2432S028R @@ -458,4 +458,4 @@ DisplayDriver esp32_2432S028RDriver = { 0, WIDTH, HEIGHT}; -#endif \ No newline at end of file +#endif diff --git a/src/drivers/displays/noDisplayDriver.cpp b/src/drivers/displays/noDisplayDriver.cpp index 636cf81..cc42812 100644 --- a/src/drivers/displays/noDisplayDriver.cpp +++ b/src/drivers/displays/noDisplayDriver.cpp @@ -1,4 +1,4 @@ -#include "DisplayDriver.h" +#include "displayDriver.h" #ifdef NO_DISPLAY @@ -101,4 +101,4 @@ DisplayDriver noDisplayDriver = { 0, 0, }; -#endif \ No newline at end of file +#endif diff --git a/src/drivers/displays/tDisplayDriver.cpp b/src/drivers/displays/tDisplayDriver.cpp index 76eede4..908bb41 100644 --- a/src/drivers/displays/tDisplayDriver.cpp +++ b/src/drivers/displays/tDisplayDriver.cpp @@ -1,4 +1,4 @@ -#include "DisplayDriver.h" +#include "displayDriver.h" #ifdef T_DISPLAY @@ -231,4 +231,4 @@ DisplayDriver tDisplayDriver = { 0, WIDTH, HEIGHT}; -#endif \ No newline at end of file +#endif diff --git a/src/drivers/displays/tDisplayV1Driver.cpp b/src/drivers/displays/tDisplayV1Driver.cpp index 93b8f76..168675e 100644 --- a/src/drivers/displays/tDisplayV1Driver.cpp +++ b/src/drivers/displays/tDisplayV1Driver.cpp @@ -1,4 +1,4 @@ -#include "DisplayDriver.h" +#include "displayDriver.h" #ifdef V1_DISPLAY @@ -96,7 +96,6 @@ void tDisplay_MinerScreen(unsigned long mElapsed) // Push prepared background to screen background.pushSprite(0, 0); - background.deleteSprite(); } void tDisplay_ClockScreen(unsigned long mElapsed) @@ -135,7 +134,6 @@ void tDisplay_ClockScreen(unsigned long mElapsed) // Push prepared background to screen background.pushSprite(0, 0); - background.deleteSprite(); } void tDisplay_GlobalHashScreen(unsigned long mElapsed) @@ -195,7 +193,6 @@ void tDisplay_GlobalHashScreen(unsigned long mElapsed) // Push prepared background to screen background.pushSprite(0, 0); - background.deleteSprite(); } void tDisplay_LoadingScreen(void) @@ -234,4 +231,4 @@ DisplayDriver tDisplayV1Driver = { 0, WIDTH, HEIGHT}; -#endif \ No newline at end of file +#endif diff --git a/src/drivers/displays/t_qtDisplayDriver.cpp b/src/drivers/displays/t_qtDisplayDriver.cpp index f632cae..453bbf2 100644 --- a/src/drivers/displays/t_qtDisplayDriver.cpp +++ b/src/drivers/displays/t_qtDisplayDriver.cpp @@ -1,4 +1,4 @@ -#include "DisplayDriver.h" +#include "displayDriver.h" #ifdef T_QT_DISPLAY @@ -177,4 +177,4 @@ DisplayDriver t_qtDisplayDriver = { 0, WIDTH, HEIGHT}; -#endif \ No newline at end of file +#endif From 50fbd768c0fd680829c3d8766dc9c4ca8adf7711 Mon Sep 17 00:00:00 2001 From: Matteo Crippa Date: Mon, 23 Oct 2023 23:37:45 +0200 Subject: [PATCH 2/5] linted readme --- README.md | 141 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 80 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index e60d13f..45fefce 100644 --- a/README.md +++ b/README.md @@ -1,88 +1,100 @@ # NerdSoloMiner + **The NerdSoloMiner v2** -This is a **free and open source project** that let you try to reach a bitcoin block with a small piece of hardware. +This is a **free and open source project** that let you try to reach a bitcoin block with a small piece of hardware. The main aim of this project is to let you **learn more about minery** and to have a beautiful piece of hardware in your desktop. - Original project https://github.com/valerio-vaccaro/HAN ![image](images/bgNerdMinerV2.png) ## Requirements + - TTGO T-Display S3 or any supported boards (check Build tutorial 👇) - 3D BOX [here](3d_files/) ### Project description + **ESP32 implementing Stratum protocol** to mine on solo pool. Pool can be changed but originally works with Public-pool.io (where Nerdminers are supported). This project was initialy developed using ESP32-S3, but currently support other boards. It uses WifiManager to modify miner settings and save them to SPIFF. The microMiner comes with several screens to monitor it's working procedure and also to show you network mining stats. Currently includes: + - NerdMiner Screen > Mining data of Nerdminer - ClockMiner Screen > Fashion style clock miner - GlobalStats Screen > Global minery stats and relevant data -This miner is multicore and multithreads, both cores are used to mine and several threads are used to implementing stratum work and wifi stuff. -Every time an stratum job notification is received miner update its current work to not create stale shares. +This miner is multicore and multithreads, both cores are used to mine and several threads are used to implementing stratum work and wifi stuff. +Every time an stratum job notification is received miner update its current work to not create stale shares. **IMPORTANT** Miner is not seen by all standard pools due to its low share difficulty. You can check miner work remotely using specific pools specified down or seeing logs via UART. -***Current project is still in developement and more features will be added*** +**_Current project is still in developement and more features will be added_** ## Build Tutorial + ### Hardware requirements + - LILYGO T-Display S3 (original one) or any other supported boards - 3D BOX [here](3d_files/) #### Current Supported Boards -- LILYGO T-Display S3 ([Aliexpress link*](https://s.click.aliexpress.com/e/_Ddy7739)) -- ESP32-WROOM-32, ESP32-Devkit1.. ([Aliexpress link*](https://s.click.aliexpress.com/e/_DCzlUiX)) -- LILYGO T-QT pro ([Aliexpress link*](https://s.click.aliexpress.com/e/_DBQIr43)) -- LILYGO T-Display 1.14 ([Aliexpress link*](https://s.click.aliexpress.com/e/_DEqGvSJ)) -- LILYGO T-Display S3 AMOLED ([Aliexpress link*](https://s.click.aliexpress.com/e/_DmOIK6j)) -- LILYGO T-Dongle S3 ([Aliexpress link*](https://s.click.aliexpress.com/e/_DmQCPyj)) -- ESP32-2432S028R 2,8" ([Aliexpress link*](https://s.click.aliexpress.com/e/_DdXkvLv) / Dev support: @nitroxgas / ⚡jadeddonald78@walletofsatoshi.com) + +- LILYGO T-Display S3 ([Aliexpress link\*](https://s.click.aliexpress.com/e/_Ddy7739)) +- ESP32-WROOM-32, ESP32-Devkit1.. ([Aliexpress link\*](https://s.click.aliexpress.com/e/_DCzlUiX)) +- LILYGO T-QT pro ([Aliexpress link\*](https://s.click.aliexpress.com/e/_DBQIr43)) +- LILYGO T-Display 1.14 ([Aliexpress link\*](https://s.click.aliexpress.com/e/_DEqGvSJ)) +- LILYGO T-Display S3 AMOLED ([Aliexpress link\*](https://s.click.aliexpress.com/e/_DmOIK6j)) +- LILYGO T-Dongle S3 ([Aliexpress link\*](https://s.click.aliexpress.com/e/_DmQCPyj)) +- ESP32-2432S028R 2,8" ([Aliexpress link\*](https://s.click.aliexpress.com/e/_DdXkvLv) / Dev support: @nitroxgas / ⚡jadeddonald78@walletofsatoshi.com) - ESP32-cam ([Board Info](https://lastminuteengineers.com/getting-started-with-esp32-cam/) / Dev support: @elmo128) -*Affiliate links +\*Affiliate links ### Flash firmware + #### microMiners Flashtool [Recommended] + Easyiest way to flash firmware. Build your own miner using the folowing firwmare flash tool: 1. Get a TTGO T-display S3 or any other supported board 1. Go to NM2 flasher online: https://bitmaker-hub.github.io/diyflasher/ #### Standard tool -Create your own miner using the online firwmare flash tool **ESPtool** and one of the **binary files** that you will find in the ``bin`` folder. + +Create your own miner using the online firwmare flash tool **ESPtool** and one of the **binary files** that you will find in the `bin` folder. If you want you can compile the entire project using Arduino, PlatformIO or Expressif IDF. 1. Get a TTGO T-display S3 or any supported board 1. Download this repository 1. Go to ESPtool online: https://espressif.github.io/esptool-js/ -1. Load the firmware with the binary from one of the sub-folders of ``bin`` corresponding to your board. -1. Plug your board and select each file from the sub-folder (``.bin`` files). +1. Load the firmware with the binary from one of the sub-folders of `bin` corresponding to your board. +1. Plug your board and select each file from the sub-folder (`.bin` files). ### Update firmware + Update NerdMiner firmware following same flashing steps but only using the file 0x10000_firmware.bin. #### Build troubleshooting + 1. Online ESPtool works with chrome, chromium, brave 1. ESPtool recommendations: use 115200bps 1. Build errors > If during firmware download upload stops, it's recommended to enter the board in boot mode. Unplug cable, hold right bottom button and then plug cable. Try programming -1. In extreme case you can "Erase all flash" on ESPtool to clean all current configuration before uploading firmware. There has been cases that experimented Wifi failures until this was made. +1. In extreme case you can "Erase all flash" on ESPtool to clean all current configuration before uploading firmware. There has been cases that experimented Wifi failures until this was made. 1. In case of ESP32-WROOM Boards, could be necessary to put your board on boot mode. Hold boot button, press reset button and then program. ## NerdMiner configuration + After programming, you will only need to setup your Wifi and BTC address. #### Wifi Accesspoint 1. Connect to NerdMinerAP - - AP: NerdMinerAP - - PASS: MineYourCoins + - AP: NerdMinerAP + - PASS: MineYourCoins 1. Setup your Wifi Network 1. Add your BTCaddress @@ -90,15 +102,15 @@ After programming, you will only need to setup your Wifi and BTC address. 1. Format a SD card using Fat32. 1. Create a file named "config.json" in your card's root, containing the the following structure. Adjust the settings to your needs: -{ - "SSID": "myWifiSSID", - "WifiPW": "myWifiPassword", - "PoolUrl": "public-pool.io", - "PoolPort": 21496, - "BtcWallet": "walletID", - "Timezone": 2, - "SaveStats": false -} + { + "SSID": "myWifiSSID", + "WifiPW": "myWifiPassword", + "PoolUrl": "public-pool.io", + "PoolPort": 21496, + "BtcWallet": "walletID", + "Timezone": 2, + "SaveStats": false + } 1. Insert the SD card. 1. Hold down the "reset configurations" button as described below to reset the configurations and/or boot without settings in your nvmemory. 1. Power down to remove the SD card. It is not needed for mining. @@ -107,20 +119,20 @@ After programming, you will only need to setup your Wifi and BTC address. Recommended low difficulty share pools: -| Pool URL | Port | Web URL | Status | -|--- |--- |--- |--- | -| public-pool.io | 21496 | https://web.public-pool.io | Open Source Solo Bitcoin Mining Pool supporting open source miners | -| nerdminers.org | | https://nerdminers.org | Team domain for future pool - Currently pointing to public-pool.io | -| pool.nerdminer.io | 3333 | https://nerdminer.io | Mantained by CHMEX | -| pool.vkbit.com | 3333 | https://vkbit.com/ | Mantained by djerfy | +| Pool URL | Port | Web URL | Status | +| ----------------- | ----- | -------------------------- | ------------------------------------------------------------------ | +| public-pool.io | 21496 | https://web.public-pool.io | Open Source Solo Bitcoin Mining Pool supporting open source miners | +| nerdminers.org | | https://nerdminers.org | Team domain for future pool - Currently pointing to public-pool.io | +| pool.nerdminer.io | 3333 | https://nerdminer.io | Mantained by CHMEX | +| pool.vkbit.com | 3333 | https://vkbit.com/ | Mantained by djerfy | Other standard pools not compatible with low difficulty share: -| Pool URL | Port | Web URL | -|--- |--- |--- | -| solo.ckpool.org | 3333 | https://solo.ckpool.org/ | +| Pool URL | Port | Web URL | +| ------------------------ | ---- | ----------------------------------------- | +| solo.ckpool.org | 3333 | https://solo.ckpool.org/ | | btc.zsolo.bid | 6057 | https://zsolo.bid/en/btc-solo-mining-pool | -| eu.stratum.slushpool.com | 3333 | https://braiins.com/pool | +| eu.stratum.slushpool.com | 3333 | https://braiins.com/pool | ### Buttons @@ -129,16 +141,17 @@ Other standard pools not compatible with low difficulty share: - One click > change screen. - Double click > change screen orientation. - Tripple click > turn the screen off and on again. -- Hold 5 seconds > **reset the configurations and reboot** your NerdMiner. +- Hold 5 seconds > **reset the configurations and reboot** your NerdMiner. #### Two button devices: + With the USB-C port to the right: **TOP BUTTON** -- One click > change screen. -- Hold 5 seconds > top right button to **reset the configurations and reboot** your NerdMiner. -- Hold and power up > enter **configuration mode** and edit current config via Wifi. You could change your settings or verify them. +- One click > change screen. +- Hold 5 seconds > top right button to **reset the configurations and reboot** your NerdMiner. +- Hold and power up > enter **configuration mode** and edit current config via Wifi. You could change your settings or verify them. **BOTTOM BUTTON** @@ -146,39 +159,45 @@ With the USB-C port to the right: - Double click > change orientation (default is USB-C to the right) #### Build video + [![Ver video aquí](https://img.youtube.com/vi/POUT2R_opDs/0.jpg)](https://youtu.be/POUT2R_opDs) ## Developers + ### Project guidelines + - Current project was addapted to work with PlatformIO - Current project works with ESP32-S3 and ESP32-wroom. - Partition squeme should be build as huge app - All libraries needed shown on platform.ini ### Job done -- [x] Move project to platformIO -- [x] Bug rectangle on screen when 1milion shares -- [x] Bug memory leaks -- [x] Bug Reboots when received JSON contains some null values -- [x] Implement midstate sha256 -- [x] Bug Wificlient DNS unresolved on Wifi.h -- [x] Code refactoring -- [x] Add blockHeight to screen -- [x] Add clock to show current time -- [x] Add new screen with global mining stats -- [x] Add pool support for low difficulty miners -- [x] Add best difficulty on miner screen -- [x] Add suport to standard ESP32 dev-kit / ESP32-WROOM -- [x] Code changes to support adding multiple boards -- [x] Add support to TTGO T-display 1.14 -- [x] Add support to Amoled + +- [x] Move project to platformIO +- [x] Bug rectangle on screen when 1milion shares +- [x] Bug memory leaks +- [x] Bug Reboots when received JSON contains some null values +- [x] Implement midstate sha256 +- [x] Bug Wificlient DNS unresolved on Wifi.h +- [x] Code refactoring +- [x] Add blockHeight to screen +- [x] Add clock to show current time +- [x] Add new screen with global mining stats +- [x] Add pool support for low difficulty miners +- [x] Add best difficulty on miner screen +- [x] Add suport to standard ESP32 dev-kit / ESP32-WROOM +- [x] Code changes to support adding multiple boards +- [x] Add support to TTGO T-display 1.14 +- [x] Add support to Amoled ### On process -- [ ] Create a daisy chain protocol via UART or I2C to support ESP32 hashboards -- [ ] Create new screen like clockMiner but with BTC price -- [ ] Add support to control BM1397 + +- [ ] Create a daisy chain protocol via UART or I2C to support ESP32 hashboards +- [ ] Create new screen like clockMiner but with BTC price +- [ ] Add support to control BM1397 ### Donations/Project contributions + If you would like to contribute and help dev team with this project you can send a donation to the following LN address ⚡teamnerdminer@getalby.com⚡ or using one of the affiliate links above. If you want to order a fully assembled Nerdminer you can contribute to my job at [bitronics.store](https://bitronics.store). From ac8b9614b14d5e2ce08fd60d9da651fea24a74ec Mon Sep 17 00:00:00 2001 From: Matteo Crippa Date: Mon, 23 Oct 2023 23:38:53 +0200 Subject: [PATCH 3/5] add public pool link for context --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45fefce..6fd34e3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Original project https://github.com/valerio-vaccaro/HAN ### Project description -**ESP32 implementing Stratum protocol** to mine on solo pool. Pool can be changed but originally works with Public-pool.io (where Nerdminers are supported). +**ESP32 implementing Stratum protocol** to mine on solo pool. Pool can be changed but originally works with [public-pool.io][https://web.public-pool.io] (where Nerdminers are supported). This project was initialy developed using ESP32-S3, but currently support other boards. It uses WifiManager to modify miner settings and save them to SPIFF. The microMiner comes with several screens to monitor it's working procedure and also to show you network mining stats. From 0077c078e7fb4d3dd80cd02dcbdd1cd84aafd32d Mon Sep 17 00:00:00 2001 From: Matteo Crippa Date: Mon, 23 Oct 2023 23:42:52 +0200 Subject: [PATCH 4/5] add description for worker name --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6fd34e3..06cd810 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ After programming, you will only need to setup your Wifi and BTC address. - PASS: MineYourCoins 1. Setup your Wifi Network 1. Add your BTCaddress + - If you are using public-pool.io and you want to set a custom name to your worker you can append a string with format _.yourworkername_ to the address #### SD card (if available) @@ -195,6 +196,7 @@ With the USB-C port to the right: - [ ] Create a daisy chain protocol via UART or I2C to support ESP32 hashboards - [ ] Create new screen like clockMiner but with BTC price - [ ] Add support to control BM1397 +- [ ] Add password field in web configuration form ### Donations/Project contributions From 9d69fdfb2f0a10b5fe13778572320f78a0bbbdca Mon Sep 17 00:00:00 2001 From: Matteo Crippa Date: Mon, 23 Oct 2023 23:44:46 +0200 Subject: [PATCH 5/5] post linting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06cd810..81d415b 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ After programming, you will only need to setup your Wifi and BTC address. - PASS: MineYourCoins 1. Setup your Wifi Network 1. Add your BTCaddress - - If you are using public-pool.io and you want to set a custom name to your worker you can append a string with format _.yourworkername_ to the address + - If you are using public-pool.io and you want to set a custom name to your worker you can append a string with format _.yourworkername_ to the address #### SD card (if available)