How Can I Mine On My Orange pi?

Blockchain. Cloud. Consulting. Development. Distributed Computing. Hosting.

How Can I Mine On My Orange pi?

22/04/2019 Uncategorized 0

We have heard this question quite frequently on TurtleCoin Discord chat. This is our initial guide to give you a head start on sustainable, best performing SBC mining, focused on OrangePI One Plus board. This board is at the time of writing this post most likely the most efficient hardware to mine on.

Overview and background

A bit of a background on where and when we started at Cuvée with this project. We have first explored the topic of mining on an SBC around December 2017. TurtleCoin was very new back then, so we tried mining Bytecoin and Monero first. It worked. However, with these coins focus and philosophy, this undertaking was only good for a thought experiment.

Over the course of time, we have evaluated many SBC Boards for mining (and other purposes), including (not a comprehensive list):

  • OrangePI PC (H3)
  • Orange PI Zero Plus (H5)
  • Orange PI One Plus (H6)
  • Orange PI 3 (H6)
  • Rock64 (RK3328)
  • BananaPI M3

We have heard from other community memebers on TurtleCoin Discord to test Raspberry PI 3b+ and Nvidia Jetson Nano (both tested and xmrig mining software adapted by @thinkpol). We believe the Nvidia Jetson Nano could be a hidden gem, we will cover this in a separate blog post.

Out of all the tests with mining throughout TurtleCoin (and other coins) algorithms, the Orange PI One Plus stands out (at the time of writing) as a clear winner. We recommend you start your journey with this board.

Why? At the current TurtleCoin algo (crytponight-turtle), you can achiveve around 600 – 700 hashes per second (h/s). Some community members took it to the extreme and achieve consistently 750 h/s. Simple maths. If you buy 10 boards, these will give you anything between 6 – 7.5 kh/s at a power consumption of about 50 watts.

Preparing your set up

There are number of things you will need if you take mining with OrangePI One Plus seriously. In order to be effective with it, you will need more than one board. We will losely describe our first set up we did with 10 boards.

For you to get started, you will need the following:

  • Orange PI One plus in the required quatity (ideally to start with 10x)
  • 16-port (at least) Ethernet Gigabit Switch
  • Network Cables
  • Power cables for Orange PI One Plus (either USB to microUSB, or USB to barrel plug of the required specification)
  • USB Power Adapters or Charging USB Hub (2x 5-port with output of 2A per 5V port at least)
  • microSD cards (8GB or 16GB whichever you can get cheaper, no need to go for more storage for mining)
  • Heat sinks for the H6 chip on the OrangePI
  • Spacers to mount the OrangePI Boards together (2×5 tower set up)
  • 80 – 100mm 12V fans (2x) with USB plugs to ensure airflow between the boards
  • Internet connection / home broadband router to connect the Gigabit Switch for your boards

That’s it for the list of hardware. At the bottom of this blog post, we show you examples and links for the components we use.

Mostly, we order from AliExpress. Over the 3 years of sourcing in China, we developed a network of trusted producers, suppliers and resellers that we never encountered any problem with. Going forward, we will open our own e-shop with all the required components to server UK, EU (and possibly US/Canada) customers. We keep you updated on this.

Once you have all ready, just do the following steps:

  • Put heatsinks to the H6 chip on your OrangePI One Plus boards
  • Mount them together to 2×5 towers using spacers
  • Connect your gigabit ethernet switch to your home broadband switch
  • Connect all the OrangePI One Plus boards with the gigabit ethernet switch
  • Plug all the microUSB or barrel plug power cables to the boards
  • Mount (glue) your fans to the side of each tower
  • Plug your Charging USB hubs to the power
  • Do not power up the boards yet

Setting it all up – getting the board running

Now that you have your components in place, it is time for us to start the real work.

Take out your microSD cards. Get your favourite OS for the OrangePI One Plus board. At the time of writing, there are two images available:

While the Armbian will be a great choice when Mainline kernel support for the Allwinner H6 chip is ready, for the purpose of mining, the official OrangePI Ubuntu 16.04 BETA with legacy kernel does a good job as well.

Download the image and write it to the microSD card using your favourite tool. For the UNIX hard liners, there is no better tool than DD, for everyone else, tools such as Etcher will do just fine.

Once you have the OS image ready, insert the microSD to your Orange PI One Plus boards and power them up.

Shortly, these should be up and running. If your home / work environment allows for DHCP, all the boards should have obtained a DHCP address.

Please note the OrangePI One Plus boards come all with same MAC address from the factory. You need to assign each board a different MAC address. In produtions versions, Armbian does this for you at the boot time. All other systems, either modify the boot enviroment (outside of scope of this article), or fire these boards one by one and edit the /etc/network/interfaces.d/eth0 file and add:

hwaddress ether 00:01:04:1b:2C:1F

The MAC address above is only an example. Pick your own. Different one for each board.

If you need to set up static addresses, there are lots of examples on how to do this for a Ubuntu/Debian-like systems, just google it.

With the MAC addresses and networking sorted, you should be in the position to connect to your boards via ssh now.

For Armbian, the default login is root / 1234, for OrangePI Ubuntu, the default login is root / orangepi.

We cannot stress more the importance to change those default passwords at the first login.

Installing & running the xmrig miner

With you now possibly logged in to the system, we will now install and configure your miner from scratch.

First, update your system.

sudo apt update
sudo apt upgrade

Second, prepare your system to compile xmrig using GCC-8 / g++-8 and install other build pre-requisites.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt install aptitude -y
sudo aptitude install -y build-essential g++-8 gcc-8 git cmake libuv1-dev libmicrohttpd-dev libssl-dev
export CC=gcc-8
export CXX=g++-8
git clone
cd xmrig
mkdir build
cd build
cmake ..

This should compile your xmrig binary in the xmrig/build directory.

In most cases, there is no need to add any extra flags for CMAKE. At least we did not need to do this for our 50+ OrangePI boards we set up at the time of writing. Some community members will swear use this or that and you gain extra few hashes. We leave up to you to experiment.

In our experience, all the SBCs we tested (see the list above in Overview section of this post), this generic step by step guide works all boards we tested. This is however, not true for Raspberry PIs. Look elsewhere for Raspberry PI guides – main caviat being you need a true 64bit system for a Raspbperry board – some of the systems have 64bit kernel, but not the user space. In our view, as much we admire these boards for education purpose, we do not use them for our own or customer projects. And we definitely do not recommend any Raspberry for mining.

Now, we will run your miner for the first time. Go the the $HOME/xmrig/build directory and run the following command:

./xmrig -a cryptonight-turtle -o -u <your TRTL wallet address> --donate-level 1

If all went well (there is no reason why it should not!), you should see something similar to the following on your terminal screen:

Congratulations. Your miner is now up and running. If you want to leave it running without you having have to keep logged onto the system via ssh, just run the following command:

nohup ./xmrig -a cryptonight-turtle -o -u <your TRTL wallet address> --donate-level 1 &

This will keep your xmrig miner up and running on the background after you log out from the system.

Important: Choose whichever TurtleCoin mining pool you like. The one we mention here is our own CuvéeARM TurtleCoin pool that runs on OrangePI.

Repeat this for all your boards (in our example case 10 boards) to get you the fantastic hash rate of 7.4kh/s at a maximum power consumption of 50 watts.

Happy TurtleCoin mining!

Appendix A – What and where to buy

OrangePI One Plus on Aliexpress. Shop served by the Shenzen Xunlong Ltd., the company behind OrangePI.

OrangePI One Plus

Flat Ethernet Cables from Aliexpress. We love them for saving space.

Flat Ethernet Cables.

Orico 5x port USB charging hub from Aliexpress. These power most of our set-ups.

Orico charging hub

Heat sinks from Aliexpress. We buy these in bulk, best we found for our boards.

Heat sinks

Box full of spacers from Aliexpress. There is never enough of these!

Box with spacers.

We will add other items that we find useful going forward, most likely these will end up in a separate post.