Tuesday 13 October 2015

Install operating system into Banana pi open source board


To start with, download the Image from: [https://www.bananian.org/download] There are other distributions available but this is very lightweight and doesn't include a lot of unneeded software.

Once downloaded follow the instructions to install it to your SD card, then plug that into your Banana Pi and power it up.
The BPI should boot up and start flashing like a Christmas Tree. If it is connected to a network it will use DHCP to get an IP address and will start an SSH server. To login use the username 'root' and the password 'pi'
The first step is expanding the file system to fill the memory card
/usr/local/bin/raspi-config --expand-rootfs
reboot
Then update the operating system
wget https://dl.bananian.org/upgrade/bananian-update -O /usr/local/bin/bananian-update
chmod 700 /usr/local/bin/bananian-update
bananian-update

apt-get update
apt-get upgrade
Once this has been done reboot and you are ready to install.

Install rtl-sdr driver

There is a more detailed guide here, http://sdr.osmocom.org/trac/wiki/rtl-sdr or you can just type the commands below:
sudo apt-get -y install git cmake libusb-1.0-0-dev
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
cd ../..
Now, once the DVB-T dongle is plugged into the USB port, you should find a corresponding message in dmesg

Install required packages

sudo apt-get -y install libconfig-dev fftw3-dev libjpeg-dev libconfig9

Download the binary and unpack it

For Raspberry Pi 1, choose
wget http://download.glidernet.org/rpi-gpu/rtlsdr-ogn-bin-RPI-GPU-latest.tgz
tar xvzf rtlsdr-ogn-bin-RPI-GPU-latest.tgz

For Raspberry Pi 2 and other arm systems, choose
wget http://download.glidernet.org/arm/rtlsdr-ogn-bin-ARM-latest.tgz
tar xvzf rtlsdr-ogn-bin-ARM-latest.tgz

There are also binaries for x86 and x86_64 targets, see http://download.glidernet.org/.

Create named pipe

Since v0.2.2 rf-reception and decoding are separate processes. They communicate via this fifo.
cd rtlsdr-ogn
sudo mkfifo ogn-rf.fifo

Receiver configuration and tuning for best performance

Now power system down, insert the USB DVB-T stick and repower on..
Attach your aerial.
The very first thing you need in order to receive the signals is to be on the correct radio frequency.
Cheap SDR receivers use cheap crystals and their frequency tolerance is about +/-50-100ppm.
At 868MHz 100ppm error makes you 86.8kHz away from the correct frequency, while frequency deviation for FLARM signals is +/-50kHz.
Technically, the software receiver can search a wide range of frequencies for radio packets but this inflicts lot of CPU, thus can only be done for stronger CPU boards, but not for Raspberry PI.
Thus you need to know how much off is the crystal of your DBV-T dongle before you proceed.
You can measure the crystal with the gsm_scan tool, run it like this:
./gsm_scan --ppm 50 --gain 20
it should receive some GSM broadcast channels and measure the frequency correction.
Notice the GSM frequency with a strong broadcast channel, even better: with one or two directly adjacent channels.
Adjust the gain (--gain) and initial crystal correction (--ppm) for best reception of as many as possible channels with consistent correction measurement.
GSM signals are very strong, thus too much gain is not good. You need to find an optimal setting here.
Rename the Example.conf so that the name corresponds to your receiver's location (e.g. LFLE.conf, EPZR.conf, myPlace.conf) end edit the file, to set-up the receiver:
enter your crystal correction, GSM frequency for calibration, geographical position, APRS name. (You will find more details about receiver's configuration here)

Run the receiver

sudo nohup ./ogn-rf <your config file> &
and
 sudo nohup ./ogn-decode <your config file> &
to stop it, kill the process-numbers shown on startup or retrieved with the top command:
kill <processnumber>
The output of these commands is redirected to 'nohup.out' if possible, '$HOME/nohup.out' otherwise.

Install as service

If you don't want to start the receiver by hand every time the RPI boots, then install it as a service:
sudo apt-get -y install procserv telnet
sudo wget http://download.glidernet.org/common/service/rtlsdr-ogn -O /etc/init.d/rtlsdr-ogn
sudo wget http://download.glidernet.org/common/service/rtlsdr-ogn.conf -O /etc/rtlsdr-ogn.conf
sudo chmod +x /etc/init.d/rtlsdr-ogn
sudo update-rc.d rtlsdr-ogn defaults
Update /etc/rtlsdr-ogn.conf according to name of your configuration file, by replacing Sample.conf by the name of your config file and piwith your actual username
sudo nano /etc/rtlsdr-ogn.conf
#shellbox configuration file
#Starts commands inside a "box" with a telnet-like server.
#Contact the shell with: telnet <hostname> <port>
#Syntax:
#port  user     directory                 command       args
50000  pi    /home/pi/rtlsdr-ogn  ./rtlsdr-ogn yourReceiverName.conf

Note that the path should be to rtlsdr-ogn, not the directory of the version you have installed. This is a symbolic link and will be updated with each version.
Start the service
sudo service rtlsdr-ogn start
Remark: When the service starts it waits for time synchronisation (NTP). It may takes up to 30mn on just booted RPi. Gossip says if you install ntpdate it synchronizes much faster.
Your service is now running and will start automatically at next boot.
You can see console output of your receiver at any time with:
telnet localhost 50000
containig infos regarding to the decoding-process and
telnet localhost 50001
containing infos regarding to the APRS datatraffic.

No comments:

Post a Comment