Bitcoin Forum
April 28, 2024, 03:34:47 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner  (Read 475 times)
MrMik
Member
**
Offline Offline

Activity: 199
Merit: 37


View Profile
December 13, 2022, 10:13:43 PM
Last edit: December 13, 2022, 10:41:15 PM by MrMik
 #21

GPIO Setup
[1] Download WiringOP to get access to GPIO of the Orange Pi 4.
Code:
cd /home/admin
git clone https://github.com/orangepi-xunlong/WiringOP
cd WiringOP

I installed Armbian_22.11.1_Orangepi4-lts_bullseye_current_5.15.80_minimal.img.xz onto an SD card and managed to boot it up and connect to WiFi.
Looks like no GUI available.

So I tried to follow the instructions but I'm running into some issues.

I managed to figure out
Code:
sudo apt update && sudo apt install armbian-config
and
Code:
sudo apt install git
but now I'm stuck at
Code:
git clone https://github.com/orangepi-xunlong/WiringOP

It asks for a user name and password for https://github.com. I dug one up from my password manager and tried various combinations of user name and email address, but always get an error message :
Quote
Support for password authenticatiion was removed on August 13, 2021.

It directs me to https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls which sends me to https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token and https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/adding-and-cloning-repositories/cloning-a-repository-from-github-to-github-desktop .

And I cannot make any sense of it.

So
Code:
cd wiringOP
still returns: No such file or directory

Meanwhile, Polli is not mining but the fan is howling at full speed, not a pleasant way to try to figure this out.

Need to get a suitable 5V power supply to separate OrangePi4 and ASIC board, I think.

ADDITION: I just noticed that
Code:
git clone https://github.com/orangepi-xunlong/WiringOP
- when used on my Ubuntu laptop - does NOT ask for a password and it does create the wiringOP directory as it should.

Any idea why armbian does not want to cooperate on this?
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
n0nce (OP)
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5814


not your keys, not your coins!


View Profile WWW
December 13, 2022, 11:08:14 PM
 #22

ADDITION: I just noticed that
Code:
git clone https://github.com/orangepi-xunlong/WiringOP
- when used on my Ubuntu laptop - does NOT ask for a password and it does create the wiringOP directory as it should.
Any idea why armbian does not want to cooperate on this?
Probably your Ubuntu has GitHub credentials set up.

You can try to clone the repo like this instead:
Code:
git clone git://github.com/orangepi-xunlong/wiringOP.git

Or otherwise download it as zip, unpack and rename it.
Code:
wget https://github.com/orangepi-xunlong/wiringOP/archive/refs/heads/master.zip
unzip wiringOP-master.zip
mv wiringOP-master wiringOP

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
MrMik
Member
**
Offline Offline

Activity: 199
Merit: 37


View Profile
December 16, 2022, 07:49:55 AM
Last edit: December 18, 2022, 02:26:25 AM by MrMik
Merited by n0nce (2)
 #23

GPIO Setup
[1] Download WiringOP to get access to GPIO of the Orange Pi 4.
Code:
cd /home/admin
git clone https://github.com/orangepi-xunlong/WiringOP
cd WiringOP

[2] Build the software
Code:
./build clean
./build

[3] Verify you have GPIO access.
Code:
cd && gpio -v && gpio readall

[4] The above command should output something like this.
Code:
gpio version: 2.46
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

   * Device tree is enabled.
   *--> OrangePi 4

 +------+-----+----------+------+---+OrangePi 4+---+---+--+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | GPIO |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
 |      |     |     3.3V |      |   |  1 || 2  |   |      | 5V       |     |      |
 |   64 |   0 | I2C2_SDA |   IN | 1 |  3 || 4  |   |      | 5V       |     |      |
 |   65 |   1 | I2C2_SCL |   IN | 1 |  5 || 6  |   |      | GND      |     |      |
 |  150 |   2 |     PWM1 | ALT2 | 1 |  7 || 8  | 1 | ALT2 | I2C3_SCL | 3   | 145  |
 |      |     |      GND |      |   |  9 || 10 | 1 | ALT2 | I2C3_SDA | 4   | 144  |
 |   33 |   5 | GPIO1_A1 |   IN | 0 | 11 || 12 | 1 | IN   | GPIO1_C2 | 6   | 50   |
 |   35 |   7 | GPIO1_A3 |  OUT | 1 | 13 || 14 |   |      | GND      |     |      |
 |   92 |   8 | GPIO2_D4 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO1_C6 | 9   | 54   |
 |      |     |     3.3V |      |   | 17 || 18 | 0 | IN   | GPIO1_C7 | 10  | 55   |
 |   40 |  11 | SPI1_TXD | ALT3 | 0 | 19 || 20 |   |      | GND      |     |      |
 |   39 |  12 | SPI1_RXD | ALT3 | 1 | 21 || 22 | 0 | IN   | GPIO1_D0 | 13  | 56   |
 |   41 |  14 | SPI1_CLK | ALT3 | 1 | 23 || 24 | 1 | ALT3 | SPI1_CS  | 15  | 42   |
 |      |     |      GND |      |   | 25 || 26 | 0 | IN   | GPIO4_C5 | 16  | 149  |
 |   64 |  17 | I2C2_SDA |   IN | 1 | 27 || 28 | 1 | IN   | I2C2_SCL | 18  | 65   |
 |      |     |  I2S0_RX |      |   | 29 || 30 |   |      | GND      |     |      |
 |      |     |  I2S0_TX |      |   | 31 || 32 |   |      | I2S_CLK  |     |      |
 |      |     | I2S0_SCK |      |   | 33 || 34 |   |      | GND      |     |      |
 |      |     | I2S0_SI0 |      |   | 35 || 36 |   |      | I2S0_SO0 |     |      |
 |      |     | I2S0_SI1 |      |   | 37 || 38 |   |      | I2S0_SI2 |     |      |
 |      |     |      GND |      |   | 39 || 40 |   |      | I2S0_SI3 |     |      |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | GPIO |
 +------+-----+----------+------+---+OrangePi 4+---+---+--+----------+-----+------+

[5] Download the DTS file that comes with the 'Apollo OS'. Yes, this is a binary file I'm providing, but the apollo miner binary is, too, and I'm trying to figure out a better way for this as we speak.
Code:
wget https://github.com/iamthen0nce/apollo-dtb/raw/main/rk3399-orangepi-4.dtb

[6] Move it into the right directory.
Code:
sudo mv rk3399-orangepi-4.dtb /boot/dtb/rockchip/rk3399-orangepi-4.dtb

[7] Edit the /etc/rc.local file.
Code:
sudo vim /etc/rc.local

[8] Replace 'exit 0' line with the following.
Code:
#configure gpios
gpio mode 1 out
gpio write 1 0
gpio mode 0 out
gpio write 0 1

[9] Reboot the unit.
Code:
sudo reboot

I got through this part and the fan is finally running at 1800rpm, looks like it worked! Now I can continue to tackle the rest without that noisy terror distracting me!  Grin

That was not easy.....

Lessons learned:

- the OS might take much longer to load than expected. I etched Armbian_22.11.1_Orangepi4-lts_jammy_current_5.15.80_gnome_desktop.img.xz
to an SD card and it took over 3 minutes before any signs of life showed up on the HDMI-connected monitor. On second reboot, it too about 4 minutes before showing it is running. I assume that maybe my failed attempts to use an Ubuntu version were due to my impatience, I never waited that long to see if it would boot.

- for some reason, the Armbian_22.11.1_Orangepi4-lts_jammy_current_5.15.80_gnome_desktop.img.xz OS has no issues when connecting to GitHub to download the wiringOP thingamajigg (just like my Ubuntu laptop OS). Not asking for a password, just doing it like n0nce's instructions suggest. So for some reason, that previously tried bullseye-minimal armbian has some issue that will not be easy to solve for a noob when following n0nce's instructions.

EDIT: This is nonsense: See next post (it breaks the WiFi) - cannot use the binary file that n0nce has linked to, because I'm using a different OS than n0nce used. At least, I assume that is the case. I got around that issue by accessing the Apollo SD card with the FutureBit OS on it (in a card reader on my laptop). Find the appropriate file for the specific OS flavour, copy it to a USB memory stick, stick it into the Apollo and copy it into the /home folder. Then (for this specific case only):  
Code:
sudo mv rk3399-orangepi-4-lts.dtb /boot/dtb/rockchip/rk3399-orangepi-4-lts.dtb
Such fun typing this stuff without any typo's! [/font][/color]

- that vim text editor will drive you nuts, unless you just use the few commands needed for the task: type 'i' to get it into insert mode, then edit the file as instructed by n0nce, then Esc button to end the insert mode, then :x! to save and exit. I got that tidbit of geek-speak from here: https://www.geeksforgeeks.org/getting-started-with-vim-editor-in-linux/

- whatever you do, do not try to use the built-in help of that vim editor unless you want to spend a lot of time getting nowhere while then fan is still howling!  Grin The creator of vim must be some evil genius type of person.....




MrMik
Member
**
Offline Offline

Activity: 199
Merit: 37


View Profile
December 17, 2022, 11:36:07 PM
Last edit: December 18, 2022, 02:28:59 AM by MrMik
 #24

snip
snip
snip
[7] Edit the /etc/rc.local file.
Code:
sudo vim /etc/rc.local

[8] Replace 'exit 0' line with the following.
Code:
#configure gpios
gpio mode 1 out
gpio write 1 0
gpio mode 0 out
gpio write 0 1

[9] Reboot the unit.
Code:
sudo reboot
Somehow the WiFi gets broken by following these steps. EDIT: I did not actually follow the steps! Thought I'd be extra clever and stuffed it up, see below.
It still works before the reboot at the end, but after the reboot it malfunctions:
It tries to connect to the previously set WiFi network and it shows the name of the available networks for a minute or two, but then it loses the ability to detect any WiFi network.

I tested it with a fresh SD card etch of  Armbian_22.11.1_Orangepi4-lts_jammy_current_5.15.80_gnome_desktop.img.xz but unfortunately I did not reboot multiple times after each step. Will etch a new SD card and reboot frequently to figure out which step breaks the WiFi.

Progress: sudo apt update && sudo apt upgrade does not break the WiFi.

Code:
git clone https://github.com/orangepi-xunlong/wiringOP
   cd wiringOP
./build clean
./build
cd && gpio -v && gpio readall
    output similar to n0nces guide
does not break the WiFi

I found the culprit:
Code:
sudo mv rk3399-orangepi-4-lts.dtb /boot/dtb/rockchip/rk3399-orangepi-4-lts.dtb
makes the WiFi unusable.

Now what?

Next time: Rename the original
Code:
rk3399-orangepi-4-lts.dtb
file so that it does not get over-written by the file from the Apollo SD card. The I can at least get WiFi working again without rebuilding from the SD card etching step.


EDIT: I think I found the solution:

I was uncertain which file to use to replace the file in the /boot/dtb/rockchip/ directory.
Most likely my assumption that I have to use the one with -lts in it's name is to blame for the WiFi malfunction!

Stupid me thought "It's the armbian LTS version, so I use the .dtb file named rk3399-orangepi-4-lts.dtb "  Embarrassed

There are three similar files on the Futurebit Apollo SD card in that /rockchip/ directory:
Code:
rk3399-orangepi.dtb
rk3399-orangepi-4.dtb
rk3399-orangepi-4-lts.dtb

This time around, I did this:
Code:
cd /home/p/rk3399-orangepi_dtbs_from_Apollo_SD-card
sudo mv rk3399-orangepi-4.dtb /boot/dtb/rockchip/rk3399-orangepi-4.dtb

After this, the WiFi is still working.
MrMik
Member
**
Offline Offline

Activity: 199
Merit: 37


View Profile
December 18, 2022, 04:45:44 AM
 #25

[2] Edit the start_apollo.sh file.
Code:
cd linux-aarch64/
sudo vim miner_start.sh


I think you must mean the start_apollo.sh file, I guess it has been renamed since you wrote this guide?
MrMik
Member
**
Offline Offline

Activity: 199
Merit: 37


View Profile
December 18, 2022, 04:57:29 AM
Last edit: December 18, 2022, 06:15:40 AM by MrMik
 #26


[6] To test everything's working, execute it and give it some time to start up the hashboard and perform some hashes.
Code:
sudo ./miner_start.sh

I'm stuck at this point.

I am using
Code:
sudo ./start_apollo.sh
on the freshly edited file, and it sounds sooo promising (but then fails):

The moment I hit Enter, the fan gives a short burst of full speed (maybe 300ms) and the red light starts blinking fast.

But after about 30s the red light stops blinking and goes solid on, and the console prints "Started" but no mining is actually happening.

EDIT: I got un-stuck by using a previously edited start_apollo.sh-variant file. I pasted my settings line from a start_apollo.sh file that came from the Apollo-Miner_linux-x86_64.tar.xz download.

This file does not have n0nce's additional code (ending in 'echo Started') in it, but only that one line of settings that will allow my Ubuntu laptop to mine using the ASIC board connected via USB cable without the Orange Pi 4. Transplanted from x86_64 to aarch64 file.

The missing part that stops n0nce's code from running the miner (with the USBA to USB-micro cable in the miner) is this:
Code:
/dev/ttyACM0

Code:
start_Poll-i-i_Turbo_60-80C-Fan_20221217_aarch64.sh
gets Polli purring inside of a freshly updated armbian OS.

Yippieeee!

EDIT: It is a lot easier to have the files in the home folder, so you can copy and paste at will when making new flavours of start_apollo.sh files.

I got a self-starting VPN going on this armbian OS and adding more miners works as well:
Code:
cd linux-aarch64
sudo ./start_Poll-i-i_Turbo_60-80C-Fan_20221217_aarch64.sh

Open new console window, then:

cd linux-aarch64
sudo ./start_Poll-i-i-i_Turbo_60-80C-Fan_20221218_aarch64_acm1.sh

Now 2 of them purring quietly on a properly maintained OS! It can be done, thank you n0nce!
n0nce (OP)
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5814


not your keys, not your coins!


View Profile WWW
December 18, 2022, 01:18:05 PM
Last edit: December 18, 2022, 01:34:16 PM by n0nce
Merited by MrMik (1)
 #27

There are three similar files on the Futurebit Apollo SD card in that /rockchip/ directory:
Code:
rk3399-orangepi.dtb
rk3399-orangepi-4.dtb
rk3399-orangepi-4-lts.dtb

This time around, I did this:
Code:
cd /home/p/rk3399-orangepi_dtbs_from_Apollo_SD-card
sudo mv rk3399-orangepi-4.dtb /boot/dtb/rockchip/rk3399-orangepi-4.dtb

After this, the WiFi is still working.
Awesome, that's good to know! I'll make sure to adapt my guide such that people can pull the latest dtb from Futurebit OS and replace the correct dtb in their stock OS.

[2] Edit the start_apollo.sh file.
Code:
cd linux-aarch64/
sudo vim miner_start.sh
I think you must mean the start_apollo.sh file, I guess it has been renamed since you wrote this guide?
No, it was meant to be like this (opening a new file with that name in a text editor).

Now 2 of them purring quietly on a properly maintained OS! It can be done, thank you n0nce!
No worries; sorry for the inconveniences - it was meant to be easy to follow, just step-by-step guide. I will have to get my hands on an Apollo again and update it properly, I guess. Undecided

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
MrMik
Member
**
Offline Offline

Activity: 199
Merit: 37


View Profile
December 20, 2022, 04:22:43 AM
 #28

No worries; sorry for the inconveniences - it was meant to be easy to follow, just step-by-step guide. I will have to get my hands on an Apollo again and update it properly, I guess. Undecided
No inconveniences, I learned so much, thank you for helping me learn! It would have taken so much longer (years!) if I had tried to start with the 'Linux for dummies' book again!

So now I am creating a 500GB Veracrypt container to keep dd-created images in. But the armbian-SD cards themselves are a big security risk, if physically stolen. I will have to work on that for a bit. Shame armbian does not offer encryption options during installation.
Eventually I'll have an SD card image that does not need to be encrypted because the OS (that was used to make it) is sort of secure.

I'll keep following your guide to install the full node etc once I have an SD card that has been restored from an image of my working armbian Bitcoin miner!  Grin
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!