What is Basic Station
NOTE: The current basicstation package in lora-feed can be compiled with OpenWRT master tree without extra effort. Please have a try.
The previous Lora packet forward is well known as packet_forwarder. It is widely used in most homebrew and commercial LoRa gateways. But it has no official updates for quite a long time. The successor from TheThingsNetwork has appear for a while and also already stopped developing.
Basic Station is officially a new implementation of LoRa packet forwarder, which further can be remotely managed by some Configuration and Update Server (CUPS). The original version of Basic Station is build with Make for PC and RPi(Debian) which have normal glibc library. In this small post I will show to compile Basic Station under OpenWRT environment with musl library.
- RPi 2 or 3
- RPi to iC8880a HAT
- OpenWRT Toolchain/Build for RPi
- basicstation with OpenWRT support link
- Locate the staging dir of toolchain name or build environment
- Fill them to the following script
export STAGING_DIR=$YOUR_STAGING_DIR export TOOLCHAIN_DIR=$STAGING_DIR/$YOUR_TOOLCHAIN_NAME export LDCFLAGS=$TOOLCHAIN_DIR/usr/lib export LD_LIBRARY_PATH=$TOOLCHAIN_DIR/usr/lib export PATH=$TOOLCHAIN_DIR/bin:$PATH
Take the RPi I use for instance, the toolchain name is toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.4.0_musl_eabi
- Make a soft link for the toolchain in $HOMEln -s $TOOLCHAIN_DIR $HOME/toolchain-rpi
- Clone the source codegit clone https://github.com/xueliu/basicstation cd basicstation git checkout feature/openwrt-musl
- Compilemake platform=openwrt variant=std
- In the source code folder, a new folder called build-rpi-std, which holds the binary and libraries, is generated;
- Copy build-rpi-std/bin/station to the bin/ or /usr/bin in RPi;
- Copy the folder example/live-s2.sm.tc and all of its content to the $HOME of RPi;
In folder live-s2.sm.tc call the program live-s2.sm.tc with the path of spi-dev which connects the iC880a.RADIODEV=/dev/spidev0.0 station