Miner.farm Crypto Currency Community Forum

Browse and post your favorite coin/crypto news, miner.farm and PiMP OS updates and announcements, mining guides, overclocking tips, and more...

Quick Links

Doc's Android Cluster

  • Support

    So, I was doing some cleaning up of my old junk hardware and ran across the family's old cell phones - 5 old Samsung Galaxy J7's just sitting in a box collecting dust. I couldn't bring myself to just toss them into the trash, so I headed to Google to see what I might be able to do with them. Let me save you some time... there's not much they'd be good for.

    With no good options, I wondered if I could get them mining. No, I don't care that they won't make me rich - that's not the reason I do this.


    Before I could begin, I needed to know what kind of hardware I was dealing with. A quick check online for these phones (model number "SM-J700T") says that they have 2GB of RAM and a Exynos 7580 CPU which is an 8 Core/8 Thread ARM-Cortex-A53 (ARMv8) 28nm chip.

    Next step was to figure out how to get Linux installed on these phones. The fastest and easiest way I found was to use an Android app called "Linux Deploy". The only catch is that to make this work, the devices must be rooted.

    I'm not going to go over the exact details, but what had to do to each device is:

    1. Factory Reset
    2. Update to the Newest Android
    3. Unlock the Bootloader
    4. Flash TWRP Recovery
    5. Root the Device
    6. Install "Linux Deploy"
    7. Configure/Install and Start Ubuntu for arm64 (see bottom of post)
    8. Compile/Build XMRig for ARMv8 (see bottom of post)

    Next, I configured XMRig to use 6 of the 8 cores and fired it up to mine LOKI on the RandomX algo (rx/loki). Simple tests showed that each device was pushing between 40 - 50 h/s, however, this is a bit too low for most pools and device timeouts will occur.

    At this point I thought I was done with this experiment, but just before "throwing in the towel", I ran across another piece of software from the XMRig developer called xmrig-proxy.

    As its name suggests, it acts as a proxy for other miners. The idea is simple: The proxy runs on one machine and connects to the pool. External miners get setup to connect to the proxy instead of a pool. The proxy's job is to control the workflow to and from the pool to the actual mining devices (the phones in this case).

    Score! This is exactly what I needed to keep these weaker devices going.

    Adding xmrig-proxy to PiMP OS was pretty easy. I compiled/built it like it was a normal miner and put it in /opt/miners/xmrig-proxy. Next, I created a xmrig-proxy.pcfg and added it to the /opt/confs/ folder. Using minerfarm I added a custom miner - pointing to the xmrig-proxy and the xmrig-proxy.pcfg files.

    ===== UPDATE =====

    Awesome news: xmrig-proxy has been added to PiMP OS! If you are current in your pimpup's, then you can just add xmrig-proxy as if it was a regular miner. Just run pimp --add and look for it in the list. (currently it's 3161, but this could change later)

    Once added, edit the config with edit # (just like you would any other miner)

    Full XMRig-Proxy write-up can be found Here


    PiMP OS fired this off without a problem. At this point, I just pointed each of the devices to the PiMP rig and away it went.

    Here's what it looks like with everything working.

    xmrig-proxy running on PiMP OS v2.15 and the 5 phones connected.

    Here it is reporting to the pool!

    Okay, so now let's go over the efficiency of all this.

    To avoid skewed data, I'm using my trusty little USB power meter on a single device that is fully charged. This way we will only be seeing what power is needed to keep the device running since some phones have "boost charging" abilities depending upon how low the battery is. We want to avoid getting our readings from any "boost" charging. Basically, we only want to measure what the device is pulling in order to keep the battery topped off while it is mining. This is what is being pulled from the wall.

    Node00 Power Node00 XMRig
    015807fc-476a-4a25-8608-c3d0b1620f3a-image.png 8d2a00b1-6c3c-4f70-8dbb-37966fe9f07b-image.png

    The measurement from Node00 is jumping between 1.5w and 2.8w, so we'll just call it 2.15w for now. Checking XMRig directly from the device, Node00 it is reporting 44.4h/s. Some simple math shows us that we are pulling 17.76 hashes per watt per second (h/w/s).

    For comparison, let's see how that stacks up against other common hardware. Note: Overhead Power is just an estimated amount of extra power needed just to run the system. This has to be taken into consideration since you can't just run a CPU or GPU without the rest of the computer.

    H/W/S column gives the overall device efficiency (higher is better).
    Hardware $/H gives the initial investment efficiency (lower is better).
    Power $/day gives the daily operating cost based upon $0.11/kwh (lower is better).
    The last three columns are from WhatToMine's calculation run on 1/1/2020.

    Device Hashrate (H/S) Power (W) Overhead (W) H/W/S Hardware (Used) Hardware $/H Coins/day Power $/day Profit $/day
    J7 44.4 2.15 0 20.65 $79 $1.78 0.008091 $0.005160 $0.00
    5x J7 222 10.75 $395 0.040425 $0.0258 -$0.01
    AMD EPYC 7742 44000 225 60 154.39 $5000 $0.11 8.005430 $0.75 $2.35
    THREADRIPPER 3970X 27703 280 60 81.48 $2000 $0.07 5.041909 $0.90 $1.06
    2X XEON E5-2698V4 13200 270 60 40 $596 $0.05 2.403054 $0.87 $0.06
    INTEL G4400 402 49 60 3.69 $40 $0.10 0.073202 $0.29 -$0.26
    GTX 1080 TI 1000 200 120 3.13 $450 $0.45 0.181945 $0.84 -$0.77
    RADEON VII 1710 280 120 4.28 $494 $1.76 0.311121 $1.06 -$0.94
    AMD RX 570 496 90 120 2.36 $94 $0.19 0.090245 $0.55 -$0.52

    Linux Deploy

    1. Configure
    • Distribution: Ubuntu
    • Architecture: arm64
    • Distribution Suite: bionic
    • User Name: root
    • Privileged Users: root
    • INIT: enabled
    • SSH: enabled
      • SSH Port: 2022 (Android blocks the default 22)
    1. Install
    2. Start

    XMRig Build for ARMv8 (or ARMv7)

    Note: This part is not for your PiMP OS rig. This is what you will need to do on your actual ARMv7 or ARMv8 device.

    Since I have to do this on each of my ARM devices every time a new XMRig build is released, I created an automated Bash script to do it for me.

    Note: My script requires root, so like any good Linux user knows, you should never run a program or script that you are not sure about. I am not responsible for anything that may or may not happen on your machine with this script. If you are more comfortable doing this yourself, then skip down to the part where I explain the basics on how to do this manually.

    With that said, feel free to copy it, inspect it, modify it, or whatever you want. I did my best to include comments.

    Inspect it from: Github Source
    Download it from: Github Releases

    To keep everything easy, just download the script to your root directory. Once downloaded, you will need to make it executable by running chmod +x xmrig-build.sh. Once it's executable, fire it off with ./xmrig-build.sh # (where # is "7" for ARMv7, "8" for ARMv8, anything else or <blank> for x86-64 devices).

    My script does too much to list it all out here, so, in a nutshell, this script will leave you with an "xmrig" directory in your root directory (/root/xmrig/) and inside you will find the following files:

    1. xmrig - This is the XMRig miner.
    2. xmrig-build.7z - This is a 7zip compressed archive of the XMRig miner.
    3. start-example.sh - This is an example start script to run the miner.
    4. *xmrig.bak - This is a backup of the last XMRig miner. (#1 above)
    5. *xmrig-build.7z.bak - This is a backup of the last 7zip archive (#2 above)

    *Files #4 and #5 will only exist if you have already run the script at least once in the past.

    At this point, the first thing you'll want to do is to edit the start-example.sh file and configure the xmrig-proxy IP, xmrig-proxy Port, and the device name.

    Feel free to copy/rename/move start script to wherever you want it. To start the miner, just run this script (example: ./start-example.sh or whatever you named it to).

    This little launcher script will launch the miner in a "Screen" session just like PiMP OS does. To disconnect from the miner without killing it, use CTL+a, d. To reconnect, run screen -r. To stop or kill the miner completly, use CTL+c

    Now, whenever there is a new XMRig release, all you have to do is re-run the ./xmrig-build.sh script. (Be sure to stop mining first and use the correct script argument.)

    As a fail-safe, be sure to copy the xmrig-build.7z archive somewhere safe in case the script stops working for some reason - then you'll still have a copy of xmrig as a backup you can recover from and get back to mining fast.

    Manual XMRig Build for ARMv7 and ARMv8
    1. apt install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev htop screen nano libhwloc-dev
    2. git clone https://github.com/xmrig/xmrig.git
    3. cd xmrig && mkdir build && cd build

    For ARMv8:
    4. cmake -DARM_TARGET=8 ..

    For ARMv7:
    4. cmake -DARM_TARGET=7 ..

    1. make
    Manual XMRig Start Script

    This will launch XMRig in a screen, just like PiMP OS does, so you can disconnect and reconnect without killing the miner. Connect with screen -r and disconnect with Ctl+a, d
    nano start.sh

    1. To mine via xmrig-proxy running on another machine:
    screen -wipe
    screen -dm /<path to xmrig>/xmrig -o <URL>:<port> -l /var/log/xmrig.log --donate-level 1 --rig-id <workerid>
    screen -r
    1. To mine directly to a pool:
    screen -wipe
    screen -dm /<path to xmrig>/xmrig -o <poolURL>:<port> -u <walletaddress> -p <workerid> -l /var/log/xmrig.log --donate-level 1 --api-id <workerid>
    screen -r

    Save and exit the editor.

    Now make the script executable with the following:
    chmod +x start.sh

    Starting, Stopping, Connecting, Disconnecting

    • Start - ./start.sh or ./start-example.sh
    • Disconnect - CTL+a, d
    • Reconnect - screen -r
    • Stop/Kill - CTL+c from miner screen.


Want 10% more hash from your rigs?

We promise to keep your email safe and never spam you.

© 2014-2020 Miner.farm | By Miners, For Miners | Portable Instant Mining Platform, LLC