Solar Powered Ardor Blockchain Node

Using a Raspberry Pi3 B, solar panels, an LCD screen, and an external battery to run a completely green blockchain node

Edit

The Power Usage section was updated with more accurate wattage, as it seems my orginal USB multimeter was calibrated incorrectly.

Introduction

For years I’ve been hearing about the solar powered NXT node and have been meaning to build my own for Ardor. So I finally got around to it and wanted to share my experience.

Parts

  • Raspberry Pi B
  • Solar panels
  • Battery
  • USB cable
  • Display
  • Case
  • SD card

For our use it is better to get the Raspberry Pi3 B instead of the B+. We don’t need the extra bandwidth of 5.8ghz wireless or the extra CPU speed. Also, it’s cheaper and more energy efficient.
So for my setup, these are the parts I went with:

I bought 3 different solar panels and batteries as I tested out this project and I have learned a lot. I will go into more details later in the Power Usage and Solar Panels section. For this section though I just included my recommendation for this particular project (I did have to use the correct USB port, one of them would power off for a 1 second when the battery stopped charging. The other one worked perfectly always, so make sure to test the ports for this).

Software

The great thing about the screen and case I picked, is that it comes with an SD card preinstalled with Raspbian and the necessary touch drivers. In my next story I’ll go over setting up the SD card yourself, as I want to maximize energy efficiency. For this story though, just plug in the card and get started.

Plug in your pi to the solar/battery unit. Once your Raspberry Pi is booted up, we will connect it to WiFi (you will want a USB keyboard for this part). Click the WiFi symbol in the top right and find your WiFi. Click on your network, enter your password, and you should be good. While on the desktop, click the Bluetooth symbol next to the WiFi and turn that off as it will save a little power.

Next, we will install Ardor. Java and Screen are already installed on the SD card provided, so we don’t need to worry about that. Open up the terminal by clicking it’s icon in the top menu bar and type the following commands:

wget https://www.jelurida.com/ardor-client.zip
unzip ardor-client.zip
cd ardor
wget https://ardor.tools/ardorTest.h2.db.zip
unzip ardorTest.h2.db.zip
screen -S ardor

sh ./run.sh

You should see the node software startup and we should now be all good. You can press CTRL + A and then press D. This will exit the screen but leaving it running in the background. You can get back to the screen by typing

screen -r ardor

You can leave it up and running on the display to easily view what your node is doing.

And that’s it! You now have an Ardor node running on solar power.

Extras (Optional)

Here a few optional steps you may want to do too:

Remove some unnecessary programs for extra free space (~1.3GB):

sudo apt-get purge wolfram-engine libreoffice*
sudo apt-get clean
sudo apt-get autoremove

Update all the packages:

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

Disable HDMI for extra power savings:

sudo nano /etc/rc.local

and add the following line above exit 0:

/usr/bin/tvservice -o

Increase available memory by lowering GPU memory:

sudo raspi-config

Go to option 7 Advanced Options and pick option A3 Memory Split. If you are going to run a GUI, I would recommend 32MB or 64MB. If running a headless system (like in my next story), you would choose 16MB.

Change the default password (raspberry) for pi user:

passwd

Make your node an open public archive node:

For this we will need to create the file /ardor/conf/nxt.properties and add the following information:

nxt.allowedBotHosts=*
nxt.apiServerHost=0.0.0.0
nxt.maxPrunableLifetime=-1
nxt.includeExpiredPrunable=true
nxt.myAddress={{Your external public IP address}}

Then restart ardor. You can do this by reconnecting to the screen, if you are not already attached, using the command

screen -r ardor

Then press CTRL + C to kill the node and once it is shutdown just start it back up with

sh ./run.sh

Lastly, you will want to make sure your firewall has ports 27874 and 27876 open and forwarded to your Raspberry Pi.

Power usage and solar panels

So here are the solar panels and batteries that I ended up trying through this project:

The dodocool seemed like a great option and deal…and sadly turned out to be to good to be true. I didn’t have a chance to test the solar output of it since the panels are connected to the battery in the combo, but I would be very surprised if it was charging anywhere near 12W. I left the panel out to charge for a full day and the whole time it seemed to always display 75% charged. I figured I would just try it and in less than 6 hours, the battery was dead. This unit also put out lower then 5v, making me think, even more, that it’s made of cheap parts. So this one is not an option.
Next I tried the Allpowers. I do really like this one and think it is an option for my next project where I maximize energy efficiency. However, with this one I learned something important. It seems these combos advertise the solar panels wattage and the battery output wattage, but they do not include the rate the battery can charge from the solar panels at. You would assume 15W, but that does not seem to be the case. From the company’s calculations, and my own, it would take 6–8 hours to fully charge the battery with their solar panels. Doing some math, I had calculated that the battery can actually only charge at around 5W, or 5V @ 1A, minus any inefficiencies (I estimated 80% charging efficiency). This isn’t terrible, but not ideal for dealing with cloudy days.
Lastly, I decided on getting the solar charger and battery separately. I settled on the TuffGear and RAVPower combo, for rated wattage, price, capacity, and considering my needs for this project. The RAVPower can charge at 10W, so it should take 7–9 hours to fully charge the battery, however this is twice as fast as the other options and the battery is much bigger, so a full charge should last more than a full day.

Running the normal Raspbian OS that was preinstalled with the Ardor node software running, we get the following power consumption:

  • 3.3W — with touchscreen plugged in
  • 2.5W — removing the touch screen

Using this information, we can calculate how long the node should run if there was no sunlight (in theory, assuming 100% efficiency and all stated energy capacity and consumption numbers are accurate. I am still testing real world numbers, but do expect them to be at least slightly lower):

  • 6.7hrs — with touchscreen and 6000mAh(22.2Wh) battery
  • 11.1hrs — with touchscreen and 10000mAh(37.0Wh) battery
  • 18.6hrs — with touchscreen and 16750mAh(62.0Wh) battery
  • 8.9hrs — without touchscreen and 6000mAh(22.2Wh) battery
  • 14.8hrs — without touchscreen and 10000mAh(37.0Wh) battery
  • 24.8hrs —without touchscreen and 16750mAh(62.0Wh) battery

With this information I would not recommend less then a 10000mAh battery if you want to run the node 100% off sunlight. Considering this project was to have a screen that always showed the node’s information, I would use the 16750mAh combo. I decided on this because of the faster charging rate of the battery, and higher capacity for cloudy days, then the other two combos or a separate 10000mAh battery to pair with the solar panels.
If you don’t run the touchscreen and typically get decent sunlight, you should be fine with a 10000mAh battery (not the cheap combination one I purchased though). In my next story, I get the Raspberry Pi3 B down to 1.7W, so the 6000mAh combo could be an option then, but I’ll probably still recommend at least 10000mAh

Next to come

Next I will do a headless installation with an e-ink display for even lower power usage hopefully on a Raspberry Pi Zero WH. If I cannot get Ardor to work with the 512mb on the Zero, then I will use the Raspberry Pi3 B again which appears to use 1.7W in a light OS, headless, setup.