FreeBSD / RaspBSD - Installation of dump1090 (fa or mut)

Has any one experience to install dump1090-mutability/dump1090-fa on FreeBSD/RaspBSD?

This morning I visited following page to download FreeBSD image for RPi
https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-freebsd-for-raspberry-pi/

Was redirected to this site:
http://www.raspbsd.org/raspberrypi.html

Downloaded, unzipped,and wrote following image to microSD card
FreeBSD-armv6-12.0-RPI2-310476.img

Slipped-in the microSD card in RPi Model2, powered up, SSH and logged-in
Checked date, was some date of year 2016.
Corrected date by following command:
~ # ntpdate pool.ntp.org

Set time zone by command:
~ # tzsetup

Setup Binary Package Management Utility “Ports”:
~ # portsnap fetch
~ # portsnap extract

Installed packages
~ # pkg install git … Installed
~ # pkg instal rtl-sdr … Installed
~ # pkg install librtlsdr-dev … No packages available to install matching ‘librtlsdr-dev’ have been found in the repositories
~ # pkg install libusb-1.0-0-dev … No packages available to install matching ‘libusb-1.0-0-dev’ have been found in the repositories
~ # pkg install lighttpd … Installed

Now tried to make binary package from source of dump1090-mutability. FAILED

root@rpi2: /usr/home/raspberry # mkdir install-dump
root@rpi2: /usr/home/raspberry # cd install-dump
root@rpi2: /usr/home/raspberry/install-dump # git clone github.com/mutability/dump1090.git
Cloning into ‘dump1090’…
remote: Counting objects: 5310, done.
remote: Total 5310 (delta 0), reused 0 (delta 0), pack-reused 5310
Receiving objects: 100% (5310/5310), 6.93 MiB | 1.42 MiB/s, done.
Resolving deltas: 100% (3556/3556), done.

root@rpi2: /usr/home/raspberry/install-dump # cd dump1090
root@rpi2: /usr/home/raspberry/install-dump/dump1090 # make

make: “/usr/home/raspberry/install-dump/dump1090/Makefile” line 7: Need an operator
make: “/usr/home/raspberry/install-dump/dump1090/Makefile” line 9: Need an operator
make: “/usr/home/raspberry/ install-dump/dump1090/Makefile” line 11: Need an operator
make: “/usr/home/raspberry/ install-dump/dump1090/Makefile” line 15: Need an operator
make: “/usr/home/raspberry/ install-dump/dump1090/Makefile” line 25: Missing dependency operator
make: “/usr/home/raspberry/ install-dump/dump1090/Makefile” line 28: Need an operator
make: “/usr/home/raspberry/ install-dump/dump1090/Makefile” line 29: Missing dependency operator
make: Unknown modifier ’ ’
make: “/usr/home/raspberry/install-dump/dump1090/Makefile” line 31: Missing dependency operator
make: “/usr/home/raspberry/install-dump/dump1090/Makefile” line 34: Need an operator
make: “/usr/home/raspberry/install-dump/dump1090/Makefile” line 38: Need an operator
make: “/usr/home/raspberry/install-dump/dump1090/Makefile” line 39: Need an operator
make: “/usr/home/raspberry/install-dump/dump1090/Makefile” line 41: Missing dependency operator
make: “/usr/home/raspberry/install-dump/dump1090/Makefile” line 44: Need an operator
make: Fatal errors encountered – cannot continue
make: stopped in /usr/home/raspberry/install-dump/dump1090

Try “gmake”

No Luck!

root@rpi2:/usr/home/raspberry/install-dump/dump1090 # gmake
gmake: Command not found.

root@rpi2:/usr/home/raspberry/install-dump/dump1090 # pkg install gmake
Installing gmake-4.2.1_1…

root@rpi2:/usr/home/raspberry/install-dump/dump1090 # gmake

gcc -DMODES_DUMP1090_VERSION="v1.15-dev-327-gb155fdb" -O2 -g -Wall -Werror -W pkg-config --cflags librtlsdr libusb-1.0 -c dump1090.c -o dump1090.o
/ bin / sh: pkg-config: not found
/ bin / sh: gcc: not found
gmake: *** [Makefile:49: dump1090.o] Error 127

Well, you’re going to have to set CC (probably to clang) and explicitly pass LIBS_RTL etc. Have you built stuff on FreeBSD before?

This is all Greek to me :confused:

Have you built stuff on FreeBSD before?

NO, NEVER.
This is first time I have installed FreeBSD, or any version of BSD. I never owned or used Mac, which I understand has an OS based on BSD.

There are a bunch of variables defined in the makefile (CC, LIBS_RTL, etc) that will need adjustment for your freebsd environment.

one notable thing about recent freebsd is that it’ll have clang as the default compiler, not gcc, so you’ll need to set CC=clang

Thanks Oliver for prompt help. Will give it a try. For me it is like sailing in unknown waters.

I have previous played with piaware code on FreeBSD for x86/amd64. I wasn’t able to get it fully working. There seemed to be issues in the FreeBSD USB stack that prevented it from sampling the receiver fast enough or regularly enough to function.

Some luck today - dump1090 installed and working

Noted that the command “pkg install [application_name]” has stopped working on the RaspBSD site’s “FreeBSD-armv6-12.0-RPI2-310476.img”.
Also noted RaspBSD distros have been removed (temporarily??) from RaspBSD site.
Downloaded “FreeBSD-11.1-RELEASE-arm-armv6-RPI2.img” from freebsd.org/where.html

Format microSD card, and wrote “FreeBSD-11.1-RELEASE-arm-armv6-RPI2.img”.
Slipped microSD card into RPi Model2 and powered up and SSH.

#Synchronized clock



root@rpi2:/home/freebsd # ntpdate pool.ntp.org


#Set time zone to Canada EST



root@rpi2:/home/freebsd # tzsetup


#Installed rtl-sdr pckage



root@rpi2:/home/freebsd # pkg install rtl-sdr
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Installing pkg-1.10.1...

New packages to be INSTALLED:
        rtl-sdr: 20140210_10
Proceed with this action? [y/N]: y
Installing rtl-sdr-20140210_10...


#Tested rtl-sdr, found OK



root@rpi2:~ # rtl_test -t
Found 1 device(s):
  0:  Realtek, RTL2832U, SN: 00001003

Using device 0: Generic RTL2832U
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.


#Tried to install dump1090-mutability package, NOT AVAILABLE



root@rpi2:/home/freebsd # pkg install dump1090-mutability
pkg: No packages available to install matching 'dump1090-mutability' have been found in the repositories


#Tried to install dump1090-fa package, NOT AVAILABLE



root@rpi2:/home/freebsd # pkg install dump1090-fa
pkg: No packages available to install matching 'dump1090-fa' have been found in the repositories


**#Tried to install dump1090 (Malcom Robson) package. Got installed dump1090 Salvatore Sanfilippo (antirez) **



root@rpi2:/home/freebsd # pkg install dump1090
New packages to be INSTALLED:
        dump1090: 20150225
Proceed with this action? [y/N]: y
Installing dump1090-20150225...


#Run dump1090



root@rpi2:~ # cd /usr/local/bin/
root@rpi2:/usr/local/bin # ./dump1090 --interactive --net --net-http-port 80

Found 1 device(s):
0: Realtek, RTL2832U, SN: 00001003 (currently selected)
Found Rafael Micro R820T tuner
Max available gain is: 49.60
Setting gain to: 49.60
Exact sample rate is: 2000000.052982 Hz
Gain reported by device: 49.60

Hex    Flight   Altitude  Speed   Lat       Lon       Track  Messages Seen   .
--------------------------------------------------------------------------------
a0ee32          0         0       0.000     0.000     0     1         0 sec
a24ef0          0         0       0.000     0.000     0     1         0 sec
ab4840          0         473     0.000     0.000     48    1         1 sec
ade18c          0         468     0.000     0.000     248   1         1 sec
c055ec          0         0       0.000     0.000     0     1         1 sec
ab20e7          0         0       0.000     0.000     0     1         1 sec
c0248c          0         0       0.000     0.000     0     1         1 sec
c01734          8325      279     0.000     0.000     105   2         1 sec
c02ec7          24575     444     0.000     0.000     240   3         0 sec
^C


FREASH ATTEMPT TONIGHT - FAILED

FreeBSD on Oracle VM on Windows Desktop: FreeBSD-11.2-RELEASE-i386

@obj

STEP(1)

root@freebsd:~ # pkg install pkgconf
root@freebsd:~ # pkg install gcc
root@freebsd:~ # pkg install gmake

STEP (2)

root@freebsd:~ # git clone https://github.com/mutability/dump1090.git
root@freebsd:~ # cd dump1090

STEP (3)

root@freebsd:~/dump1090 # nano Makefile

Changed following two:

LIBS_RTL=pkg-config --libs librtlsdr libusb-1.0
to
LIBS_RTL=pkgconf --libs librtlsdr libusb-1.0

CC=gcc
to
CC=clang

STEP (4)

root@freebsd:~/dump1090 # gmake

clang -DMODES_DUMP1090_VERSION=\"v1.15-dev-334-g0ec2dd8\" -O2 -g -Wall -Werror -W -Wno-unknown-warning-option -Wno-format-truncation `pkg-config --cflags librtlsdr libusb-1.0`  -c dump1090.c -o dump1090.o
In file included from dump1090.c:50:
In file included from ./dump1090.h:85:
./compat/compat.h:23:11: fatal error: 'endian.h' file not found
# include <endian.h>
          ^~~~~~~~~~
1 error generated.
gmake: *** [Makefile:49: dump1090.o] Error 1

EDIT:

root@freebsd:~/dump1090 # find / -name endian.h

/usr/include/machine/endian.h
/usr/include/sys/endian.h
/usr/include/x86/endian.h

clang compiler include path is probably set to look for headers that don’t exist. It wants something in ./compat/… I haven’t used clang, but you might be able to fix it with with an -INCLUDE= option to clang, or a nasty symlink.

@obj

Tried one more trick.

I have dump1090-mutability on Raspbian x86 in VM. I copied its file /usr/bin/dump1090-mutability to Windows Desktop, then from there to FreeBSD on VM.

Then on FreeBSD did following

install dump1090-mutability  /usr/bin/dump1090-mutability

pkg install comms/rtl-sdr 
pkg install emulators/linux_base-c6
kldload linux
echo 'linux_enable="YES"' >> /etc/rc.conf
cd /usr/bin
brandelf -t Linux dump1090-mutability

After above steps, issued following command:


dump1090-mutability

Got this response:

dump1090-mutability: error while loading shared libraries: librtlsdr.so.0: cannot open shared object file: No such file or directory

Next Tried:

pkg install librtlsdr-dev

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'librtlsdr-dev' have been found in the repositories

Then tried:

pkg install librtlsdr

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'librtlsdr' have been found in the repositories

:frowning: :frowning: :frowning:

OK, so there’s no current FreeBSD package for librtlsdr. You can go old school and compile, install, and ldconfig from the sources, but the question is Why? FreeBSD leans more toward server style use, not userland rtl_sdr stuff. I’m not seeing a compelling reason to go to FreeBSD unless you enjoy that kind of thing.

… the joy of exploring & experimenting, like sailing in unknown waters :slight_smile:

OK, started Raspbaian Jessie x86 on VM and tried to find file librtlsdr.so.0

pi@raspberry:~ $ sudo find / -name librtlsdr.so.0
/usr/lib/fr24/librtlsdr.so.0
/usr/lib/i386-linux-gnu/librtlsdr.so.0

Copied file /usr/lib/i386-linux-gnu/librtlsdr.so.0 from Raspbian x86 on VM to Windows Desktop, then from Windows Desktop tp FreeBSD i386 on VM in folder /usr/home/abcd then did following

root@freebsd:/usr/home/abcd # ls

.cshrc                  .mail_aliases           .rhosts                 librtlsdr.so.0
.login                  .mailrc                 .shrc                   stats_thread.core
.login_conf             .profile                dump1090-mutability
root@freebsd:/usr/home/abcd # install librtlsdr.so.0 /usr/lib/librtlsdr.so.0

root@freebsd:/usr/home/abcd # ls /usr/lib/librtlsdr*
/usr/lib/librtlsdr.so.0

Now gave the command

root@freebsd:/usr/home/abcd # dump1090-mutability

dump1090-mutability: error while loading shared libraries: libusb-1.0.so.0: cannot open shared object file: No such file or directory

:frowning: :frowning: :frowning:

.

NEXT STEP:

Copy libusb-1.0.so.0 from Raspbian x86 to FreeBSD

.

librtlsdr probably won’t even compile for freebsd.
i mean you can try git clone on GitHub - keenerd/rtl-sdr: RTL-SDR experimental branch
and then compile

recommend you try the process on linux first.
you can also statically link dump1090 in the compilation process if you supply the right command line arguments. that way you don’t need to install the library, you will still need it compiled though.

and copying over binaries will not work.

One more FAILED attempt

Copied file dump1090-mutability_1.15~dev_i386.deb from Raspbian x86 on VM >> Windows Desktop >> FreeBSD_i386 on VM.

Then did following:

root@freebsd:/usr/home/abcd #  pkg install dpkg

root@freebsd:/usr/home/abcd # dpkg --install dump1090-mutability_1.15~dev_i386.deb

dpkg: error processing archive dump1090-mutability_1.15~dev_i386.deb (--install):
 package architecture (i386) does not match system (freebsd-i386)
Errors were encountered while processing:
 dump1090-mutability_1.15~dev_i386.deb

Finally got fed-up, and opened a thread in FreeBSD forums for help:

[pkg-request] / [port-request] dump1090-mutability for FreeBSD

Two Poles-Apart "Makefile"

1/2 - A SAMPLE "Makefile" from FreeBSD docs

[the header...just to make it easier for us to identify the ports.]
# $FreeBSD$
[ ^^^^^^^^^ This will be automatically replaced with RCS ID string by SVN
when it is committed to our repository.  If upgrading a port, do not alter
this line back to "$FreeBSD$".  SVN deals with it automatically.]

[section to describe the port itself and the master site - PORTNAME
 and PORTVERSION or the DISTVERSION* variables are always first,
 followed by CATEGORIES, and then MASTER_SITES, which can be followed
 by MASTER_SITE_SUBDIR.  PKGNAMEPREFIX and PKGNAMESUFFIX, if needed,
 will be after that.  Then comes DISTNAME, EXTRACT_SUFX and/or
 DISTFILES, and then EXTRACT_ONLY, as necessary.]
PORTNAME=	xdvi
DISTVERSION=	18.2
CATEGORIES=	print
[do not forget the trailing slash ("/")!
 if not using MASTER_SITE_* macros]
MASTER_SITES=	${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR=	applications
PKGNAMEPREFIX=	ja-
DISTNAME=	xdvi-pl18
[set this if the source is not in the standard ".tar.gz" form]
EXTRACT_SUFX=	.tar.Z

[section for distributed patches -- can be empty]
PATCH_SITES=	ftp://ftp.sra.co.jp/pub/X11/japanese/
PATCHFILES=	xdvi-18.patch1.gz xdvi-18.patch2.gz
[If the distributed patches were not made relative to ${WRKSRC},
 this may need to be tweaked]
PATCH_DIST_STRIP=	-p1

[maintainer; *mandatory*!  This is the person who is volunteering to
 handle port updates, build breakages, and to whom a users can direct
 questions and bug reports.  To keep the quality of the Ports Collection
 as high as possible, we do not accept new ports that are assigned to
 "ports@FreeBSD.org".]
MAINTAINER=	asami@FreeBSD.org
COMMENT=	DVI Previewer for the X Window System

[license -- should not be empty]
LICENSE=	BSD2CLAUSE
LICENSE_FILE=	${WRKSRC}/LICENSE

[dependencies -- can be empty]
RUN_DEPENDS=	gs:print/ghostscript

[If it requires GNU make, not /usr/bin/make, to build...]
USES= gmake
[If it is an X application and requires "xmkmf -a" to be run...]
USES= imake
[If the source is obtained from github, remove MASTER_SITE* and...]
USE_GITHUB=	yes
GH_ACCOUNT=	example

[this section is for other standard bsd.port.mk variables that do not]
 belong to any of the above]
[If it asks questions during configure, build, install...]
IS_INTERACTIVE=	yes
[If it extracts to a directory other than ${DISTNAME}...]
WRKSRC=		${WRKDIR}/xdvi-new
[If it requires a "configure" script generated by GNU autoconf to be run]
GNU_CONFIGURE=	yes
[et cetera.]

[If it requires options, this section is for options]
OPTIONS_DEFINE=	DOCS EXAMPLES FOO
OPTIONS_DEFAULT=	FOO
[If options will change the files in plist]
OPTIONS_SUB=yes

FOO_DESC=		Enable foo support

FOO_CONFIGURE_ENABLE=	foo

[non-standard variables to be used in the rules below]
MY_FAVORITE_RESPONSE=	"yeah, right"

[then the special rules, in the order they are called]
pre-fetch:
	i go fetch something, yeah

post-patch:
	i need to do something after patch, great

pre-install:
	and then some more stuff before installing, wow

[and then the epilogue]

.include <bsd.port.mk>

.

2/2 -The "Makefile" of dump1090-mutability from GitHub

#
# When building a package or installing otherwise in the system, make
# sure that the variable PREFIX is defined, e.g. make PREFIX=/usr/local
#
PROGNAME=dump1090

ifdef PREFIX
BINDIR=$(PREFIX)/bin
SHAREDIR=$(PREFIX)/share/$(PROGNAME)
EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\"
endif

CFLAGS=-O2 -g -Wall -W `pkg-config --cflags librtlsdr`
LIBS=`pkg-config --libs librtlsdr` -lpthread -lm
CC=gcc


all: dump1090 view1090

%.o: %.c
        $(CC) $(CFLAGS) $(EXTRACFLAGS) -c $<

dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
        $(CC) -g -o dump1090 dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) $(LDFLAGS)

view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
        $(CC) -g -o view1090 view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) $(LDFLAGS)

clean:
        rm -f *.o dump1090 view1090  

Hi,
just one question.
It start workning on FreeBSD or not?
I try find this info on FreeBSD site, but I cannot find any “fresh” topic.