Installattion of tfrec on Raspberry PI with Raspbian Buster

199 views
Skip to first unread message

Luc Heijst

unread,
Nov 18, 2020, 5:59:46 AM11/18/20
to weewx-user
Program tfrec can read the data of the KlimaLogg Pro sensors directly with use of a rtl-sdr dongle.
The KlimaLogg Pro console is not needed anymore. The advantages are:
1. No need for pressing a USB button on the Klimalogg Pro console after each restart of the weewx driver.
2. No need for 'learning' the sensor data (e.g. after replacing worn out batteries of the console).
3. The number of Klimalogg Pro sensors are not limited to eight anymore.
4. For new configurations one doesn't have to buy the console anymore; only the sensors will do.

For the weewx driver see readme file of https://github.com/matthewwall/weewx-tfrc

For Raspbian these are the steps:

sudo apt-get install clang cmake git pkg-config librtlsdr-dev -y

b) install rtl-sdr:
cd /home/weewx
cd librtlsdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig

c) install tfrc:
cd /home/weewx
cd tfrec

For Rapbbian Stretch:
Compile tfrec source:
For RasPI3 use:
sudo make -f Makefile.arm
for RasPI 2 or Zero:
make -f Makefile.raspi2

For Raspbian Buster:
Note: In Raspbian Buster the make command gets undefined reference errors like:
/usr/bin/ld: sdr.o: in function `sdr::read_thread()':
sdr.cpp:(.text+0xd8): undefined reference to `rtlsdr_read_async'
 
The followings steps will fix this error:  

1. modify file /home/weewx/librtlsdr/build/librtlsdr.pc

Change the first four lines:
prefix=
exec_prefix=
libdir=
includedir=
into:
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

2. modify file /home/weewx/tfrec/Makefile.arm 
(or file /home/weewx/tfrec/Makefile.raspi2 for RasPI 2 or Zero)
 
Change the first line:
PACKAGES= librtlsdr
into:
PACKAGES= /home/weewx/librtlsdr/build/librtlsdr.pc

3. repeat the make command
sudo make -f Makefile.arm
Now the make command will finish without errors:

Test tfrec:
/home/weewx/tfrec/tfrec -D -T 1

Luc
Reply all
Reply to author
Forward
0 new messages