Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
BitMaker-hub committed Nov 28, 2023
2 parents c0db9e1 + d1cadd4 commit 2b34e8a
Show file tree
Hide file tree
Showing 25 changed files with 15,363 additions and 2,476 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Every time an stratum job notification is received miner update its current work
- 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 / ⚡[email protected])
- ESP32-cam ([Board Info](https://lastminuteengineers.com/getting-started-with-esp32-cam/) / Dev support: @elmo128)
- M5-StampS3 ([Aliexpress link\*](https://s.click.aliexpress.com/e/_DevABY3) / Dev support: @gyengus)

\*Affiliate links

Expand All @@ -61,7 +62,7 @@ Every time an stratum job notification is received miner update its current work
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/
1. Go to NM2 flasher online: https://flasher.bitronics.store/

#### Standard tool

Expand Down Expand Up @@ -130,7 +131,8 @@ Recommended low difficulty share pools:
| 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.vkbit.com | 3333 | https://vkbit.com/ | Mantained by djerfy - public-pool fork |
| pool.pyblock.xyz | 3333 | https://pool.pyblock.xyz/ | Mantained by curly60e |

Other standard pools not compatible with low difficulty share:

Expand Down Expand Up @@ -207,6 +209,6 @@ With the USB-C port to the right:

If you would like to contribute and help dev team with this project you can send a donation to the following LN address ⚡[email protected]⚡ 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).
If you want to order a fully assembled Nerdminer you can contribute to my job at 🛒[bitronics.store](https://bitronics.store)🛒

Enjoy
Binary file not shown.
Binary file added bin/bin ESP32-devKit/0x10000_firmware_v1.6.3.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified bin/bin LILYGO TDisplay v1.14/0x10000_firmware.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/bin M5-StampS3/0x0000_bootloader.bin
Binary file not shown.
Binary file added bin/bin M5-StampS3/0x10000_firmware_v1.6.3.bin
Binary file not shown.
Binary file added bin/bin M5-StampS3/0x8000_partitions.bin
Binary file not shown.
Binary file added bin/bin M5-StampS3/0xe000_boot_app0.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[platformio]
globallib_dir = lib
default_envs = esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3
default_envs = NerminerV2 ; esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3



Expand Down
398 changes: 398 additions & 0 deletions src/ShaTests/nerdSHA256plus.cpp

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions src/ShaTests/nerdSHA256plus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/************************************************************************************
* written by: Bitmaker
* based on: Blockstream Jade shaLib
* thanks to @LarryBitcoin
* Description:
* NerdSha256plus is a custom C implementation of sha256d based on Blockstream Jade
code https://github.com/Blockstream/Jade
The folowing file can be used on any ESP32 implementation using both cores
*************************************************************************************/
#ifndef nerdSHA256plus_H_
#define nerdSHA256plus_H_

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>


struct nerdSHA256_context {
uint8_t buffer[64];
uint32_t digest[8];
};

/* Calculate midstate */
IRAM_ATTR void nerd_mids(nerdSHA256_context* midstate, uint8_t* dataIn);

IRAM_ATTR bool nerd_sha256d(nerdSHA256_context* midstate, uint8_t* dataIn, uint8_t* doubleHash);

void ByteReverseWords(uint32_t* out, const uint32_t* in, uint32_t byteCount);

#endif /* nerdSHA256plus_H_ */
64 changes: 63 additions & 1 deletion src/drivers/displays/esp23_2432s028r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,68 @@ void esp32_2432S028R_GlobalHashScreen(unsigned long mElapsed)
printheap();
#endif
}
void esp32_2432S028R_BTCprice(unsigned long mElapsed)
{

if (hasChangedScreen) tft.pushImage(0, 0, priceScreenWidth, priceScreenHeight, priceScreen);
hasChangedScreen = false;

clock_data data = getClockData(mElapsed);

Serial.printf(">>> Completed %s share(s), %s Khashes, avg. hashrate %s KH/s\n",
data.completedShares.c_str(), data.totalKHashes.c_str(), data.currentHashRate.c_str());

// Create background sprite to print data at once
createBackgroundSprite(270,36);

// Print background screen
background.pushImage(0, -130, priceScreenWidth, priceScreenHeight, priceScreen);
// Hashrate
render.setFontSize(25);
render.setFontColor(TFT_BLACK);
render.rdrawString(data.currentHashRate.c_str(), 95, 0, TFT_BLACK);

// Print BlockHeight
render.setFontSize(18);
render.rdrawString(data.blockHeight.c_str(), 254, 9, TFT_WHITE);

// Push prepared background to screen
background.pushSprite(0, 130);
// Delete sprite to free the memory heap
background.deleteSprite();

createBackgroundSprite(169,105);
// Print background screen
background.pushImage(-130, -3, priceScreenWidth, priceScreenHeight, priceScreen);

// Print BTC Price
background.setFreeFont(FSSB9);
background.setTextSize(1);
background.setTextDatum(TL_DATUM);
background.setTextColor(TFT_BLACK);
background.drawString(data.currentTime.c_str(), 202-130, 0, GFXFF);

// Print Hour
background.setFreeFont(FF23);
background.setTextSize(2);
background.setTextColor(0xDEDB, TFT_BLACK);
background.drawString(data.btcPrice.c_str(), 0, 50, GFXFF);

// Push prepared background to screen
background.pushSprite(130, 3);

// Delete sprite to free the memory heap
background.deleteSprite();

#ifdef ESP32_2432S028R
printPoolData();
#endif

#ifdef DEBUG_MEMORY
// Print heap
printheap();
#endif
}

void esp32_2432S028R_LoadingScreen(void)
{
Expand Down Expand Up @@ -443,7 +505,7 @@ void esp32_2432S028R_DoLedStuff(unsigned long frame)

}

CyclicScreenFunction esp32_2432S028RCyclicScreens[] = {esp32_2432S028R_MinerScreen, esp32_2432S028R_ClockScreen, esp32_2432S028R_GlobalHashScreen};
CyclicScreenFunction esp32_2432S028RCyclicScreens[] = {esp32_2432S028R_MinerScreen, esp32_2432S028R_ClockScreen, esp32_2432S028R_GlobalHashScreen, esp32_2432S028R_BTCprice};

DisplayDriver esp32_2432S028RDriver = {
esp32_2432S028R_Init,
Expand Down
45 changes: 44 additions & 1 deletion src/drivers/displays/tDisplayDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,49 @@ void tDisplay_GlobalHashScreen(unsigned long mElapsed)
background.pushSprite(0, 0);
}


void tDisplay_BTCprice(unsigned long mElapsed)
{
clock_data data = getClockData(mElapsed);
data.currentDate ="01/12/2023";

//if(data.currentDate.indexOf("12/2023")>) { tDisplay_ChristmasContent(data); return; }

// Print background screen
background.pushImage(0, 0, priceScreenWidth, priceScreenHeight, priceScreen);

Serial.printf(">>> Completed %s share(s), %s Khashes, avg. hashrate %s KH/s\n",
data.completedShares.c_str(), data.totalKHashes.c_str(), data.currentHashRate.c_str());

// Hashrate
render.setFontSize(25);
render.setCursor(19, 122);
render.setFontColor(TFT_BLACK);
render.rdrawString(data.currentHashRate.c_str(), 94, 129, TFT_BLACK);

// Print BlockHeight
render.setFontSize(18);
render.rdrawString(data.blockHeight.c_str(), 254, 138, TFT_WHITE);

// Print Hour

background.setFreeFont(FSSB9);
background.setTextSize(1);
background.setTextDatum(TL_DATUM);
background.setTextColor(TFT_BLACK);
background.drawString(data.currentTime.c_str(), 222, 3, GFXFF);

// Print BTC Price
background.setFreeFont(FF24);
background.setTextDatum(TR_DATUM);
background.setTextSize(1);
background.setTextColor(0xDEDB, TFT_BLACK);
background.drawString(data.btcPrice.c_str(), 300, 58, GFXFF);

// Push prepared background to screen
background.pushSprite(0, 0);
}

void tDisplay_LoadingScreen(void)
{
tft.fillScreen(TFT_BLACK);
Expand All @@ -216,7 +259,7 @@ void tDisplay_DoLedStuff(unsigned long frame)
{
}

CyclicScreenFunction tDisplayCyclicScreens[] = {tDisplay_MinerScreen, tDisplay_ClockScreen, tDisplay_GlobalHashScreen};
CyclicScreenFunction tDisplayCyclicScreens[] = {tDisplay_MinerScreen, tDisplay_ClockScreen, tDisplay_GlobalHashScreen, tDisplay_BTCprice};

DisplayDriver tDisplayDriver = {
tDisplay_Init,
Expand Down
38 changes: 38 additions & 0 deletions src/drivers/displays/tDisplayV1Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,44 @@ void tDisplay_GlobalHashScreen(unsigned long mElapsed)
background.pushSprite(0, 0);
}

void tDisplay_BTCprice(unsigned long mElapsed)
{
clock_data data = getClockData(mElapsed);

// Print background screen
background.pushImage(0, 0, priceScreenWidth, priceScreenHeight, priceScreen);

Serial.printf(">>> Completed %s share(s), %s Khashes, avg. hashrate %s KH/s\n",
data.completedShares.c_str(), data.totalKHashes.c_str(), data.currentHashRate.c_str());

// Hashrate
render.setFontSize(25);
render.setCursor(19, 122);
render.setFontColor(TFT_BLACK);
render.rdrawString(data.currentHashRate.c_str(), 70, 103, TFT_BLACK);

// Print BlockHeight
render.setFontSize(18);
render.rdrawString(data.blockHeight.c_str(), 190, 110, TFT_WHITE);

// Print Hour
background.setFreeFont(FSSB9);
background.setTextSize(1);
background.setTextDatum(TL_DATUM);
background.setTextColor(TFT_BLACK);
background.drawString(data.currentTime.c_str(), 148, 1, GFXFF);

// Print BTC Price
background.setFreeFont(FF24);
background.setTextDatum(TR_DATUM);
background.setTextSize(1);
background.setTextColor(0xDEDB, TFT_BLACK);
background.drawString(data.btcPrice.c_str(), 70, 25, GFXFF);

// Push prepared background to screen
background.pushSprite(0, 0);
}

void tDisplay_LoadingScreen(void)
{
tft.fillScreen(TFT_BLACK);
Expand Down
Loading

0 comments on commit 2b34e8a

Please sign in to comment.