Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V/0.0.15 #36

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ jobs:

- name: Archive Firmware
run: |
declare -A current_board=$(basename $(dirname {}))

find .pio/build -name "firmware.bin" -exec sh -c 'cp "{}" "artifacts/firmware_$(basename $(dirname {})).bin"' \;

working-directory: ${{ github.workspace }}

- name: Archive OTA ESP32
run: |
find .pio/build -name "firmware.bin" -exec sh -c 'cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin "artifacts/0xe000_boot_$(basename $(dirname {})).bin"' \;

working-directory: ${{ github.workspace }}

- name: Archive Artifacts with Address
run: |
# Define the mapping of board names to file prefixes
Expand Down
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# v0.0.14
# v0.0.15

- Investigated issue with reboot on ESP8266
- Add support for disable auto update to WebUI
- Fix WebUI bug for blinking
- Add new build script with address to write the binaries
- Updated readme
- Fix setup.html adding auto update
- Fix configuration dump
- Tweak ESP8266 hash rate print
- Add 0xe000 for esp32 for boot
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ _Legend_

| Board | Link |
| :------------------------------------------------------- | :----------------------------------------------------------- |
| [ESP8266](https://s.click.aliexpress.com/e/_EuwffHJ) | [0.0.14](https://github.com/matteocrippa/leafminer/releases) |
| [GeekMagic SmartTV]() | [0.0.14](https://github.com/matteocrippa/leafminer/releases) |
| [ESP32](https://s.click.aliexpress.com/e/_Ey6AJnT) | [0.0.14](https://github.com/matteocrippa/leafminer/releases) |
| [ESP32-S2](https://s.click.aliexpress.com/e/_EGJcibR) | [0.0.14](https://github.com/matteocrippa/leafminer/releases) |
| [ESP32-S3](https://s.click.aliexpress.com/e/_EJbAXyl) | [0.0.14](https://github.com/matteocrippa/leafminer/releases) |
| [LILYGO-T-S3](https://s.click.aliexpress.com/e/_ExRWk6H) | [0.0.14](https://github.com/matteocrippa/leafminer/releases) |
| [ESP8266](https://s.click.aliexpress.com/e/_EuwffHJ) | [0.0.15](https://github.com/matteocrippa/leafminer/releases) |
| [GeekMagic SmartTV]() | [0.0.15](https://github.com/matteocrippa/leafminer/releases) |
| [ESP32](https://s.click.aliexpress.com/e/_Ey6AJnT) | [0.0.15](https://github.com/matteocrippa/leafminer/releases) |
| [ESP32-S2](https://s.click.aliexpress.com/e/_EGJcibR) | [0.0.15](https://github.com/matteocrippa/leafminer/releases) |
| [ESP32-S3](https://s.click.aliexpress.com/e/_EJbAXyl) | [0.0.15](https://github.com/matteocrippa/leafminer/releases) |
| [LILYGO-T-S3](https://s.click.aliexpress.com/e/_ExRWk6H) | [0.0.15](https://github.com/matteocrippa/leafminer/releases) |

- Browse to [ESPWebtool](https://esp.huhn.me/) using a Chrome based browser and upload the file according to the address in the file name.

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The following versions of LeafMiner are currently supported with security updates:

- 0.0.14
- 0.0.15

## Reporting a Vulnerability

Expand Down
4 changes: 3 additions & 1 deletion src/html/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#ifndef HTML_SETUP_H
#define HTML_SETUP_H

const char html_setup[] = "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><title>LeafMiner Setup</title><style> body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 20px; } form { max-width: 400px; margin: 0 auto; background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } p { width: auto; text-align: center; } label { display: block; margin-bottom: 8px; } input { width: 100%; padding: 8px; margin-bottom: 16px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; } input[type=\"radio\"] { width: auto; } input[type=\"submit\"] { background-color: #4caf50; color: #fff; cursor: pointer; } input[type=\"submit\"]:hover { background-color: #45a049; } </style></head><body><form method=\"post\" action=\"/save\"><h1>LeafMiner</h1><label>SSID:</label><input type=\"text\" name=\"wifi_ssid\" value=\"{{wifi_ssid}}\" /><br /><label>Password:</label><input type=\"password\" name=\"wifi_password\" value=\"{{wifi_password}}\" /><br /><label>Wallet Address:</label><input type=\"text\" name=\"wallet_address\" value=\"{{wallet_address}}\" /><br /><label>Pool Password:</label><input type=\"password\" name=\"pool_password\" value=\"{{pool_password}}\" /><br /><label>Pool URL:</label><input type=\"text\" name=\"pool_url\" value=\"{{pool_url}}\" /><br /><label>Pool Port:</label><input type=\"number\" name=\"pool_port\" value=\"{{pool_port}}\" /><br /><label>Blinking Enabled:</label> Off <input type=\"radio\" id=\"lcd_on_start_off\" name=\"blink_enabled\" value=\"off\" {{blink_enabled_off}} /> On <input type=\"radio\" id=\"lcd_on_start_on\" name=\"blink_enabled\" value=\"on\" {{blink_enabled_on}} /><br /><label>Blinking Brightness:</label><input type=\"number\" name=\"blink_brightness\" value=\"{{blink_brightness}}\" /><br /><label>LCD Status on Start:</label> Off <input type=\"radio\" id=\"lcd_on_start_off\" name=\"lcd_on_start\" value=\"off\" {{lcd_on_start_off}} /> On <input type=\"radio\" id=\"lcd_on_start_on\" name=\"lcd_on_start\" value=\"on\" {{lcd_on_start_on}} /><br /><input type=\"submit\" value=\"Save\" /></form><br /><br /><p><a href=\"/ota\">Firmware Upgrade</a></p></body></html>";
#include <string>

const std::string html_setup = "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><title>LeafMiner Setup</title><style> body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 20px; } form { max-width: 400px; margin: 0 auto; background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } p { width: auto; text-align: center; } label { display: block; margin-bottom: 8px; } input { width: 100%; padding: 8px; margin-bottom: 16px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; } input[type=\"radio\"] { width: auto; } input[type=\"submit\"] { background-color: #4caf50; color: #fff; cursor: pointer; } input[type=\"submit\"]:hover { background-color: #45a049; } </style></head><body><form method=\"post\" action=\"/save\"><h1>LeafMiner</h1><label>SSID:</label><input type=\"text\" name=\"wifi_ssid\" value=\"{{wifi_ssid}}\" /><br /><label>Password:</label><input type=\"password\" name=\"wifi_password\" value=\"{{wifi_password}}\" /><br /><label>Wallet Address:</label><input type=\"text\" name=\"wallet_address\" value=\"{{wallet_address}}\" /><br /><label>Pool Password:</label><input type=\"password\" name=\"pool_password\" value=\"{{pool_password}}\" /><br /><label>Pool URL:</label><input type=\"text\" name=\"pool_url\" value=\"{{pool_url}}\" /><br /><label>Pool Port:</label><input type=\"number\" name=\"pool_port\" value=\"{{pool_port}}\" /><br /><label>Auto Update:</label> Off <input type=\"radio\" id=\"auto_update_off\" name=\"auto_update\" value=\"off\" {{auto_update_off}} /> On <input type=\"radio\" id=\"auto_update_on\" name=\"auto_update\" value=\"on\" {{auto_update_on}} /><br /><label>Blinking Enabled:</label> Off <input type=\"radio\" id=\"blink_enabled_off\" name=\"blink_enabled\" value=\"off\" {{blink_enabled_off}} /> On <input type=\"radio\" id=\"blink_enabled_on\" name=\"blink_enabled\" value=\"on\" {{blink_enabled_on}} /><br /><label>Blinking Brightness:</label><input type=\"number\" name=\"blink_brightness\" value=\"{{blink_brightness}}\" /><br /><label>LCD Status on Start:</label> Off <input type=\"radio\" id=\"lcd_on_start_off\" name=\"lcd_on_start\" value=\"off\" {{lcd_on_start_off}} /> On <input type=\"radio\" id=\"lcd_on_start_on\" name=\"lcd_on_start\" value=\"on\" {{lcd_on_start_on}} /><br /><input type=\"submit\" value=\"Save\" /></form><br /><br /><p><a href=\"/ota\">Firmware Upgrade</a></p></body></html>";

#endif // HTML_SETUP_H
2 changes: 1 addition & 1 deletion src/leafminer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef LEAFMINER_H
#define LEAFMINER_H

#define _VERSION "0.0.14"
#define _VERSION "0.0.15"
#define DIFFICULTY 1e-4

// Mining
Expand Down
7 changes: 6 additions & 1 deletion src/miner/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ void miner(uint32_t core)
{
break;
}

#if defined(ESP32)
current_update_hashrate();
#endif
}

#if defined(HAS_LCD)
Expand All @@ -50,6 +51,10 @@ void miner(uint32_t core)
l_info(TAG_MINER, "[%d] > [%s] > 0x%.8x - diff %.12f", core, current_job->job_id.c_str(), winning_nonce, diff_hash);
network_send(current_job->job_id, current_job->extranonce2, current_job->ntime, winning_nonce);

#if defined(ESP8266)
current_update_hashrate();
#endif

current_setHighestDifficulty(diff_hash);

if (littleEndianCompare(hash, current_job->target.value, 32) < 0)
Expand Down
24 changes: 13 additions & 11 deletions src/model/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <stdio.h>
#include "utils/log.h"

#define TAG_CONFIGURATION "Configuration"

struct Configuration
{
std::string wifi_ssid = "";
Expand All @@ -21,17 +23,17 @@ struct Configuration

void print()
{
l_info("wifi_ssid: %s", wifi_ssid.c_str());
l_info("wifi_password: %s", wifi_password.c_str());
l_info("wallet_address: %s", wallet_address.c_str());
l_info("pool_password: %s", pool_password.c_str());
l_info("pool_url: %s", pool_url.c_str());
l_info("pool_port: %d", std::to_string(pool_port).c_str());
l_info("blink_enabled: %s", blink_enabled.c_str());
l_info("blink_brightness: %s", std::to_string(blink_brightness).c_str());
l_info("lcd_on_start: %s", lcd_on_start.c_str());
l_info("miner_type: %s", miner_type.c_str());
l_info("auto_update: %s", auto_update.c_str());
l_info(TAG_CONFIGURATION, "wifi_ssid: %s", wifi_ssid.c_str());
l_info(TAG_CONFIGURATION, "wifi_password: %s", wifi_password.c_str());
l_info(TAG_CONFIGURATION, "wallet_address: %s", wallet_address.c_str());
l_info(TAG_CONFIGURATION, "pool_password: %s", pool_password.c_str());
l_info(TAG_CONFIGURATION, "pool_url: %s", pool_url.c_str());
l_info(TAG_CONFIGURATION, "pool_port: %d", std::to_string(pool_port).c_str());
l_info(TAG_CONFIGURATION, "blink_enabled: %s", blink_enabled.c_str());
l_info(TAG_CONFIGURATION, "blink_brightness: %s", std::to_string(blink_brightness).c_str());
l_info(TAG_CONFIGURATION, "lcd_on_start: %s", lcd_on_start.c_str());
l_info(TAG_CONFIGURATION, "miner_type: %s", miner_type.c_str());
l_info(TAG_CONFIGURATION, "auto_update: %s", auto_update.c_str());
}
};

Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"current": "0.0.14",
"current": "0.0.15",
"link": "https://github.com/matteocrippa/leafminer/releases/download/v{{version}}/firmware_{{device}}.bin",
"devices": [
"esp8266",
Expand Down
Loading