XMRigCC on TX3 mini Android TV Box

From uPlexa Knowledgebase
Revision as of 12:28, 4 July 2019 by Prankst3r (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About this guide

This guide covers the installation of Ubuntu(Armbian) on a TX3 mini Android TV Box and how to mine UPX using XMRigCC. For other Adrdoid TV boxes the installation and usage is similar. The mining part is the same as on a normal PC using Ubuntu.

About the TX3 mini

  • Amlogic S905W quadcore SoC
  • 2GB RAM
  • Wifi/LAN

Link to seller: https://www.geekbuying.com/item/TANIX-TX3-MINI-H-S905W-Android-7-1-2GB-16GB-TV-Box-403629.html

What do you need?

I used this for the TX3 mini:

Armbian_5.44_S9xxx_Ubuntu_xenial_3.14.29_server_20180515.img

but you can use one with a desktop-environment aswell:

Armbian_5.44_S9xxx_Ubuntu_xenial_3.14.29_mate_20180515.img

For Windows:

Getting started

Step 1) Download the tools and the image you need, after that install Etcher and PuTTY.

Step 2) Start Etcher, select the image, select the sd card/USB flash drive and click Flash!.

Step 3) Remove the sd card/USB flash drive and place it in your TX3 mini (I used the left usb port).

Step 4) Remove the power connector of the TX3 mini. Press the reset button (on the bottom of the box) with a needle for 10s, then connect the power again and it should boot into Ubuntu.
There are other ways to first time boot, but this worked the best for me.

Connecting through SSH to the Android box and setting up Ubuntu

Step 1) Find out your Android boxes IP address. I looked it up at my router. You can skip this and the 2. step by connecting your box to a TV via HDMI and connecting a mouse and keyboard.

Step 2) Start PuTTY and enter the IP. Hit Open

Step 3) Enter root as username and 1234 as password.
Then create a new user by following the steps in PuTTY. The system automatically reboots.

Step 4) Now we change the IP address to a static one. Enter:

sudo armbian-config

Go to Network -> IP -> Select Static -> and enter a static IP for your TX3 mini. Select OK and exit armbian-config.

Step 5) Enter in PuTTY:

sudo apt-get update -y && sudo apt-get upgrade -y

After that enter:

sudo reboot

Installing XMRigCC and editing the config

Step 1) Reconnect through PuTTY and login as the user you created before. Enter:

sudo mkdir /home/"your_username"/xmrigcc
sudo wget -c https://github.com/Bendr0id/xmrigCC/releases/download/1.9.3/xmrigCC-1.9.3-with_tls-gcc7-linux-static-miner_only-arm64.tar.gz -O - | sudo tar -xz -C /home/"your_username"/xmrigcc/

Step 2) Now we edit the miner config:

cd xmrigcc
sudo nano config.json

You can delete everything and c&p following:

{
   "algo": "cryptonight-extremelite",          // cryptonight (default), cryptonight-lite, cryptonight-ultralite, cryptonight-extremelite or cryptonight-heavy
   "aesni": 0,                                 // selection of AES-NI mode (0 auto, 1 on, 2 off)
   "threads": 2,                               // number of miner threads (not set or 0 enables automatic selection of optimal thread count)
   "multihash-factor": 0,                      // number of hash blocks to process at a time (not set or 0 enables automatic selection of optimal number of hash blocks)
   "multihash-thread-mask" : null,             // for multihash-factors>0 only, limits multihash to given threads (mask), mask "0x3" means run multihash on thread 0 and 1 only (default: all threads)
   "pow-variant" : "upx2",                     // specificy the PoW variat to use: -> auto (default), '0', '1', '2', 'ipbc', 'xao', 'xtl', 'rto', 'xfh', 'upx', 'turtle', 'hosp', 'r', 'wow', 'double (xcash)', 'zls' (zelerius), 'rwz' (graft), 'upx2'
                                               // for further help see: https://github.com/Bendr0id/xmrigCC/wiki/Coin-configurations
   "asm-optimization" : "auto",                // specificy the ASM optimization to use: -> auto (default), intel, ryzen, bulldozer, off
   "background": false,                        // true to run the miner in the background (Windows only, for *nix plase use screen/tmux or systemd service instead)
   "colors": true,                             // false to disable colored output
   "cpu-affinity": null,                       // set process affinity to CPU core(s), mask "0x3" for cores 0 and 1
   "cpu-priority": 5,                          // set process priority (0 idle, 2 normal to 5 highest)
   "donate-level": 1,                          // donate level, mininum 1%
   "log-file": null,                           // log all output to a file, example: "c:/some/path/xmrig.log"
   "max-cpu-usage": 100,                       // maximum CPU usage for automatic mode, usually limiting factor is CPU cache not this option.
   "print-time": 60,                           // print hashrate report every N seconds
   "retries": 5,                               // number of times to retry before switch to backup server
   "retry-pause": 5,                           // time to pause between retries
   "safe": false,                              // true to safe adjust threads and av settings for current CPU
   "syslog": false,                            // use system log for output messages
   "reboot-cmd" : "",                          // command to execute to reboot the OS
   "force-pow-variant" : false,                // force pow variant, dont parse pow/variant from pool job
   "skip-self-check" : false,                  // skip the self check on startup
   "pools": [
       {
           "url": "YOUR_POOL:POOL_PORT",       // URL of mining server
           "user": "YOUR_WALLET",              // username for mining server
           "pass": "YOUR_WORKERNAME",          // password for mining server
           "use-tls" : false,                  // enable tls for pool communication (need pool support)
           "keepalive": true,                  // send keepalived for prevent timeout (need pool support)
           "nicehash": false                   // enable nicehash/xmrig-proxy support
       }
   ],
   "cc-client": null,
}

Dont forget to edit the pool, wallet and maybe the user/workername!
Exit via ctrl+X, press Y to save the config and hit enter

Start mining

Start mining with the following commands:

sudo sysctl -w vm.nr_hugepages=128
screen -S 1 ./xmrigDaemon

Mining should start and there shouldn't be a huge pages error (because we set the huge pages earlier to 128 [sudo sysctl -w vm.nr_hugepages=128]).
Now press ctrl+A and then ctrl+D and you can now close PuTTY without stopping the miner.
To open the miner again, connect through PuTTY with your user and password and enter:

screen -r 1

Closing the miner and shutting down Ubuntu

When connected and the miner is open and working you can kill it with ctrl+C and then enter:

sudo poweroff

Start the Android box again and resume mining

Connect the box to the power again, hit the power on button on the remote and Ubuntu will boot.
Then start over at Start mining, but before starting XMRigCC you have to enter:

cd xmrigcc

Persistent huge pages

Connect to the box as root and enter the following:

sudo echo 'vm.nr_hugepages=128' >> /etc/sysctl.conf

To check it:

sudo sysctl -p

This makes entering sudo sysctl -w vm.nr_hugepages=128 every time you want to start mining again obsolete

Known bugs

  • Android won't boot anymore

Tested devices

Device Hashrate Threads Power consumption Linux version
TX3 mini 1030 H/s 2 Idle: 1,5W Mining: 2,1W Armbian_5.44_S9xxx_Ubuntu_xenial_3.14.29_server_20180515
Nintendo Switch 3405 H/s 4 not tested yet l4t Ubuntu v. 1.3.1
A95X F2 2049 H/s 4 Idle: 0,9W Mining: 1,6W Armbian_5.90_Aml-s905_Ubuntu_bionic_default_5.1.0_20190701

Screens

Nintendo Switch

TX3 mini

A95X F2