Raspberry Pi SAFE Thread

Remove if not appropriate… but i’d love just 1 thread on Pi and ARM devices.
I’m running a node on an ubuntu machine, but would love to get one up and running on my little pi box that has a red flashing light.

this screen shot from the IT crowd is a little more realistic with the SAFENet.

So, if you’ve got it up and running on a pi - please write down instructions here. :slight_smile: :slight_smile:

EDIT: Putting the following at top of thread for us raspberry pi heads.

Compile and install instructions for raspberry pi using @happybeing amazing scripts.

  1. git clone GitHub - happybeing/safenetwork-farming: SAFE Network (Test) Farming
  2. from the ubuntu-build subdirectory run
    • setup.sh
    • build.sh

When prompted in the rust installer select the following,
(2) Custom installation
When prompted for default host triple: arm-unknown-linux-gnueabihf
When prompted for default tool chain: nightly
When prompted for profile: complete
When prompted for update path: y

I prefer to install rust before running happybeings scripts.

curl --proto ‘=https’ --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then follow the rust instructions above. Close and open a new terminal before running
happy beings setup.sh and build.sh scripts. When prompted for the rust install just
select option 3 to skip as you have already done this.

12 Likes

I have OrangePi PC with 64bit Armbian, so I wasnt able to use the precompiled binaries. I used the compile/install script from here
GitHub - happybeing/safenetwork-farming: SAFE Network (Test) Farming
and then the testnet config from the testnet thread. Everything looks fine, node runs, but it needs little bit of patience, compilation took 87 minutes :smiley:

8 Likes
8 Likes

Just a note that there is a Ubuntu release for Raspberry Pi if that’s what you are most comfortable with

2 Likes

Thanks for the tip, it’s just that the pi runs on an arm chip that’s the issue.

2 Likes

Check out the scripts below which include Raspberry Pi. They are fairly up to date, so there’s a good chance they will work. I’ll be trying them again soon, but if you have time give it a try and let me know how you get on.

6 Likes

I was able to get this up and running on the Raspberry Pi 4 Model B running Raspbian 10, with two minor issues. After cloning your repo, I ran setup.sh then build.sh

Issue 1:

(this was due to a previous installation, lines were left over in bashrc. Didn’t realize until looking into it further)

Issue 2:

The command safe networks switch shared-section returns an error:

Error: Format of the contacts addresses is not valid and couldn't be parsed

Caused by: invalid type: string "127.0.0.1:12000", expected a sequence at line 1 column 17

(this error is present via the CLI or when running test-auth.sh. Probably the quotes around the IP.)


After joining it to the testnet, I’m still seeing timeouts with the safe auth create --test-coins but that is for another thread…

Thank you to @happybeing and everyone who put this together, it’s great to be able to run this on rPi now!

4 Likes

I managed to cross compile pretty easily. Something I have never done so I feel like Obi Wan Kenobi right now… :partying_face:

What I am not clear on is after creating the directory and moving the binaries to pi do I have to set a PATH to the cli?

I have no idea what to do there, can a kind soul please ELI5.

5 Likes

Back in june 2020 I used @happybeing 's scripts to compile and install from source on the pi4, and at this time it was a breeze :

I didn’t try recently, but I definetely will once testnet v2 is published by the team.

I have a couple of 3B+, it does not work on them.

If you use the musl target for arm then it should work on the all. aarch64-unknown-linux-musl

[i.e. these are not the hardware floats you are looking for (waves 3 fingers slowly through the air) :wink: ]

3 Likes

The problem I had and I tried several times… the pi would crash at 398/407 in the build.
I am just about to get pi4’s instead seeing as nobody using Mark’s scripts have any issues on them.

1 Like

I did it… watch out Maidsafe I am coming for ya. :grin::joy:

6 Likes

@Savage Was there anything major you needed to change to get it working on the 3B+? Was it just overheating while compiling or something like that?

I dont really know. It would freeze and not recover so I could not see any errors.
I compiled on my pc instead.

1 Like

When I was compiling Safe on OprangePi I had to configure bigger SWAP file otherwise it died on not enough RAM space. Try watching top in another window during compile.

1 Like

I was guessing this. Pi3B+ has 1GB RAM whereas 4 is 2GB minimum I believe?
Any assumptions however are way past my pay grade, I shoot from the hip and hope for the best.

Nice!

Thanks for all your help.

Raspberry Pi 4, 8GB

uname -m gave me aarch64

so… i’ll have to reconfirm these notes on a clean droplet but these are some unorganized
notes I jotted down that might help others.

sudo apt update
sudo apt-get install gcc-aarch64-linux-gnu (I think I had to do this instead of the rustup command later)
curl --proto ‘=https’ --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
rustup target add aarch64-unknown-linux-musl
rustup target add aarch64-linux-gnu-gcc

~/.cargo$ cat config
[target.aarch64-unknown-linux-musl]
linker=“aarch64-linux-gnu-gcc”
rustflags = [ “-C”, “target-feature=+crt-static”, “-C”,“link-arg=-lgcc” ]

Then use the following in each repo checked out from maidsafe

CC=aarch64-linux-gnu-gcc cargo build --release --target=aarch64-unknown-linux-musl

4 Likes

Problem solved, thank you.
@happybeing’s install scripts are working like a charm and pi #2 is chugging along nicely.

I am happy that I learned to cross compile though. It is painstakingly slow on the pi.

7 Likes

Mine is - finally - online !
So glad :smiley:

7 Likes