Title: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on June 07, 2022, 07:58:47 PM Miner Install Guide
This is part of my Futurebit Apollo BTC Custom Linux install guide. See here (https://bitcointalk.org/index.php?topic=5401729) for the prerequisites. Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on June 07, 2022, 08:00:34 PM GPIO Setup
[1] Download WiringOP to get access to GPIO of the Orange Pi 4. Code: cd /home/admin [2] Build the software Code: ./build clean [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 [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 [9] Reboot the unit. Code: sudo reboot Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on June 07, 2022, 08:00:56 PM Miner setup
Get latest binaries from: https://bitcointalk.org/index.php?topic=5340015.msg57091051#msg57091051 Log into your admin account. [1] Download and unpack binary. Replace the URL below with whatever is latest at time of reading. Code: sudo mkdir /opt/miner && cd /opt/miner [2] Edit the miner_start.sh file. Code: cd linux-aarch64/ [3] Input the following content. This is very much inspired by what the 'original Futurebit OS' ships. Code: #!/bin/bash [4] Configure the 'settings' line of this file correctly, to point to your user account and worker name on a pool of your choice. Then hook up the hashboard to the SBC using a Micro-USB to USB-A cable. [TO-DO: this won't be needed later when I figure out the UART connection] Make sure that stratum.kano.is is replaced with your pool's URL and that username.worker is your username on that pool concatenated with a worker name. [5] Make the file executable. Code: sudo chmod +x ./miner_start.sh [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 [7] Create the file for stopping all hashboards. Code: sudo vim ./miner_stop.sh [8] Add this content. Full credit to jstefanop. Code: #!/bin/bash [9] Make it executable. Code: sudo chmod +x ./miner_stop.sh [10] Stop the miner for now. Code: sudo ./miner_stop.sh Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on June 07, 2022, 08:01:09 PM Service setup
[1] Create miner service file: Code: sudo vim /usr/lib/systemd/system/miner.service [2] Contents should be like shown: Code: [Unit] [3] Enable & start service Code: sudo systemctl enable miner.service [4] Check that the miner is running fine. Code: sudo service miner status [5] after a few minutes or hours you can also see activity in your pool's dashboard. Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on June 07, 2022, 08:01:46 PM GUI setup
To get the nice Web UI, we can just install it from GitHub, since jstefanop made it open source! \o/ https://github.com/jstefanop/apolloui Attention: As of now, you need to actually get the apolloapi repo instead, since it handles the authentication to the web UI. Also the project(s) require a very old, potentially insecure version of NodeJS; namely NodeJS 9.x - use at your own risk. Do note that you can mine and run your nodes without any web UI at all.. [3] Input the following content. This is very much inspired by what the 'original Futurebit OS' ships. Code: #!/bin/bash [1] Move to admin user account and clone the repo. Code: cd /home/admin [2] Install nodeJS, npm and yarn. Code: sudo apt install python -y [3] Build the software. Code: yarn Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on June 07, 2022, 08:01:51 PM Some notes by MrMilk who followed my guide in December 2022; I feel they could come in very handy to whoever reads this! :)
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. - 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 - 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! ;D The creator of vim must be some evil genius type of person..... Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on June 07, 2022, 08:01:56 PM Reserved
Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: itshig on November 19, 2022, 05:02:33 AM Alright n0nce, getting this tackled. I have Umbrel installed onto Armbian, trying to get the miner setup now.
I'm getting the error that the system can't access /dev/ttyACM. When or where was this created? I don't see it in the instructions and I don't have this file structure. Thanks!! Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on November 19, 2022, 11:51:57 AM I'm getting the error that the system can't access /dev/ttyACM. When or where was this created? I don't see it in the instructions and I don't have this file structure. That's not a problem; this code is just in case you have standard units connected through USB. It should still pick up and start mining on your full unit's integrated hash board.Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: itshig on November 19, 2022, 07:08:35 PM I'm getting the error that the system can't access /dev/ttyACM. When or where was this created? I don't see it in the instructions and I don't have this file structure. That's not a problem; this code is just in case you have standard units connected through USB. It should still pick up and start mining on your full unit's integrated hash board.This is what it's returning: Code: $ sudo service miner start It stays apollo miner was stopped (I added "apollo miner" to start and finish for my own clarity lol) and my pool isn't picking up a mining status. Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on November 19, 2022, 07:17:48 PM It stays apollo miner was stopped (I added "apollo miner" to start and finish for my own clarity lol) and my pool isn't picking up a mining status. Can you try manually starting /opt/miner/linux-aarch64/miner_start.sh and checking what errors it throws?It's possible that it needs sudo privileges and the following lines need to be uncommented. I'm not 100% sure right now, why I had them commented out. Code: #User=admin Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: itshig on November 19, 2022, 08:28:33 PM It stays apollo miner was stopped (I added "apollo miner" to start and finish for my own clarity lol) and my pool isn't picking up a mining status. Can you try manually starting /opt/miner/linux-aarch64/miner_start.sh and checking what errors it throws?It's possible that it needs sudo privileges and the following lines need to be uncommented. I'm not 100% sure right now, why I had them commented out. Code: #User=admin Code: user@machine: /opt/miner/linux-aarch64$ sudo ./miner_start.sh Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on November 19, 2022, 09:03:38 PM ~ Seems to start fine as sudo. Try uncommenting those lines and reload the service. Code: sudo systemctl daemon-reload Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: itshig on November 19, 2022, 10:03:29 PM It seems like it's still not running even though it appears to start. My fan is still racing (as if the miner was off) and the lights on the front aren't doing anything (though that may be normal given the custom route). Also, my pool still isn't picking up my miner as being active.
Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on November 22, 2022, 04:02:13 PM It seems like it's still not running even though it appears to start. My fan is still racing (as if the miner was off) and the lights on the front aren't doing anything (though that may be normal given the custom route). Also, my pool still isn't picking up my miner as being active. Is your config fine? Maybe try rebooting? The fan should not race when the miner is off; instead it should do that when mining.Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: itshig on November 24, 2022, 04:07:06 PM It seems like it's still not running even though it appears to start. My fan is still racing (as if the miner was off) and the lights on the front aren't doing anything (though that may be normal given the custom route). Also, my pool still isn't picking up my miner as being active. Is your config fine? Maybe try rebooting? The fan should not race when the miner is off; instead it should do that when mining.I've rebooted a bunch. I took a few days off from this though and back at it. Fan has always raced when not mining (on the factor sd/nvme) until I power it down. As soon as it starts mining, the fan slows down. I've gone back through the instructions and now I'm getting: Code: miner_start.sh[1599]: gpio: Must be root to run. Program should be suid root. This is an error. I've gone through the config file a few times and everything looks ok. This is frustrating! Lol I appreciate all of your help, to me and the community as a whole! Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on November 24, 2022, 08:26:42 PM I've gone back through the instructions and now I'm getting: Ok, this is very helpful! Indeed, the miner needs to be executed as root to get GPIO access.Code: miner_start.sh[1599]: gpio: Must be root to run. Program should be suid root. This is an error. If you're working with the systemd service, make sure to uncomment these lines, as I explained before. Code: #User=admin I.e., you want to remove the '#' signs in the front so it reads: Code: User=admin The default root user may be called 'umbrel' actually. Maybe try that, instead. If you're logged in as 'umbrel' (check with command: whoami), try the groups command to see whether you're in sudo group. If so, use User=umbrel and Group=sudo. Whole file then at follows: Code: [Unit] If you're running from command line, execute: sudo ./miner_start.sh <rest of parameters>. I appreciate all of your help, to me and the community as a whole! Very welcome. :)Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: itshig on November 26, 2022, 12:11:57 AM Ok, this is very helpful! Indeed, the miner needs to be executed as root to get GPIO access. If you're working with the systemd service, make sure to uncomment these lines, as I explained before. Code: #User=admin I.e., you want to remove the '#' signs in the front so it reads: Code: User=admin The default root user may be called 'umbrel' actually. Maybe try that, instead. If you're logged in as 'umbrel' (check with command: whoami), try the groups command to see whether you're in sudo group. If so, use User=umbrel and Group=sudo. Whole file then at follows: Getting closer I think? Can I just pay you to hop on ssh and figure this out? ;D It looks like it's running according to sudo service miner status as seen below. However, it's displaying those other errors with regard to sudo. Further, my fan is still loud af (no change from not mining to mining). And it's not registering on my pool as being an active miner; about 10 min in according to active (running) results on the latest miner status report. all private info changed (ie user/password, etc) Code: ● miner.service - Apollo Miner Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: itshig on November 26, 2022, 01:06:16 AM Meh, miner shut down on its own and won't start back up. I have to keep rebooting in order to get it to load.
Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on November 26, 2022, 03:51:33 PM Getting closer I think? Can I just pay you to hop on ssh and figure this out? ;D I really hope that your SSH interface is not accessible from the internet (closed port in local and / or router firewall)! :)Code: ~snip~ I'm very sorry; should have catched that earlier. I have to get into Umbrel myself and make a dedicated guide for setting the Apollo miner up in Docker to run on Umbrel. That will definitely take some time, I'm afraid. Umbrel requires installing everything through Docker, as explained here: https://github.com/getumbrel/umbrel-apps/blob/master/README.md Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: MrMik on December 13, 2022, 10:13:43 PM GPIO Setup 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. [1] Download WiringOP to get access to GPIO of the Orange Pi 4. Code: cd /home/admin 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 Code: sudo apt install git 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 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 Any idea why armbian does not want to cooperate on this? Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on December 13, 2022, 11:08:14 PM ADDITION: I just noticed that Probably your Ubuntu has GitHub credentials set up.Code: git clone https://github.com/orangepi-xunlong/WiringOP Any idea why armbian does not want to cooperate on this? 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 Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: MrMik on December 16, 2022, 07:49:55 AM GPIO Setup [1] Download WiringOP to get access to GPIO of the Orange Pi 4. Code: cd /home/admin [2] Build the software Code: ./build clean [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 [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 [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! ;D 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 - 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! ;D The creator of vim must be some evil genius type of person..... Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: MrMik on December 17, 2022, 11:36:07 PM snip 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. 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 [9] Reboot the unit. Code: sudo reboot 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 I found the culprit: Code: sudo mv rk3399-orangepi-4-lts.dtb /boot/dtb/rockchip/rk3399-orangepi-4-lts.dtb Now what? Next time: Rename the original Code: rk3399-orangepi-4-lts.dtb 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 " :-[ There are three similar files on the Futurebit Apollo SD card in that /rockchip/ directory: Code: rk3399-orangepi.dtb This time around, I did this: Code: cd /home/p/rk3399-orangepi_dtbs_from_Apollo_SD-card After this, the WiFi is still working. Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: MrMik on December 18, 2022, 04:45:44 AM [2] Edit the start_apollo.sh file. Code: cd linux-aarch64/ I think you must mean the start_apollo.sh file, I guess it has been renamed since you wrote this guide? Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: MrMik on December 18, 2022, 04:57:29 AM [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 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 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 Now 2 of them purring quietly on a properly maintained OS! It can be done, thank you n0nce! Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: n0nce on December 18, 2022, 01:18:05 PM There are three similar files on the Futurebit Apollo SD card in that /rockchip/ directory: 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.Code: rk3399-orangepi.dtb This time around, I did this: Code: cd /home/p/rk3399-orangepi_dtbs_from_Apollo_SD-card After this, the WiFi is still working. [2] Edit the start_apollo.sh file. I think you must mean the start_apollo.sh file, I guess it has been renamed since you wrote this guide?Code: cd linux-aarch64/ 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. :-\Title: Re: [Guide] Futurebit Apollo BTC Custom Linux Install - Miner Post by: MrMik on December 20, 2022, 04:22:43 AM 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. :-\ 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! ;D |