Problem compiling ch2i/rpi-shield packet forwarder

I am attempting to get my gateway to work (Raspberry Pi 3, ic880a, with the ch2i shield in-between).

I followed the instructions from https://github.com/ch2i/iC880A-Raspberry-PI , which led me to https://github.com/ch2i/ic880a-gateway/tree/ch2i-rpi-shield . As per the instructions here, I’m trying to install the packet forwarder:

  $ git clone -b ch2i-rpi-shield https://github.com/ch2i/ic880a-gateway.git ~/ic880a-gateway
  $ cd ~/ic880a-gateway
  $ sudo ./install.sh

However, the compilation fails:

make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_spectral_scan'
/opt/ttn-gateway ~/ic880a-gateway
/opt/ttn-gateway/packet_forwarder /opt/ttn-gateway ~/ic880a-gateway
Already up-to-date.
HEAD is now at 61cc547 Led Management + Extented Logs
make all -e -C basic_pkt_fwd
make[1]: Entering directory '/opt/ttn-gateway/packet_forwarder/basic_pkt_fwd'
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -D VERSION_STRING="\"`cat ../VERSION`\"" -I../../lora_gateway/libloragw/inc src/basic_pkt_fwd.c -o obj/basic_pkt_fwd.o
gcc -L../../lora_gateway/libloragw obj/basic_pkt_fwd.o obj/parson.o obj/base64.o -o basic_pkt_fwd -lloragw -lrt -lpthread
../../lora_gateway/libloragw/libloragw.a(loragw_hal.o): In function `lgw_time_on_air':
loragw_hal.c:(.text+0x22ec): undefined reference to `ceil'
collect2: error: ld returned 1 exit status
Makefile:78: recipe for target 'basic_pkt_fwd' failed
make[1]: *** [basic_pkt_fwd] Error 1
make[1]: Leaving directory '/opt/ttn-gateway/packet_forwarder/basic_pkt_fwd'
Makefile:11: recipe for target 'all' failed
make: *** [all] Error 2

It does look like I’m missing a prerequisite, but I cannot figure out which one (I did install bcm8235, which seems to be the only prerequisite mentioned on github).

Can anyone point me in the right direction?

Thank you!

That’s strange,
looks like can’t link with math function like ceil
did the lora_gateway compiled fine ?

As far as I can tell, yes. Here is the full output from install.sh:

Installing dependencies...
Reading package lists... Done
Building dependency tree        
Reading state information... Done
automake is already the newest version (1:1.15-6).
libftdi-dev is already the newest version (0.20-4).
python-dev is already the newest version (2.7.13-2).
swig is already the newest version (3.0.10-1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/opt/ttn-gateway ~/ic880a-gateway
Cloning into 'libmpsse'...
remote: Counting objects: 96, done.
remote: Total 96 (delta 0), reused 0 (delta 0), pack-reused 96
Unpacking objects: 100% (96/96), done.
/opt/ttn-gateway/libmpsse/src /opt/ttn-gateway ~/ic880a-gateway
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking libftdi1/ftdi.h usability... no
checking libftdi1/ftdi.h presence... no
checking for libftdi1/ftdi.h... no
checking ftdi.h usability... yes
checking ftdi.h presence... yes
checking for ftdi.h... yes
checking for ftdi_init in -lftdi... yes
configure: creating ./config.status
config.status: creating Makefile
gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -lftdi  -DLIBFTDI1=0 -c support.c
gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -lftdi  -DLIBFTDI1=0 -c mpsse.c
gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -lftdi  -c fast.c
gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -shared -Wl,-soname,libmpsse.so mpsse.o fast.o support.o \
        -o libmpsse.so -lftdi 
ar rcs libmpsse.a mpsse.o fast.o support.o
install -D -m644 libmpsse.so //usr/local/lib/libmpsse.so
install -D -m644 libmpsse.a  //usr/local/lib/libmpsse.a
install -D -m644 mpsse.h     //usr/local/include/mpsse.h
/opt/ttn-gateway ~/ic880a-gateway
Cloning into 'lora_gateway'...
remote: Counting objects: 843, done.
remote: Total 843 (delta 0), reused 0 (delta 0), pack-reused 843
Receiving objects: 100% (843/843), 621.49 KiB | 830.00 KiB/s, done.
Resolving deltas: 100% (505/505), done.
/opt/ttn-gateway/lora_gateway /opt/ttn-gateway ~/ic880a-gateway
make all -e -C libloragw
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/libloragw'
*** Checking libloragw library configuration ***
#File initialization
# Release version
Release version   : 4.0.0
SPI interface     : Linux native SPI driver
# Debug options
# end of file
*** Configuration seems ok ***
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_hal.c -o obj/loragw_hal.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_gps.c -o obj/loragw_gps.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_reg.c -o obj/loragw_reg.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_spi.native.c -o obj/loragw_spi.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_aux.c -o obj/loragw_aux.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_radio.c -o obj/loragw_radio.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_fpga.c -o obj/loragw_fpga.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_lbt.c -o obj/loragw_lbt.o
ar rcs libloragw.a obj/loragw_hal.o obj/loragw_gps.o obj/loragw_reg.o obj/loragw_spi.o obj/loragw_aux.o obj/loragw_radio.o obj/loragw_fpga.o obj/loragw_lbt.o
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_spi.c -o test_loragw_spi -lloragw -lrt -lm
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_reg.c -o test_loragw_reg -lloragw -lrt -lm
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_hal.c -o test_loragw_hal -lloragw -lrt -lm
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_gps.c -o test_loragw_gps -lloragw -lrt -lm
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_cal.c -o test_loragw_cal -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/libloragw'
make all -e -C util_pkt_logger
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_pkt_logger'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_pkt_logger.c -o obj/util_pkt_logger.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. src/parson.c -o obj/parson.o
src/parson.c: In function ‘remove_comments’:
src/parson.c:195:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
             for (i = 0; i < (ptr - string) + end_token_len; i++)
             ^~~
src/parson.c:197:12: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
            string = ptr + end_token_len - 1;
            ^~~~~~
gcc -L../libloragw obj/util_pkt_logger.o obj/parson.o -o util_pkt_logger -lloragw -lrt  -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_pkt_logger'
make all -e -C util_spi_stress
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_spi_stress'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_spi_stress.c -o obj/util_spi_stress.o
gcc -L../libloragw obj/util_spi_stress.o -o util_spi_stress -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_spi_stress'
make all -e -C util_lbt_test
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_lbt_test'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_lbt_test.c -o obj/util_lbt_test.o
gcc -L../libloragw obj/util_lbt_test.o -o util_lbt_test -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_lbt_test'
make all -e -C util_tx_test
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_tx_test'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_tx_test.c -o obj/util_tx_test.o
gcc -L../libloragw obj/util_tx_test.o -o util_tx_test -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_tx_test'
make all -e -C util_tx_continuous
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_tx_continuous'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_tx_continuous.c -o obj/util_tx_continuous.o
gcc -L../libloragw obj/util_tx_continuous.o -o util_tx_continuous -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_tx_continuous'
make all -e -C util_spectral_scan
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_spectral_scan'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -I inc -I../libloragw/inc src/util_spectral_scan.c -o obj/util_spectral_scan.o
gcc -L../libloragw obj/util_spectral_scan.o -lloragw -lrt -lm -o util_spectral_scan
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_spectral_scan'
/opt/ttn-gateway ~/ic880a-gateway
Cloning into 'packet_forwarder'...
remote: Counting objects: 1058, done.
remote: Total 1058 (delta 0), reused 0 (delta 0), pack-reused 1058
Receiving objects: 100% (1058/1058), 1.33 MiB | 430.00 KiB/s, done.
Resolving deltas: 100% (641/641), done.
/opt/ttn-gateway/packet_forwarder /opt/ttn-gateway ~/ic880a-gateway
make all -e -C basic_pkt_fwd
make[1]: Entering directory '/opt/ttn-gateway/packet_forwarder/basic_pkt_fwd'
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -D VERSION_STRING="\"`cat ../VERSION`\"" -I../../lora_gateway/libloragw/inc src/basic_pkt_fwd.c -o obj/basic_pkt_fwd.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. src/parson.c -o obj/parson.o
src/parson.c: In function ‘remove_comments’:
src/parson.c:195:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
             for (i = 0; i < (ptr - string) + end_token_len; i++)
             ^~~
src/parson.c:197:12: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
            string = ptr + end_token_len - 1;
            ^~~~~~
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. src/base64.c -o obj/base64.o
gcc -L../../lora_gateway/libloragw obj/basic_pkt_fwd.o obj/parson.o obj/base64.o -o basic_pkt_fwd -lloragw -lrt -lpthread
../../lora_gateway/libloragw/libloragw.a(loragw_hal.o): In function `lgw_time_on_air':
loragw_hal.c:(.text+0x22ec): undefined reference to `ceil'
collect2: error: ld returned 1 exit status
Makefile:78: recipe for target 'basic_pkt_fwd' failed
make[1]: *** [basic_pkt_fwd] Error 1
make[1]: Leaving directory '/opt/ttn-gateway/packet_forwarder/basic_pkt_fwd'
Makefile:11: recipe for target 'all' failed
make: *** [all] Error 2

I just started over with a clean install of Raspbian Jessie. The issue reproduces perfectly even with a clean install.

Here’s everything I did after booting with the fresh Raspbian install:

apt-get update && apt-get install vim python3-pip python3-rpi.gpio
raspi-config (enable SPI and I2C, expand filesystem)
apt update && apt dist-upgrade 
apt-get install git-core i2c-tools
apt-get install vim python3-pip python3-rpi.gpio
reboot
git clone -b ch2i-rpi-shield https://github.com/ch2i/ic880a-gateway.git ~/ic880a-gateway
cd ic880a-gateway/
./install.sh 

Indeed, lora_gateway compiles just fine, but the packet forwarder throws the exact same error. Full output included below (the only difference is that this time it had to pull the files from git):

[ Edited to add: the compilation seems to work if I manually add “-lm” to the LIBS section in each of the packet forwarders’ Makefile. However, I no longer know enough C programming to figure out whether I managed to break anything else with this change :expressionless: ]

Updating hostname to 'raspi-gw-1'...
Installing dependencies...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  autoconf autotools-dev libftdi1 libpython-dev libpython2.7 libpython2.7-dev libsigsegv2 libusb-dev m4 python2.7-dev swig3.0
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc libtool gettext m4-doc swig-doc swig-examples swig3.0-examples swig3.0-doc
The following NEW packages will be installed:
  autoconf automake autotools-dev libftdi-dev libftdi1 libpython-dev libpython2.7 libpython2.7-dev libsigsegv2 libusb-dev m4 python-dev python2.7-dev swig swig3.0
0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 31.9 MB of archives.
After this operation, 52.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf libsigsegv2 armhf 2.10-5 [28.4 kB]
Get:2 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf m4 armhf 1.4.18-1 [185 kB]
Get:3 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf autoconf all 2.69-10 [338 kB]
Get:4 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf autotools-dev all 20161112.1 [73.4 kB]
Get:13 http://mirrordirector.raspbian.org/raspbian stretch/main armhf python-dev armhf 2.7.13-2 [1,130 B]
Get:5 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf automake all 1:1.15-6 [733 kB]
Get:6 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf libftdi1 armhf 0.20-4 [17.0 kB]
Get:7 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf libusb-dev armhf 2:0.1.12-30 [35.4 kB]
Get:8 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf libftdi-dev armhf 0.20-4 [172 kB]
Get:9 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf libpython2.7 armhf 2.7.13-2 [916 kB]
Get:10 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf libpython2.7-dev armhf 2.7.13-2 [27.6 MB]                                                         
Get:11 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf libpython-dev armhf 2.7.13-2 [20.0 kB]                                                            
Get:12 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf python2.7-dev armhf 2.7.13-2 [276 kB]                                                             
Get:14 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf swig3.0 armhf 3.0.10-1.1 [1,205 kB]                                                               
Get:15 http://mirror.as43289.net/raspbian/raspbian stretch/main armhf swig armhf 3.0.10-1.1 [305 kB]                                                                    
Fetched 31.9 MB in 1min 55s (276 kB/s)                                                                                                                                  
Selecting previously unselected package libsigsegv2:armhf.
(Reading database ... 38077 files and directories currently installed.)
Preparing to unpack .../00-libsigsegv2_2.10-5_armhf.deb ...
Unpacking libsigsegv2:armhf (2.10-5) ...
Selecting previously unselected package m4.
Preparing to unpack .../01-m4_1.4.18-1_armhf.deb ...
Unpacking m4 (1.4.18-1) ...
Selecting previously unselected package autoconf.
Preparing to unpack .../02-autoconf_2.69-10_all.deb ...
Unpacking autoconf (2.69-10) ...
Selecting previously unselected package autotools-dev.
Preparing to unpack .../03-autotools-dev_20161112.1_all.deb ...
Unpacking autotools-dev (20161112.1) ...
Selecting previously unselected package automake.
Preparing to unpack .../04-automake_1%3a1.15-6_all.deb ...
Unpacking automake (1:1.15-6) ...
Selecting previously unselected package libftdi1:armhf.
Preparing to unpack .../05-libftdi1_0.20-4_armhf.deb ...
Unpacking libftdi1:armhf (0.20-4) ...
Selecting previously unselected package libusb-dev.
Preparing to unpack .../06-libusb-dev_2%3a0.1.12-30_armhf.deb ...
Unpacking libusb-dev (2:0.1.12-30) ...
Selecting previously unselected package libftdi-dev.
Preparing to unpack .../07-libftdi-dev_0.20-4_armhf.deb ...
Unpacking libftdi-dev (0.20-4) ...
Selecting previously unselected package libpython2.7:armhf.
Preparing to unpack .../08-libpython2.7_2.7.13-2_armhf.deb ...
Unpacking libpython2.7:armhf (2.7.13-2) ...
Selecting previously unselected package libpython2.7-dev:armhf.
Preparing to unpack .../09-libpython2.7-dev_2.7.13-2_armhf.deb ...
Unpacking libpython2.7-dev:armhf (2.7.13-2) ...
Selecting previously unselected package libpython-dev:armhf.
Preparing to unpack .../10-libpython-dev_2.7.13-2_armhf.deb ...
Unpacking libpython-dev:armhf (2.7.13-2) ...
Selecting previously unselected package python2.7-dev.
Preparing to unpack .../11-python2.7-dev_2.7.13-2_armhf.deb ...
Unpacking python2.7-dev (2.7.13-2) ...
Selecting previously unselected package python-dev.
Preparing to unpack .../12-python-dev_2.7.13-2_armhf.deb ...
Unpacking python-dev (2.7.13-2) ...
Selecting previously unselected package swig3.0.
Preparing to unpack .../13-swig3.0_3.0.10-1.1_armhf.deb ...
Unpacking swig3.0 (3.0.10-1.1) ...
Selecting previously unselected package swig.
Preparing to unpack .../14-swig_3.0.10-1.1_armhf.deb ...
Unpacking swig (3.0.10-1.1) ...
Setting up swig3.0 (3.0.10-1.1) ...
Setting up libsigsegv2:armhf (2.10-5) ...
Processing triggers for install-info (6.3.0.dfsg.1-1+b1) ...
Setting up libftdi1:armhf (0.20-4) ...
Setting up m4 (1.4.18-1) ...
Setting up libusb-dev (2:0.1.12-30) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Setting up autotools-dev (20161112.1) ...
Setting up libftdi-dev (0.20-4) ...
Setting up libpython2.7:armhf (2.7.13-2) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libpython2.7-dev:armhf (2.7.13-2) ...
Setting up python2.7-dev (2.7.13-2) ...
Setting up libpython-dev:armhf (2.7.13-2) ...
Setting up swig (3.0.10-1.1) ...
Setting up python-dev (2.7.13-2) ...
Setting up autoconf (2.69-10) ...
Setting up automake (1:1.15-6) ...
update-alternatives: using /usr/bin/automake-1.15 to provide /usr/bin/automake (automake) in auto mode
Processing triggers for libc-bin (2.24-11+deb9u1) ...
/opt/ttn-gateway ~/ic880a-gateway
Cloning into 'libmpsse'...
remote: Counting objects: 96, done.
remote: Total 96 (delta 0), reused 0 (delta 0), pack-reused 96
Unpacking objects: 100% (96/96), done.
/opt/ttn-gateway/libmpsse/src /opt/ttn-gateway ~/ic880a-gateway
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking libftdi1/ftdi.h usability... no
checking libftdi1/ftdi.h presence... no
checking for libftdi1/ftdi.h... no
checking ftdi.h usability... yes
checking ftdi.h presence... yes
checking for ftdi.h... yes
checking for ftdi_init in -lftdi... yes
configure: creating ./config.status
config.status: creating Makefile
gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -lftdi  -DLIBFTDI1=0 -c support.c
gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -lftdi  -DLIBFTDI1=0 -c mpsse.c
gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -lftdi  -c fast.c
gcc -Wall -fPIC -fno-strict-aliasing -g -O2 -shared -Wl,-soname,libmpsse.so mpsse.o fast.o support.o \
        -o libmpsse.so -lftdi 
ar rcs libmpsse.a mpsse.o fast.o support.o
install -D -m644 libmpsse.so //usr/local/lib/libmpsse.so
install -D -m644 libmpsse.a  //usr/local/lib/libmpsse.a
install -D -m644 mpsse.h     //usr/local/include/mpsse.h
/opt/ttn-gateway ~/ic880a-gateway
--2017-11-30 19:15:13--  http://www.airspayce.com/mikem/bcm2835/bcm2835-1.50.tar.gz
Resolving www.airspayce.com (www.airspayce.com)... 192.185.48.187
Connecting to www.airspayce.com (www.airspayce.com)|192.185.48.187|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 252178 (246K) [application/x-gzip]
Saving to: ‘bcm2835-1.50.tar.gz’

bcm2835-1.50.tar.gz                        100%[=====================================================================================>] 246.27K   441KB/s    in 0.6s    

2017-11-30 19:15:14 (441 KB/s) - ‘bcm2835-1.50.tar.gz’ saved [252178/252178]

bcm2835-1.50/
bcm2835-1.50/config.sub
bcm2835-1.50/ChangeLog
bcm2835-1.50/doc/
bcm2835-1.50/doc/Makefile.am
bcm2835-1.50/doc/Makefile.in
bcm2835-1.50/doc/Doxyfile.in
bcm2835-1.50/aclocal.m4
bcm2835-1.50/configure.ac
bcm2835-1.50/README
bcm2835-1.50/src/
bcm2835-1.50/src/bcm2835.h
bcm2835-1.50/src/Makefile.am
bcm2835-1.50/src/bcm2835.c
bcm2835-1.50/src/test.c
bcm2835-1.50/src/Makefile.in
bcm2835-1.50/INSTALL
bcm2835-1.50/depcomp
bcm2835-1.50/config.h.in
bcm2835-1.50/config.guess
bcm2835-1.50/NEWS
bcm2835-1.50/COPYING
bcm2835-1.50/Makefile.am
bcm2835-1.50/ltmain.sh
bcm2835-1.50/configure
bcm2835-1.50/missing
bcm2835-1.50/install-sh
bcm2835-1.50/Makefile.in
bcm2835-1.50/AUTHORS
bcm2835-1.50/examples/
bcm2835-1.50/examples/blink/
bcm2835-1.50/examples/blink/blink.c
bcm2835-1.50/examples/i2c/
bcm2835-1.50/examples/i2c/i2c.c
bcm2835-1.50/examples/input/
bcm2835-1.50/examples/input/input.c
bcm2835-1.50/examples/gpio/
bcm2835-1.50/examples/gpio/gpio.c
bcm2835-1.50/examples/spin/
bcm2835-1.50/examples/spin/spin.c
bcm2835-1.50/examples/event/
bcm2835-1.50/examples/event/event.c
bcm2835-1.50/examples/spi/
bcm2835-1.50/examples/spi/spi.c
bcm2835-1.50/examples/pwm/
bcm2835-1.50/examples/pwm/pwm.c
bcm2835-1.50/test-driver
/opt/ttn-gateway/bcm2835-1.50 /opt/ttn-gateway ~/ic880a-gateway
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/opt/ttn-gateway/bcm2835-1.50/missing: Unknown `--is-lightweight' option
Try `/opt/ttn-gateway/bcm2835-1.50/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for clock_gettime in -lrt... yes
checking for doxygen... no
configure: WARNING: Doxygen not found - continuing without Doxygen support
checking for ranlib... ranlib
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: executing depfiles commands
make  all-recursive
make[1]: Entering directory '/opt/ttn-gateway/bcm2835-1.50'
Making all in src
make[2]: Entering directory '/opt/ttn-gateway/bcm2835-1.50/src'
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT bcm2835.o -MD -MP -MF .deps/bcm2835.Tpo -c -o bcm2835.o bcm2835.c
mv -f .deps/bcm2835.Tpo .deps/bcm2835.Po
rm -f libbcm2835.a
ar cru libbcm2835.a bcm2835.o 
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libbcm2835.a
make[2]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50/src'
Making all in doc
make[2]: Entering directory '/opt/ttn-gateway/bcm2835-1.50/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50/doc'
make[2]: Entering directory '/opt/ttn-gateway/bcm2835-1.50'
make[2]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50'
make[1]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50'
Making install in src
make[1]: Entering directory '/opt/ttn-gateway/bcm2835-1.50/src'
make[2]: Entering directory '/opt/ttn-gateway/bcm2835-1.50/src'
 /bin/mkdir -p '/usr/local/lib'
 /usr/bin/install -c -m 644  libbcm2835.a '/usr/local/lib'
 ( cd '/usr/local/lib' && ranlib libbcm2835.a )
 /bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 bcm2835.h '/usr/local/include'
make[2]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50/src'
make[1]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50/src'
Making install in doc
make[1]: Entering directory '/opt/ttn-gateway/bcm2835-1.50/doc'
make[2]: Entering directory '/opt/ttn-gateway/bcm2835-1.50/doc'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50/doc'
make[1]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50/doc'
make[1]: Entering directory '/opt/ttn-gateway/bcm2835-1.50'
make[2]: Entering directory '/opt/ttn-gateway/bcm2835-1.50'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50'
make[1]: Leaving directory '/opt/ttn-gateway/bcm2835-1.50'
/opt/ttn-gateway ~/ic880a-gateway
Cloning into 'lora_gateway'...
remote: Counting objects: 843, done.
remote: Total 843 (delta 0), reused 0 (delta 0), pack-reused 843
Receiving objects: 100% (843/843), 621.49 KiB | 383.00 KiB/s, done.
Resolving deltas: 100% (505/505), done.
/opt/ttn-gateway/lora_gateway /opt/ttn-gateway ~/ic880a-gateway
make all -e -C libloragw
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/libloragw'
*** Checking libloragw library configuration ***
#File initialization
# Release version
Release version   : 4.0.0
SPI interface     : Linux native SPI driver
# Debug options
# end of file
*** Configuration seems ok ***
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_hal.c -o obj/loragw_hal.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_gps.c -o obj/loragw_gps.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_reg.c -o obj/loragw_reg.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_spi.native.c -o obj/loragw_spi.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_aux.c -o obj/loragw_aux.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_radio.c -o obj/loragw_radio.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_fpga.c -o obj/loragw_fpga.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC src/loragw_lbt.c -o obj/loragw_lbt.o
ar rcs libloragw.a obj/loragw_hal.o obj/loragw_gps.o obj/loragw_reg.o obj/loragw_spi.o obj/loragw_aux.o obj/loragw_radio.o obj/loragw_fpga.o obj/loragw_lbt.o
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_spi.c -o test_loragw_spi -lloragw -lrt -lm
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_reg.c -o test_loragw_reg -lloragw -lrt -lm
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_hal.c -o test_loragw_hal -lloragw -lrt -lm
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_gps.c -o test_loragw_gps -lloragw -lrt -lm
gcc -O2 -Wall -Wextra -std=c99 -Iinc -I. -fPIC -L. tst/test_loragw_cal.c -o test_loragw_cal -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/libloragw'
make all -e -C util_pkt_logger
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_pkt_logger'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_pkt_logger.c -o obj/util_pkt_logger.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. src/parson.c -o obj/parson.o
src/parson.c: In function ‘remove_comments’:
src/parson.c:195:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
             for (i = 0; i < (ptr - string) + end_token_len; i++)
             ^~~
src/parson.c:197:12: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
            string = ptr + end_token_len - 1;
            ^~~~~~
gcc -L../libloragw obj/util_pkt_logger.o obj/parson.o -o util_pkt_logger -lloragw -lrt  -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_pkt_logger'
make all -e -C util_spi_stress
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_spi_stress'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_spi_stress.c -o obj/util_spi_stress.o
gcc -L../libloragw obj/util_spi_stress.o -o util_spi_stress -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_spi_stress'
make all -e -C util_lbt_test
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_lbt_test'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_lbt_test.c -o obj/util_lbt_test.o
gcc -L../libloragw obj/util_lbt_test.o -o util_lbt_test -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_lbt_test'
make all -e -C util_tx_test
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_tx_test'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_tx_test.c -o obj/util_tx_test.o
gcc -L../libloragw obj/util_tx_test.o -o util_tx_test -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_tx_test'
make all -e -C util_tx_continuous
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_tx_continuous'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -I../libloragw/inc src/util_tx_continuous.c -o obj/util_tx_continuous.o
gcc -L../libloragw obj/util_tx_continuous.o -o util_tx_continuous -lloragw -lrt -lm
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_tx_continuous'
make all -e -C util_spectral_scan
make[1]: Entering directory '/opt/ttn-gateway/lora_gateway/util_spectral_scan'
mkdir -p obj
gcc -c -O2 -Wall -Wextra -std=c99 -I inc -I../libloragw/inc src/util_spectral_scan.c -o obj/util_spectral_scan.o
gcc -L../libloragw obj/util_spectral_scan.o -lloragw -lrt -lm -o util_spectral_scan
make[1]: Leaving directory '/opt/ttn-gateway/lora_gateway/util_spectral_scan'
/opt/ttn-gateway ~/ic880a-gateway
Cloning into 'packet_forwarder'...
remote: Counting objects: 1058, done.
remote: Total 1058 (delta 0), reused 0 (delta 0), pack-reused 1058
Receiving objects: 100% (1058/1058), 1.33 MiB | 799.00 KiB/s, done.
Resolving deltas: 100% (641/641), done.
/opt/ttn-gateway/packet_forwarder /opt/ttn-gateway ~/ic880a-gateway
make all -e -C basic_pkt_fwd
make[1]: Entering directory '/opt/ttn-gateway/packet_forwarder/basic_pkt_fwd'
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. -D VERSION_STRING="\"`cat ../VERSION`\"" -I../../lora_gateway/libloragw/inc src/basic_pkt_fwd.c -o obj/basic_pkt_fwd.o
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. src/parson.c -o obj/parson.o
src/parson.c: In function ‘remove_comments’:
src/parson.c:195:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
             for (i = 0; i < (ptr - string) + end_token_len; i++)
             ^~~
src/parson.c:197:12: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
            string = ptr + end_token_len - 1;
            ^~~~~~
gcc -c -O2 -Wall -Wextra -std=c99 -Iinc -I. src/base64.c -o obj/base64.o
gcc -L../../lora_gateway/libloragw obj/basic_pkt_fwd.o obj/parson.o obj/base64.o -o basic_pkt_fwd -lloragw -lrt -lpthread
../../lora_gateway/libloragw/libloragw.a(loragw_hal.o): In function `lgw_time_on_air':
loragw_hal.c:(.text+0x22ec): undefined reference to `ceil'
collect2: error: ld returned 1 exit status
Makefile:78: recipe for target 'basic_pkt_fwd' failed
make[1]: *** [basic_pkt_fwd] Error 1
make[1]: Leaving directory '/opt/ttn-gateway/packet_forwarder/basic_pkt_fwd'
Makefile:11: recipe for target 'all' failed
make: *** [all] Error 2

Great, no you won’t break anything it’s just adding missing code on link stage. adding library even not used won’t hurt.

Strange I do not remember that I needed to add this one. I’ll check that soon because I need to do same thing for my new RPI Zero RAK831 shield :wink:

Great - thank you! So far it seems to work - at least I can see the heartbeat LED blinking (and occasionally the error LED :stuck_out_tongue: ). Now I have to program a client node, and see if I can get them to talk to each other :smiley:

Once again, thank you for your help!

[ Edited to add one more question - the shield has a breakout for a DHT11 sensor. But the code does not seem to include the ability to read it - only BMP280/BME280 and/or SI7021/HTU21D. Any chance that might show up in a future version? :slight_smile: ]