From 60e95f9198a5f1e4a0c898317d2c4f68bb68ec38 Mon Sep 17 00:00:00 2001 From: revoxhere <50244265+revoxhere@users.noreply.github.com> Date: Sun, 31 Dec 2023 12:22:19 +0100 Subject: [PATCH] New ESP code support and Raspberry Pi instructions fix --- getting-started.html | 272 ++++++++++++++++++++++++++++--------------- 1 file changed, 180 insertions(+), 92 deletions(-) diff --git a/getting-started.html b/getting-started.html index 5cb0acc2..352709ae 100644 --- a/getting-started.html +++ b/getting-started.html @@ -41,6 +41,8 @@ + + @@ -407,7 +409,7 @@ Raspberry Pi

- Zero, 1, 2, 3, 4 or 400 (incl. relatives - e.g. Orange Pi) + Zero, 1...5 (incl. relatives - e.g. Orange Pi)

- Download your code and double click on it to open the source file. If Arduino IDE asks you whether to move the file, click OK. - If it doesn't open automatically, in IDE click File, then Open and navigate to the code you just downloaded. + Download the .zip and extract the folder to your desktop. Double click on the ESP_Code.ino to launch it with Arduino IDE.
+ If it doesn't open automatically, in IDE click File, then Open and navigate to the folder you just downloaded. +

+

+ At the top of Arduino IDE you should see all 6 files. If you see only one, you did not extract the .zip file correctly. Make sure all files are in the same folder.


- 6  + 7  Upload miner code to your board.
Make sure to plug in the board to your computer using a USB cable, choose ESP32 Dev board in the Tools  Board  ESP32 Arduino dropdown and select a COM port in Tools  Port list. No need to change anything else - just click the "" upload button and wait until it finishes.

@@ -795,7 +815,7 @@

1  - First up, let's install Arduino IDE. Using this program we can upload codes to many types of microcontrollers, including the ESP8266. You can use the button below or visit Arduino.cc yourself. + First up, let's install Arduino IDE. Using this program we can upload codes to many types of microcontrollers, including the ESP8266. You can use the button below or visit Arduino.cc yourself. We do not recommend using Arduino IDE 2.0+ - you may face problems.

@@ -878,7 +898,7 @@

5  - Prepare your Duino-Coin miner code to your board. + Prepare your Duino-Coin miner code. Below are fields that you should fill in. They will change required variables in the code so you don't have to do it manually (and possibly mess something up).

@@ -929,7 +949,7 @@
@@ -939,17 +959,10 @@ Use unboard status LED
-
- -

- Below you can find a button to download a ready-to-use ESP8266 code with your settings from the input fields above. + Below you can find a button to download a .zip containing your customized code from the input fields above.

@@ -964,12 +977,15 @@

- Download your code and double click on it to open the source file. If Arduino IDE asks you whether to move the file, click OK. - If it doesn't open automatically, in IDE click File, then Open and navigate to the code you just downloaded. + Download the .zip and extract the folder to your desktop. Double click on the ESP_Code.ino to launch it with Arduino IDE.
+ If it doesn't open automatically, in IDE click File, then Open and navigate to the folder you just downloaded. +

+

+ At the top of Arduino IDE you should see all 6 files. If you see only one, you did not extract the .zip file correctly. Make sure all files are in the same folder.


@@ -1155,12 +1171,12 @@   - Latest release (3.3) for Windows 10+ + Latest release (4.0) for Windows 10+   - Latest release (3.3) as source code + Latest release (4.0) as source code
@@ -1199,7 +1215,7 @@

- If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin AVR Miner 3.3 folder. + If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin AVR Miner 4.0 folder.

@@ -1342,7 +1358,7 @@ Raspberry Pi

- Zero, 1, 2, 3, 4 or 400 (incl. relatives - e.g. Orange Pi) + Zero, 1...5 (incl. relatives - e.g. Orange Pi)

@@ -1572,7 +1588,7 @@

- If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin AVR Miner 3.3 folder. + If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin AVR Miner 4.0 folder.

@@ -1756,6 +1772,13 @@ python3 AVR_Miner.py +

+ At first, the miner will (attempt to) automatically install required dependencies via pip. If it fails, you'll need to do it manually using the command it will show.

+ In the newest Python versions it may be impossible to install dependencies due to PIP's policy. To restore the bevahior from previous versions, use these commands: + mkdir ~/.config, then mkdir ~/.config/pip and finally + echo -e "[global]\nbreak-system-packages=true" > ~/.config/pip/pip.conf + After executing these commands, launch the Miner again. +

When starting it for the first time answer it's questions to go through the configuration phase. Note that serial ports on linux are named /dev/ttyUSB* or /dev/ttyACM* (unlike COM* in Windows). @@ -2009,7 +2032,7 @@   - Latest release (3.3) as source code + Latest release (4.0) as source code @@ -2044,7 +2067,7 @@

- If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin PC Miner 3.3 folder. + If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin PC Miner 4.0 folder.

@@ -2158,18 +2181,18 @@

To download the latest source you can use the following command:
- wget https://github.com/revoxhere/duino-coin/archive/refs/tags/3.3.zip + wget https://github.com/revoxhere/duino-coin/archive/refs/tags/4.0.zip


3  After downloading you need to extract the .zip file. You can do this by opening it and moving the contents to your desktop or typing the following command:
- unzip 3.3.zip + unzip 4.0.zip

4  Navigate into the folder you extracted the release to with - cd duino-coin-3.3 and Launch the PC_Miner.py by typing
+ cd duino-coin-4.0 and Launch the PC_Miner.py by typing
python3 PC_Miner.py into your terminal.

@@ -2178,7 +2201,7 @@

- If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin PC Miner 3.3 folder. + If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin PC Miner 4.0 folder.

@@ -2309,12 +2332,17 @@ python3 PC_Miner.py into your terminal.

- At first, the miner will (attempt to) automatically install required dependencies via pip. If it fails, you'll need to do it manually using the command it will provide.
+ At first, the miner will (attempt to) automatically install required dependencies via pip. If it fails, you'll need to do it manually using the command it will show.

+ In the newest Python versions it may be impossible to install dependencies due to PIP's policy. To restore the bevahior from previous versions, use these commands: + mkdir ~/.config, then mkdir ~/.config/pip and finally + echo -e "[global]\nbreak-system-packages=true" > ~/.config/pip/pip.conf + After executing these commands, launch the Miner again. +

From this point the PC Miner should tell you all you need to know. Answer the questions to complete the configuration phase - miner will remember the settings for the future.

- If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin PC Miner 3.3 folder. + If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin PC Miner 4.0 folder.

@@ -2424,18 +2452,18 @@

To download the latest source you can use the following command:
- wget https://github.com/revoxhere/duino-coin/archive/refs/tags/3.3.zip + wget https://github.com/revoxhere/duino-coin/archive/refs/tags/4.0.zip


4  After downloading you need to extract the .zip file. You can do this by opening it and moving the contents to your desktop or typing the following command: - unzip 3.3.zip + unzip 4.0.zip

5  Navigate into the folder you extracted the release to with - cd duino-coin-3.3 and Launch the PC_Miner.py by typing
+ cd duino-coin-4.0 and Launch the PC_Miner.py by typing
python PC_Miner.py into your terminal.

@@ -2444,7 +2472,7 @@

- If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin PC Miner 3.3 folder. + If you want to reset the configuration in the future, simply delete the Settings.cfg file inside the Duino-Coin PC Miner 4.0 folder.

@@ -2988,11 +3016,10 @@
More
path: 'assets/animations/particle_bg.json' });*/ -let latest_release = "3.33"; +let latest_release = "4.03"; $.getJSON('https://api.github.com/repos/revoxhere/duino-coin/releases', function(data) { latest_release = data[0]["tag_name"]; - console.log(latest_release); $(".release_ver").text(latest_release); @@ -3041,47 +3068,81 @@
More
rig_id = $("#esp32_name").val(); enable_dash = $('#esp32_dashboard').is(':checked'); enable_led = $('#esp32_led').is(':checked'); - enable_ota = $('#esp32_ota').is(':checked'); + enable_sensor = $('#esp32_sensor').is(':checked'); if (!miner_pass) miner_pass = "None"; if (!wifi_password) wifi_password = ""; + if (!username || !wifi_name) { alert("Fill in the blanks first!"); return; } $("#esp32_download_button").addClass("is-loading"); - $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP32_Code/ESP32_Code.ino', + + var zip = new JSZip(); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/Settings.h', function(data, textStatus, jqXHR) { - ESP32_CODE = data; + SETTINGS_CODE = data; if (rig_id) { - ESP32_CODE = ESP32_CODE.replace( - `const char *RIG_IDENTIFIER = "None";`, - `const char *RIG_IDENTIFIER = "${rig_id}";`); + SETTINGS_CODE = SETTINGS_CODE.replace( + `extern const char RIG_IDENTIFIER[] = "None";`, + `extern const char RIG_IDENTIFIER[] = "${rig_id}";`); } if (!enable_led) { - ESP32_CODE = ESP32_CODE.replace( - `const bool LED_BLINKING = true;`, - `const bool LED_BLINKING = false;`); + SETTINGS_CODE = SETTINGS_CODE.replace( + `#define LED_BLINKING`, + `// #define LED_BLINKING`); } if (enable_dash) { - ESP32_CODE = ESP32_CODE.replace( + SETTINGS_CODE = SETTINGS_CODE.replace( `// #define WEB_DASHBOARD`, `#define WEB_DASHBOARD`); } - if (enable_ota) { - ESP32_CODE = ESP32_CODE.replace( - `// #define ENABLE_OTA`, - `#define ENABLE_OTA`); + if (enable_sensor) { + SETTINGS_CODE = SETTINGS_CODE.replace( + `// #define USE_INTERNAL_SENSOR`, + `#define USE_INTERNAL_SENSOR`); } - ESP32_CODE = ESP32_CODE.replace(`"USERNAME"`, `"${username}"`); - ESP32_CODE = ESP32_CODE.replace(`"MINING_KEY"`, `"${miner_pass}"`); - ESP32_CODE = ESP32_CODE.replace(`"WIFI_NAME"`, `"${wifi_name}"`); - ESP32_CODE = ESP32_CODE.replace(`"WIFI_PASSWORD"`, `"${wifi_password}"`); - save(ESP32_CODE, `ESP32_Code_v${latest_release}-${username}.ino`) - $("#esp32_download_button").removeClass("is-loading"); + SETTINGS_CODE = SETTINGS_CODE.replace(`"my_cool_username"`, `"${username}"`); + SETTINGS_CODE = SETTINGS_CODE.replace(`"mySecretPass"`, `"${miner_pass}"`); + SETTINGS_CODE = SETTINGS_CODE.replace(`"SSID"`, `"${wifi_name}"`); + SETTINGS_CODE = SETTINGS_CODE.replace(`"PASSW0RD"`, `"${wifi_password}"`); + zip.file("ESP_Code/Settings.h", SETTINGS_CODE); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/MiningJob.h', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/MiningJob.h", data); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/ESP_Code.ino', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/ESP_Code.ino", data); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/Dashboard.h', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/Dashboard.h", data); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/DSHA1.h', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/DSHA1.h", data); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/Counter.h', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/Counter.h", data); + + zip.generateAsync({type:"blob"}).then(function(content) { + save(content, `ESP_Code-${username}.zip`); + }); + + $("#esp32_download_button").removeClass("is-loading"); + }); + }); + }); + }); + }); }); } @@ -3094,47 +3155,74 @@
More
rig_id = $("#esp8266_name").val(); enable_dash = $('#esp8266_dashboard').is(':checked'); enable_led = $('#esp8266_led').is(':checked'); - enable_overclock = $('#esp8266_oc').is(':checked'); if (!miner_pass) miner_pass = "None"; if (!wifi_password) wifi_password = ""; + if (!username || !wifi_name) { alert("Fill in the blanks first!"); return; } $("#esp8266_download_button").addClass("is-loading"); - $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP8266_Code/ESP8266_Code.ino', + var zip = new JSZip(); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/Settings.h', function(data, textStatus, jqXHR) { - ESP8266_CODE = data; + SETTINGS_CODE = data; if (rig_id) { - ESP8266_CODE = ESP8266_CODE.replace( - `const char *RIG_IDENTIFIER = "None";`, - `const char *RIG_IDENTIFIER = "${rig_id}";`); + SETTINGS_CODE = SETTINGS_CODE.replace( + `extern const char RIG_IDENTIFIER[] = "None";`, + `extern const char RIG_IDENTIFIER[] = "${rig_id}";`); } if (!enable_led) { - ESP8266_CODE = ESP8266_CODE.replace( - `const bool LED_BLINKING = true;`, - `const bool LED_BLINKING = false;`); - } - if (!enable_overclock) { - ESP8266_CODE = ESP8266_CODE.replace( - `const bool USE_HIGHER_DIFF = true;`, - `const bool USE_HIGHER_DIFF = false;`); + SETTINGS_CODE = SETTINGS_CODE.replace( + `#define LED_BLINKING`, + `// #define LED_BLINKING`); } if (enable_dash) { - ESP8266_CODE = ESP8266_CODE.replace( - `const bool WEB_DASHBOARD = false;`, - `const bool WEB_DASHBOARD = true;`); + SETTINGS_CODE = SETTINGS_CODE.replace( + `// #define WEB_DASHBOARD`, + `#define WEB_DASHBOARD`); } - ESP8266_CODE = ESP8266_CODE.replace(`"USERNAME"`, `"${username}"`); - ESP8266_CODE = ESP8266_CODE.replace(`"MINING_KEY"`, `"${miner_pass}"`); - ESP8266_CODE = ESP8266_CODE.replace(`"WIFI_NAME"`, `"${wifi_name}"`); - ESP8266_CODE = ESP8266_CODE.replace(`"WIFI_PASSWORD"`, `"${wifi_password}"`); - save(ESP8266_CODE, `ESP8266_Code_v${latest_release}-${username}.ino`) - $("#esp8266_download_button").removeClass("is-loading"); + SETTINGS_CODE = SETTINGS_CODE.replace(`"my_cool_username"`, `"${username}"`); + SETTINGS_CODE = SETTINGS_CODE.replace(`"mySecretPass"`, `"${miner_pass}"`); + SETTINGS_CODE = SETTINGS_CODE.replace(`"SSID"`, `"${wifi_name}"`); + SETTINGS_CODE = SETTINGS_CODE.replace(`"PASSW0RD"`, `"${wifi_password}"`); + zip.file("ESP_Code/Settings.h", SETTINGS_CODE); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/MiningJob.h', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/MiningJob.h", data); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/ESP_Code.ino', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/ESP_Code.ino", data); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/Dashboard.h', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/Dashboard.h", data); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/DSHA1.h', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/DSHA1.h", data); + + $.get('https://raw.githubusercontent.com/revoxhere/duino-coin/master/ESP_Code/Counter.h', + function(data, textStatus, jqXHR) { + zip.file("ESP_Code/Counter.h", data); + + zip.generateAsync({type:"blob"}).then(function(content) { + save(content, `ESP_Code-${username}.zip`); + }); + + $("#esp8266_download_button").removeClass("is-loading"); + }); + }); + }); + }); + }); }); }