1

I have a Raspberry Pi 3 and a microSD card (Samsung EVO+ 256 GB with advertised 95 Mb/s read and 90 Mb/s write). I'm using Ubuntu Mate 16.04, pretty much default setup (just added x11vnc for convenience). I have a 228 GB file system dedicated to the Monero blockchain (symbolic to it from ~/.bitmonero so I don't need to pass --data-dir on the command-line):

I managed to get the Monero blockchain synced by:

  1. Copying the entire ~/.bitmonero directory from my macOS node.
  2. Letting the Raspberry Pi 3 catch up with the latest blocks.

After that, I was able to synchronze my Monero wallet from another computer using my internal Raspberry Pi 3 node, and could successfully send a transaction to someone.

Unfortunately, after a day, I noticed my Raspberry Pi 3 node had freezed up. Rebooting and restarting monerod wouldn't succeed anymore catching up with the newer blocks. After a minute or so, the system would again become completely unresponsive. I tried it a couple of times, but to no avail.

The command I used to start my daemon was (tried all kind of sync sizes):

monerod --rpc-bind-ip \`ip route get 8.8.8.8 | awk '{ print $NF; exit }'\` --confirm-external-bind --fluffy-blocks --block-sync-size 100 --detach

No my question(s) are:

  1. Is it überhaupt possible to maintain a stable Raspberry Pi 3 node with an internal microSD card as storage? I don't want to resort to an external disk, as for me that nullifies the attractiveness of the form factor.
  2. What is the recommended software setup to do this (OS, such as Raspbian and configuration)?
  • What does dmesg say? – Alexander Feb 10 '18 at 13:08
  • dmesg outputs a lot. – dpzz Feb 10 '18 at 22:20
  • @dpzz - Try using --block-sync-size 5 instead of --block-sync-size 100. Even a "normal" system will fail to sync with such a high --block-sync-size – dEBRUYNE Feb 13 '18 at 13:40
  • Thanks for the suggestion, although I tried even --block-sync-size 1 and after a couple of minutes, it's game over. – dpzz Feb 14 '18 at 11:45
2

After reading some of the instructions over at http://pinode.co.uk, I think I found the culprit. Turned out Ubuntu MATE for Raspberry Pi doesn't install with swap space out-of-the-box. I wasn't aware of this.

I have now added a 1024 MB linux-swap partition on my microSD card with GParted. I won't be very fast, but at least it's there.

enter image description here

Therefore, I also reduced the "swappiness" from the default 60 down to 0, which should reduce the tendency to use swap, unless absolutely required:

$ cat /proc/sys/vm/swappiness
60
$ sudo sysctl vm.swappiness=0
$ cat /proc/sys/vm/swappiness
0

To make the change permanent, edit /etc/sysctl.conf as root:

sudo vi /etc/sysctl.conf

And add the following line:

vm.swappiness = 0

Output of the free command when starting up monerod shows free memory takes a nose dive from ± 710 KB:

              total        used        free      shared  buff/cache   available
Mem:         949580       40424      710540        6760      198616      841848
Swap:       1048572           0     1048572

to roughly ± 35 KB

              total        used        free      shared  buff/cache   available
Mem:         949580       60428       36532        6760      852620      818640
Swap:       1048572           0     1048572

After monerod was fully synchronized again, it seems my Raspberry Pi 3 system is using just a little bit of swap space:

              total        used        free      shared  buff/cache   available
Mem:         949580      133652       33256        3768      782672      748508
Swap:       1048572        2988     1045584

That's probably why it system crashed previously without that swap ability.

I don't know exactly how to configure these newer Linux systems in "runlevel 3", if that still exists, to even consume less RAM. As a workaround, I have stopped some unnecessary services:

for SERVICE in x11vnc lightdm bluetooth cups
do
    sudo systemctl stop ${SERVICE}.service
done

If anyone has a better suggestion for that, feel free to comment or edit.

1

Yes, there’s now a complete step-by-step guide for a Monero node on Raspberry Pi 3 available on GitHub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.