[OUTDATED] Howto Install Piaware 3.8.1 on Ubuntu 18 & 19 and Debian 10 amd64 on PC

OK, modified version number in debian/changelog and built package with version 0.6.0-3, and installed, but Ubuntu repository is smart, refuses to accept bumped version as genuine:

ubuntu@ubuntu:~$ apt list --upgradable
Listing... Done
... ... ...
... ... ...
librtlsdr-dev/focal 0.6.0-3 arm64 [upgradable from: 0.6.0-3]
librtlsdr0/focal 0.6.0-3 arm64 [upgradable from: 0.6.0-3]
... ... ...
... ... ...

 

ubuntu@ubuntu:~/librtlsdr$ git diff 

diff --git a/debian/changelog b/debian/changelog
index 24d97e2..83f63a3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-rtl-sdr (0.6git) unstable; urgency=medium
+rtl-sdr (0.6.0-3) unstable; urgency=medium

   * New upstream release
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index 433ed5b..cdd2853 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1748,7 +1748,7 @@ static int _rtlsdr_alloc_async_buffers(rtlsdr_dev_t *dev)
        dev->xfer_buf = malloc(dev->xfer_buf_num * sizeof(unsigned char *));
        memset(dev->xfer_buf, 0, dev->xfer_buf_num * sizeof(unsigned char *));

-#if defined (__linux__) && LIBUSB_API_VERSION >= 0x01000105 
+#if defined (__linux__) && LIBUSB_API_VERSION >= 0x01000105 && 0
        fprintf(stderr, "Allocating %d zero-copy buffers\n", dev->xfer_buf_num);

        dev->use_zerocopy = 1; 

 

ubuntu@ubuntu:~$ ls 

dump1090-fa                          librtlsdr-dev_0.6.0-3_arm64.deb
dump1090-fa-dbgsym_3.8.1_arm64.ddeb  librtlsdr0-dbgsym_0.6.0-3_arm64.ddeb
dump1090-fa_3.8.1_arm64.buildinfo    librtlsdr0_0.6.0-3_arm64.deb
dump1090-fa_3.8.1_arm64.changes      rtl-sdr-dbgsym_0.6.0-3_arm64.ddeb
dump1090-fa_3.8.1_arm64.deb          rtl-sdr_0.6.0-3_arm64.buildinfo
dump1090_3.8.1_all.deb               rtl-sdr_0.6.0-3_arm64.changes
librtlsdr                            rtl-sdr_0.6.0-3_arm64.deb

I think if you just build master, this is already fixed.
There is a flag for zero copy,

–enable-zerocopy Enable usbfs zero-copy support (disabled by default)

which sets the macro ENABLE_ZEROCOPY=1 if set and doesn’t set it if not.
And that line you changed is now

#if defined(ENABLE_ZEROCOPY) && defined (linux) && LIBUSB_API_VERSION >= 0x01000105

2 Likes

Thank you @mikkyo.
I now built it from master branch, and without any modification to file librtlsdr/src/librtlsdr.c.
It works OK .

2 Likes

ubuntu-20.04-preinstalled-server-arm64+raspi.img

Installed on PI-4

Tried to build piaware, got stuck with python3-venv

ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.4.0-1008-raspi #8-Ubuntu SMP Wed Apr 8 11:13:06 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

 

make[2]: Leaving directory '/home/ubuntu/piaware_builder/package-bionic/dump1090'
pyvenv /home/ubuntu/piaware_builder/package-bionic/debian/venv --without-pip
make[1]: pyvenv: Command not found
make[1]: *** [debian/rules:61: setup_venv] Error 127
make[1]: Leaving directory '/home/ubuntu/piaware_builder/package-bionic'
make: *** [debian/rules:95: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2  

 

ubuntu@ubuntu:~$ apt policy python3-venv
python3-venv:
  Installed: 3.8.2-0ubuntu2
  Candidate: 3.8.2-0ubuntu2
  Version table:
 *** 3.8.2-0ubuntu2 500
        500 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 Packages
        100 /var/lib/dpkg/status

ubuntu@ubuntu:~$ pyvenv

Command 'pyvenv' not found, but can be installed with `python3-venv`

`

ubuntu-20.04-preinstalled-server-arm64+raspi.img, Installed on PI-4

Tried following hack.

$ sudo mv /usr/bin/pyvenv /usr/bin/pyvenv.orig
$ sudo ln -s /usr/share/bash-completion/completions/pyvenv /usr/bin/pyvenv
$ sudo chmod +x /usr/share/bash-completion/completions/pyvenv    

$ ls -l /usr/bin/pyvenv
lrwxrwxrwx 1 root root 45 May 17 23:34 /usr/bin/pyvenv -> /usr/share/bash-completion/completions/pyvenv    

 

After the above hack, the error “pyvenv: command not found” disappeared, but another error appeared: “/usr/bin/pyvenv: 23: complete: not found”. :rage:

ubuntu@ubuntu:~/piaware_builder/package-bionic$ sudo dpkg-buildpackage -b --no-sign
... ... ...
... ... ...
pyvenv /home/ubuntu/piaware_builder/package-bionic/debian/venv --without-pip
/usr/bin/pyvenv: 23: complete: not found
make[1]: *** [debian/rules:61: setup_venv] Error 127
make[1]: Leaving directory '/home/ubuntu/piaware_builder/package-bionic'
make: *** [debian/rules:95: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

Try applying the change to buster/rules from Directly call the venv module rather than using pyvenv; Ubuntu/Kali · flightaware/piaware_builder@dabf7df · GitHub

2 Likes

Thanks to @obj with whose help & guidance I could finally succeed in installing dump1090-fa and piaware on Pi 4B running Ubuntu Server 20.04 arm64.

Thanks also to @postl and @mikkyo for their contribution.

I have created a separate thread for the finished procedure. This will enable users to get the complete and final howto without need to brows through lot of posts.

Howto Install Piaware 3.8.1 on Ubuntu Server 20.04 arm64 / Pi4

 

4 Likes

My AMD64 Ubuntu 19 offers the update to 20. I’m reluctant to do the upgrade…
Will this upgrade work now?

I did not try it, so not sure, but feel that if you have installed piaware and dump1090-fa according to fist post of this thread it should work even after upgrade.

If I find time this weekend (or may be next weekend), I will try upgrade of ver 19 amd64 to ver 20 amd64 on VM, and see what happens.

2 Likes

The installs were done a long time ago, per your other thread, and regular updates applied (with no ill effects).

Ok, upgraded from Ubuntu 19 to Ubuntu 20.

abcd@ubuntu19:~$ update-manager  

Took about 2 hrs to complete :slightly_frowning_face:

 

Piaware knocked-out by upgrade

abcd@ubuntu19:~$ sudo systemctl status piaware
● piaware.service
     Loaded: masked (Reason: Unit piaware.service is masked.)
     Active: inactive (dead)

 

dump1090-fa survived the upgrade

abcd@ubuntu19:~$ sudo systemctl status dump1090-fa
[sudo] password for abcd:
● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
     Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor p>
     Active: active (running) since Sat 2020-05-23 17:25:01 EDT; 2min 3s ago
       Docs: https://flightaware.com/adsb/piaware/
   Main PID: 2124 (dump1090-fa)
      Tasks: 3 (limit: 4657)
     Memory: 4.2M
     CGroup: /system.slice/dump1090-fa.service
             └─2124 /usr/bin/dump1090-fa --device-index 00001090 --gain -10 --p>

May 23 17:25:01 ubuntu19 systemd[1]: Started dump1090 ADS-B receiver (FlightAwa>
May 23 17:25:01 ubuntu19 dump1090-fa[2124]: Sat May 23 17:25:01 2020 EDT  dump1>
May 23 17:25:02 ubuntu19 dump1090-fa[2124]: rtlsdr: using device #0: Generic RT>
May 23 17:25:02 ubuntu19 dump1090-fa[2124]: Detached kernel driver
May 23 17:25:03 ubuntu19 dump1090-fa[2124]: Found Rafael Micro R820T tuner
May 23 17:25:03 ubuntu19 dump1090-fa[2124]: rtlsdr: enabling tuner AGC
May 23 17:25:04 ubuntu19 dump1090-fa[2124]: Allocating 4 zero-copy buffers
1 Like

Hi,
I have issue with 2.2 point.

dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/librtlsdr.so.0 (used by debian/dump1090-fa/usr/bin/dump1090-fa)
Hint: check if the library actually comes from a package.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/dump1090-fa.substvars debian/dump1090-fa/usr/bin/view1090-fa debian/dump1090-fa/usr/bin/dump1090-fa returned exit code 255
dh_shlibdeps: Aborting due to earlier error

Ubuntu version

ubuntu@ubuntu18:~/dump1090-fa$ uname -a
Linux ubuntu18 5.3.0-53-generic #47~18.04.1-Ubuntu SMP Thu May 7 13:10:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Package version

ubuntu@ubuntu18:~/dump1090-fa$ apt list --installed | grep librtl
librtlsdr-dev/bionic,now 0.6.0-myriadrf1~bionic amd64 [zainstalowany]
librtlsdr0/bionic,now 0.6.0-myriadrf1~bionic amd64 [zainstalowany,automatycznie]

Your file is shown in folder /usr/local/lib/
My file is NOT in folder /usr/local/lib/ .
It is in folder /usr/lib/x86_64-linux-gnu/
It has dependency information (see NEEDED in output of 2nd command)

 abcd@ubuntu18:~$ dpkg -S librtlsdr.so.0  

librtlsdr0:amd64: /usr/lib/x86_64-linux-gnu/librtlsdr.so.0
librtlsdr0:amd64: /usr/lib/x86_64-linux-gnu/librtlsdr.so.0.5.3

 

abcd@ubuntu18:~$  readelf -d /usr/lib/x86_64-linux-gnu/librtlsdr.so.0 | grep NEEDED

 0x0000000000000001 (NEEDED)             Shared library: [libusb-1.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

1 Like

Thank you!

I guess I’ll wait for the upgrade. I don’t get why the piaware was marked as “dead”.

After Upgrade of Ubuntu 19 amd64 to Ubuntu 20 amd64, piaware.service became masked. Why? dont know.

/etc/systemd/system/piaware.service -> /dev/null

 

abcd@ubuntu:~$ sudo find / -name piaware.service 

/var/lib/systemd/deb-systemd-helper-enabled/default.target.wants/piaware.service
/var/lib/systemd/deb-systemd-helper-masked/piaware.service
/etc/systemd/system/piaware.service

 

abcd@ubuntu:~$ ls -l /etc/systemd/system/piaware.service

lrwxrwxrwx 1 root root 9 May 23 14:41 /etc/systemd/system/piaware.service -> /dev/null   

SOLVED

Still had piaware_builder and inside it piaware .deb package which I have built on Ubuntu 19.

Purged, then reinstalled, and all is normal now.

$ sudo dpkg --purge piaware   
$ cd piaware_builder   
$ sudo dpkg -i piaware_3.8.1~ubuntu1904+1_amd64.deb  

$ sudo piaware-config feeder-id xxxxxxxxxxxxxxxx  
$ sudo piaware-config allow-auto-updates yes 
$ sudo piaware-config allow-manual-updates yes 
$ sudo systemctl restart piaware 
1 Like

I installed packages from point 2.1
I have the same output for both commands like you. But I have still the same error. How can I fix it?

lucpo@ubuntu18:~/dump1090-fa$ dpkg -S librtlsdr.so.0
librtlsdr0:amd64: /usr/lib/x86_64-linux-gnu/librtlsdr.so.0
librtlsdr0:amd64: /usr/lib/x86_64-linux-gnu/librtlsdr.so.0.5.3
lucpo@ubuntu18:~/dump1090-fa$ readelf -d /usr/lib/x86_64-linux-gnu/librtlsdr.so.0 | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libusb-1.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

@lucpo1

Seems some of the dependencies in step 2.1 did not get installed properly.
Purge these 5, then reinstall these 5.
Do it one by one and keep an eye on output of each command to find where the problem has occurred.

Do it slowly and carefully so that you dont miss any one of these 5 purges and 5 installs

sudo apt purge lighttpd 
sudo apt purge librtlsdr-dev   
sudo apt purge libusb-1.0-0-dev   
sudo apt purge libncurses5-dev   
sudo apt purge libbladerf-dev    

 

sudo apt install lighttpd   
sudo apt install libusb-1.0-0-dev   
sudo apt install librtlsdr-dev   
sudo apt install libncurses5-dev   
sudo apt install libbladerf-dev    

 

After completing above, go to step 2.2

 

I purged these 5 and then reinstalled. There were no errors. The same error.

If it is not due to dependencies, then it may be due to corrupted debian/rules or some other file in cloned source code.

Delete cloned folder
sudo rm -rf dump1090-fa

Now clone fresh copy of source code by repeating step 2.2 from begening:

git clone https://github.com/flightaware/dump1090 dump1090-fa

Every time I clone fresh copy of source code. Still the same error.