Howto Install Piaware 3.8.1 on Ubuntu Server 20.04 arm64 / Pi4

Tested on Pi 4B, with “ubuntu-20.04-preinstalled-server-arm64+raspi.img”

CREDITS:
@obj
@abcd567
@postl
@mikkyo

NOTE:

(1) The packages librtlsdr0 and librtlsdr-dev are available in ubuntu repository and can be installed by command apt install. However these have a bug which kills the dump1090-fa. For this reason we will not use repository supplied packages, and build these from source code.

(2) Ubuntu considers the packages built from source-code as out dated, and during any upgrading, replaces these with those from repository. This results in failure of dump1090-fa.

I have therefore include command (sudo apt-mark hold librtlsdr0 librtlsdr-dev) at the end of step 2.1.2 to block their upgrade. However in case these get upgraded somehow, then reinstall them using the .deb packages you have built.

1 - Install tools needed to build packages from source code.

NOTE: The command below will install large number of packaes and will take considerable time to finish. Please be patient.

$ sudo apt install cmake pkg-config debhelper dh-systemd devscripts  

2 - DUMP1090-FA

2.1 - Build librtlsdr0 and librtlsdr-dev from source code

2.1.1 - Install dependencies

$ sudo apt install libusb-1.0-0-dev   

2.1.2 - Clone source code, build and install librtlsdr0 & librtlsdr-dev packages

$ cd ~/  
$ git clone https://github.com/steve-m/librtlsdr  
$ cd librtlsdr  
$ mkdir build && cd build  

$ cmake ../  
$ make  
$ cd ../  
$ dpkg-buildpackage -b  

## Install librtlsdr0 and librtlsdr-dev  
$ cd ../  
$ sudo dpkg -i librtlsdr0_0.6_arm64.deb  
$ sudo dpkg -i librtlsdr-dev_0.6_arm64.deb   

## Issue following command to prevent Ubuntu from replacing above
## installed packages by packages from repository during any unattended upgrade.

$ sudo apt-mark hold librtlsdr0 librtlsdr-dev  

2.2 - Build & Install dump1090-fa from source code

2.2.1 - Install dump1090-fa dependencies:

$ sudo apt install libncurses5-dev lighttpd   

2.2.2 - Clone source code, build and install dump1090-fa package

$ git clone https://github.com/flightaware/dump1090  

## Workaround for non-available bladeRF package
$ cd dump1090   
$ sudo sed -i 's/BLADERF=yes/BLADERF=no/' debian/rules   
$ sudo sed -i  's/, libbladerf-dev//' debian/control    
$ sudo sed -i 's/libbladerf1 (>= 0.2016.06), //' debian/control   

## Build dump1090-fa package
sudo dpkg-buildpackage -b --no-sign   

## Install dump1090-fa  
$ cd ../   
$ sudo dpkg -i dump1090-fa_3.8.1_arm64.deb   
$ sudo reboot   

3 - PIAWARE

3.1 - Install dependencies

$ sudo apt install tcl8.6-dev python3-dev libz-dev    
$ sudo apt install libboost-system-dev libboost-program-options-dev   
$ sudo apt install libboost-regex-dev libboost-filesystem-dev   
$ sudo apt install net-tools tclx8.4 tcllib itcl3   

3.2 - Build & Install dependency tcl-tls from source code.

## Install dependencies
$ sudo apt install libssl-dev tcl-dev chrpath   

## Clone source code, build & Install tcl-tls
$ cd ~/  
$ git clone http://github.com/flightaware/tcltls-rebuild.git   
$ cd tcltls-rebuild   
$ ./prepare-build.sh buster   
$ cd package-buster   
$ sudo dpkg-buildpackage -b --no-sign   
$ cd ../   
$ sudo dpkg -i tcl-tls_1.7.16-1+fa1_arm64.deb   

## Issue following command to prevent Ubuntu from replacing above
## installed packages by packages from repository during any unattended upgrade.

$ sudo apt-mark hold tcl-tls 

3.3 - Clone piaware source code, build package, and install package.

$ cd ~/  
$ git clone http://github.com/flightaware/piaware_builder   
$ cd piaware_builder   
$ sudo ./sensible-build.sh bionic   

## Workaround for pyvenv: 
$ cd package-bionic    
$ sudo sed -i 's/pyvenv $(VENV) --without-pip/$(PYTHON3) -m venv $(VENV) --without-pip/' debian/rules    
$ sudo sed -i 's/python3-venv, //' debian/control    

## After above Workaround, build the piaware package
$ sudo dpkg-buildpackage -b --no-sign   
$ cd ../   
$ sudo dpkg -i piaware_3.8.1~ubuntu1804+1_arm64.deb   

 

image

 

image

 

2 Likes

AUTOMATED INSTALL SCRIPT

https://github.com/abcd567a/piaware-arm64/blob/master/README.md

 

NOTE:
(1) There are two bash scripts, one for installing dump1090-fa and other for installing piaware

(2) Unlike the manual method in the first post of this thread, these automated install scripts do NOT build packages. Instead they download and install the packages which I have built and uploaded to Github. This makes installation process faster.

In addition, these scripts install all dependency packages from Ubuntu repository by built-in sudo apt install commands. This takes considerable time.

(3) When the scripts run, they download packages (which I have built by manual method in first post), and save these in following folders on your Pi:

/home/ubuntu/dump1090-fa-pkg
librtlsdr0_0.6_arm64.deb
librtlsdr-dev_0.6_arm64.deb
dump1090-fa_3.8.1_arm64.deb

/home/ubuntu/piaware-pkg .
tcl-tls_1.7.16-1+fa1_arm64.deb
piaware_3.8.1.ubuntu1804+1_arm64.deb

 

2 Likes

I had built, run, scratched my head and then found your post about the librtlsdr bug. Thanks!!!

Edit: Remaining action is to avoid the default librtlsdr from being installed over the compiled version. That just happened to me and everything stopped working.

sudo apt-mark hold librtlsdr0
sudo apt-mark hold librtlsdr-dev

2 Likes

Thanks @n252me for pointing out.
I have now added the command in step 2.1.2, immediately after installing the librtlsdr0 and librtlsdr-dev packages.

Actually I forgot to add these command, although @postl has already mentioned these

2 Likes

Is building from source required also if using the Ubuntu 32-bit version? Or does this work straight away with installing the Raspbian packages?

1 Like

I was wondering how the install will work with the Beta 64bit version of the Raspberry OS as well?
Currently don’t have a free Pi to test it out, so will watch with great interest.

Raspberry Pi OS (64bit) beta test

Replying to my own question:

Yes, it is working so far with some challenges. Two libraries were not easy to installed as dependency to piaware and dump1090-fa, but a manual install via Debian Buster repository worked it out.

Another step was the built in firewall which prevented dump1090-fa from beeing loaded and accessing the RTL-Stick.

So far, dump1090 and piaware are running. Let’s see how the other feeds are working. But this will be the project for the weekend

Raspbian 64 bit for RPi

@jonhawskes2030 has tried the method for Ubuntu arm64/Pi4 automated install (in 2nd post of this thread) on Raspbian arm64, and PM me following result:

Since the automated script (post #2 of this thread) downloads and installs .deb package (which I have built on Ubuntu arm64 and uploaded to Github), it may be possible the problem is caused because of using Ubuntu packages on Raspbian. Not sure, best way to find out is to try to build & install the package manually on Raspbian arm64 as per post #1 of this thread.

Post #1 has worked for me.

pi@raspbian64-bit-beta:~/piaware_builder $ sudo systemctl status dump1090-fa.service
● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-05-28 18:12:43 EDT; 8min ago
Docs: PiAware - ADS-B and MLAT Receiver - FlightAware
Main PID: 471 (dump1090-fa)
Tasks: 1 (limit: 1929)
CGroup: /system.slice/dump1090-fa.service
└─471 /usr/bin/dump1090-fa --net-only --max-range 360 --fix --net --net-heartbeat 60 --net-ro-size 1300 --net-ro-interval 0.2 --net-ri-port 0 --net-ro-port 30002

May 28 18:12:43 raspbian64-bit-beta systemd[1]: Started dump1090 ADS-B receiver (FlightAware customization).
May 28 18:12:43 raspbian64-bit-beta dump1090-fa[471]: Thu May 28 18:12:43 2020 EDT dump1090-fa 3.8.1 starting up.
May 28 18:12:43 raspbian64-bit-beta dump1090-fa[471]: Net-only mode, no SDR device or file open.
pi@raspbian64-bit-beta:~/piaware_builder $ sudo systemctl status piaware.service
● piaware.service - FlightAware ADS-B uploader
Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-05-28 18:20:52 EDT; 21s ago
Docs: PiAware - ADS-B and MLAT Receiver - FlightAware
Main PID: 7491 (piaware)
Tasks: 3 (limit: 1929)
CGroup: /system.slice/piaware.service
├─7491 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
└─7681 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout

May 28 18:20:54 raspbian64-bit-beta sudo[7659]: pam_unix(sudo:session): session closed for user root
May 28 18:20:55 raspbian64-bit-beta piaware[7491]: logged in to FlightAware as user guest
May 28 18:20:55 raspbian64-bit-beta piaware[7491]: my feeder ID is 828fa49e-b278-476d-a7a7-d34e29f3ffb9
May 28 18:20:55 raspbian64-bit-beta sudo[7672]: piaware : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/netstat --program --tcp --wide --all --numeric
May 28 18:20:55 raspbian64-bit-beta sudo[7672]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 28 18:20:55 raspbian64-bit-beta sudo[7672]: pam_unix(sudo:session): session closed for user root
May 28 18:20:56 raspbian64-bit-beta piaware[7491]: ADS-B data program ‘dump1090-fa’ is listening on port 30005, so far so good
May 28 18:20:56 raspbian64-bit-beta piaware[7491]: Starting faup1090: /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout
May 28 18:20:56 raspbian64-bit-beta piaware[7491]: Started faup1090 (pid 7681) to connect to dump1090-fa
May 28 18:20:56 raspbian64-bit-beta piaware[7491]: UAT support disabled by local configuration setting: uat-receiver-type
pi@raspbian64-bit-beta:~/piaware_builder $ uname -a
Linux raspbian64-bit-beta 5.4.42-v8+ #1319 SMP PREEMPT Wed May 20 14:18:56 BST 2020 aarch64 GNU/Linux
pi@raspbian64-bit-beta:~/piaware_builder $

1 Like

@jonhawkes2030
Glad to know the manual method of post #1 worked on Raspbian arm64 also.

This weekend I will manually build & install dump1090-fa and piaware packages on Raspbian arm64 / RPi4.

If all goes well, I will upload these packages to github and write bash scripts to install these packages on Raspbian arm64 / RPi 4. This will make life easy for those who dont want to take trouble to built & install manually. :slight_smile:

3 Likes

Thanks! This worked for me on Ubuntu 20 with amd64.

ubuntu server 20.04 came with python3.8.2 for me. After python3.6, python3-venv package does not create /usr/bin/pyvenv. The piaware build always failed with pyvenv not found. You can create /usr/bin/pyvenv to avoid this error.

There may be a broken symlink, move it out of the way
mv /usr/bin/pyvenv /usr/bin/pyvenv.old

echo “#!/bin/sh” > /usr/bin/pyvenv
echo “python3 -m venv $@” >> /usr/bin/pyvenv
chmod 755 /usr/bin/pyvenv

Thanks @briancoppola for the tip.

I have already tried this hack about 3 months ago, but it did not resolve the problem of building piaware package. Please see the first post linked below (click it to see in full and in proper format).

Finally @obj guided me. Please see the 2nd post linked below.

Based on @obj’s tip, I decided to remove the python venv entries from file debian/control and debian/rules, and finalized the steps to build piaware. Please see 3rd post linked below.

 

 

 

1 Like

What exactly is the bug and is it currently in train to get fixed? I see later updates to Ubuntu have picked up newer versions of the package from time to time and I would prefer to not have to rebuild on each update. Hopefully the fork won’t be needed for too long.

That would be a question for the upstream Ubuntu maintainers. IIRC the bug is actually a kernel bug which is tickled on aarch64 by librtlsdr when zerocopy is enabled. Newer kernels have a fix for that (but an unfortunate side-effect is that librtlsdr with zerocopy enabled then has poor performance).

Newer upstream librtlsdr has zerocopy disabled by default, I believe, so it’s mostly a case of the Ubuntu packages maintainers picking up that change.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.