OpenBTS: N210 GNURadio

From OnnoWiki
Revision as of 14:11, 14 January 2020 by Onnowpurbo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Persiapan

sudo apt-get -y install libboost-all-dev libusb-1.0-0-dev python-cheetah doxygen python-docutils \
git python cmake ethtool libfontconfig1-dev libxrender-dev libpulse-dev \
gcc-4.7 g++ automake libtool python-dev libfftw3-dev \
libcppunit-dev libboost-all-dev libusb-dev fort77 \
libsdl1.2-dev python-wxgtk2.8 subversion git-core guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools \
libpcre3 libpcre3-dbg libpcre3-dev libpcrecpp0 \
python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-dev \
autoconf libtool libosip2-dev libortp-dev \
libusb-1.0-0-dev g++ erlang bison flex \
subversion autoconf libtool libosip2-dev libortp-dev g++ sqlite3 libusb-1.0.0-dev \
libsqlite3-dev erlang libreadline6-dev libboost-all-dev swig libfftw3-dev libcppunit-dev \
libaudio-dev libusb-dev make

Test Ethernet di laptop / PC pastikan kita menggunakan Gigabit Ethernet. Cara men-test dengan menggunakan ethtool

apt -y install ethtool
ethtool enp3s0

Harus keluar kira-kira seperti di bawah ini

Settings for enp3s0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 100Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbg
	Wake-on: g
	Current message level: 0x00000033 (51)
	 		       drv probe ifdown ifup
	Link detected: yes

Pastikan ethernet mampu bekerja pada Gbps (1000baseT).


Set IP address interface ethernet

ifconfig enp3s0 192.168.10.1

Cek sambungan ke N210.

ping 192.168.10.2

HARUS ADA Responds!!!

PING 192.168.10.2 (192.168.10.2) 56(84) bytes of data.
64 bytes from 192.168.10.2: icmp_req=1 ttl=32 time=1.74 ms

Bagi anda yang menggunakan desktop Ubuntu sebaiknya di set juga dari Network Connection di Desktop agar menjadi IP address statik


Install SDCC

Sebaiknya jangan mengcompile dari source code karena membuat pusing kepala. Install sdcc sebaiknya langsung dari file .deb saja.

wget -c http://launchpadlibrarian.net/38703081/sdcc_2.9.0-5_amd64.deb
wget -c http://launchpadlibrarian.net/38689168/sdcc-libraries_2.9.0-5_all.deb
dpkg -i sdcc_2.9.0-5_amd64.deb sdcc-libraries_2.9.0-5_all.deb

Download Source Code UHD

echo "/usr/local/lib" >> /etc/ld.so.conf
cd /usr/local/src
git clone git://ettus.sourcerepo.com/ettus/uhd.git uhd.git

Compile UHD

cd /usr/local/src/uhd.git/host/
mkdir build
cd /usr/local/src/uhd.git/host/build
cmake -DENABLE_LIBUHD=ON -DENABLE_EXAMPLES=ON -DENABLE_UTILS=ON -DENABLE_TESTS=ON ../
make
make test
make install
ldconfig

Download & Compile GNURadio

cd /usr/local/src
wget -c http://voiprakyat.or.id/pub/openbts/usrp52mhz.patch
wget -c http://gnuradio.org/redmine/attachments/download/279/gnuradio-3.4.2.tar.gz
cd /usr/local/src
tar -zxf gnuradio-3.4.2.tar.gz
cd gnuradio
patch -p0 < ../usrp52mhz.patch
./configure --enable-gr-uhd --disable-usrp2 --disable-usrp

Perbaiki error: ‘intptr_t’

vi /usr/local/src/gnuradio/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc  

tambahkan

#include <unistd.h>

Compile GNURadio

cd /usr/local/src/gnuradio
make
make install
ldconfig

Install UHD USRP ke udev

Lakukan

cd /usr/local/share/uhd/utils
sudo cp uhd-usrp.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules

Install Image 003.005.000

Download Image UHD 003.005.000

sudo /usr/local/lib/uhd/utils/uhd_images_downloader.py
Images successfully installed to: /usr/local/share/uhd/images

Burn ke N210, pastikan kita terhubung ke N210 & N210 dalam keadaan operasinal. Lakukan,

/usr/local/bin/usrp_n2xx_simple_net_burner --addr="192.168.10.2"

Hasilnya kira-kira

linux; GNU C++ version 4.7.3; Boost_104900; UHD_003.005.003-112-gea418a85

Searching for USRP N2XX with IP address 192.168.10.2.
Found n210_r4.

Searching for specified images.

Will burn the following images:
 * Firmware: /usr/local/share/uhd/images/usrp_n210_fw.bin
 * FPGA:     /usr/local/share/uhd/images/usrp_n210_r4_fpga.bin

Querying n210_r4 for flash information.
 * Flash size:  4194304
 * Sector size: 65536

Erasing FPGA image.
 * Successfully erased 1572864 bytes at 1572864.
Writing FPGA image.
 * Successfully wrote 1311644 bytes.
Verifying FPGA image.
 * Successful.

Erasing firmware image.
 * Successfully erased 31744 bytes at 3145728.
Writing firmware image.
 * Successfully wrote 16383 bytes.
Verifying firmware image.
 * Successful.

Image burning successful. Reset USRP (Y/n)? Y
Resetting USRP.

Test

Find Device

Lakukan

uhd_find_devices 

Hasilnya

linux; GNU C++ version 4.7.3; Boost_104900; UHD_003.005.003-112-gea418a85

--------------------------------------------------
-- UHD Device 0
--------------------------------------------------
Device Address:
    type: usrp2
    addr: 192.168.10.2
    name: 
    serial: F306BB

Test GPSDO

Test GPSDO

cd /usr/local/src/uhd.git/host/examples
wget https://sites.google.com/site/byungchulweb/gnufile/gps_test.cpp

Masukan

vi /usr/local/src/uhd.git/host/examples/CMakeLists.txt 

masukan

gps_test.cpp

Compile

cd ..
cd build
cmake ../
make
make test
sudo make install
sudo ldconfig

Test

cd /usr/local/src/uhd.git/host/build/examples
sudo ./gps_test

Hasilnya

..
..
-- Setting references to the internal GPSDO
-- Initializing time to the internal GPSDO
Using Device: Single USRP:
  Device: USRP2 / N-Series Device
  Mboard 0: N210r4
  RX Channel: 0
    RX DSP: 0
    RX Dboard: A
    RX Subdev: WBXv3 RX+GDB
  TX Channel: 0
    TX DSP: 0
    TX Dboard: A
    TX Subdev: WBXv3 TX+GDB

GPS epoch time: 1136081736 seconds
GPS lock status: unlocked
 PS_GPGGA: $GPGGA,021536.00,0000.0000,N,00000.0000,E,0,99,1.0,0.0,M,0.0,M,,*5F
 PS_GPRMC: $GPRMC,021536.00,V,0000.0000,N,00000.0000,E,0.0,0.0,010106,,*21

Test uhd usrp probe

cd /usr/local/bin
./uhd_usrp_probe


Hasilnya

..
..
-- Detecting internal GPSDO.... Found a Jackson Labs GPS
-- found
-- Setting references to the internal GPSDO
-- Initializing time to the internal GPSDO
  _____________________________________________________
 /
|       Device: USRP2 / N-Series Device
|     _____________________________________________________
|    /
|   |       Mboard: N210r4
|   |   hardware: 2577
|   |   mac-addr: 00:80:2f:0a:d0:9c
|   |   ip-addr: 192.168.10.2
|   |   subnet: 255.255.255.255
|   |   gateway: 255.255.255.255
|   |   gpsdo: none
|   |   serial: F306BB
|   |   FW Version: 12.3
|   |   FPGA Version: 10.0
|   |   
|   |   Time sources: none, external, _external_, mimo, gpsdo
|   |   Clock sources: internal, external, mimo, gpsdo
|   |   Sensors: gps_gpgga, gps_gprmc, gps_time, gps_locked, gps_servo, mimo_locked, ref_locked
|   |     _____________________________________________________
|   |    /
|   |   |       RX DSP: 0
|   |   |   Freq range: -50.000 to 50.000 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       RX DSP: 1
|   |   |   Freq range: -50.000 to 50.000 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       RX Dboard: A
|   |   |   ID: WBX v3, WBX v3 + Simple GDB (0x0057)
|   |   |   Serial: F35DB9
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Frontend: 0
|   |   |   |   Name: WBXv3 RX+GDB
|   |   |   |   Antennas: TX/RX, RX2, CAL
|   |   |   |   Sensors: lo_locked
|   |   |   |   Freq range: 68.750 to 2200.000 Mhz
|   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Codec: A
|   |   |   |   Name: ads62p44
|   |   |   |   Gain range digital: 0.0 to 6.0 step 0.5 dB
|   |   |   |   Gain range fine: 0.0 to 0.5 step 0.1 dB
|   |     _____________________________________________________
|   |    /
|   |   |       TX DSP: 0
|   |   |   Freq range: -250.000 to 250.000 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       TX Dboard: A
|   |   |   ID: WBX v3 (0x0056)
|   |   |   Serial: F35DB9
|   |   |   ID: WBX + Simple GDB, WBX v3 + Simple GDB, WBX v4 + Simple GDB (0x004f)
|   |   |   Serial: 0
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Frontend: 0
|   |   |   |   Name: WBXv3 TX+GDB
|   |   |   |   Antennas: TX/RX, CAL
|   |   |   |   Sensors: lo_locked
|   |   |   |   Freq range: 68.750 to 2200.000 Mhz
|   |   |   |   Gain range PGA0: 0.0 to 31.0 step 1.0 dB
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Codec: A
|   |   |   |   Name: ad9777
|   |   |   |   Gain Elements: None 



Test clock 52MHz

cd /usr/local/bin
./uhd_usrp_probe --args="master_clock_rate=52e6"

Hasilnya kira-kira

..
..
-- Detecting internal GPSDO.... Found a Jackson Labs GPS
-- found
-- Setting references to the internal GPSDO
-- Initializing time to the internal GPSDO
  _____________________________________________________
 /
|       Device: USRP2 / N-Series Device
|     _____________________________________________________
|    /
|   |       Mboard: N210r4
|   |   hardware: 2577
|   |   mac-addr: 00:80:2f:0a:d0:9c
|   |   ip-addr: 192.168.10.2
|   |   subnet: 255.255.255.255
|   |   gateway: 255.255.255.255
|   |   gpsdo: none
|   |   serial: F306BB
|   |   FW Version: 12.3
|   |   FPGA Version: 10.0
|   |   
|   |   Time sources: none, external, _external_, mimo, gpsdo
|   |   Clock sources: internal, external, mimo, gpsdo
|   |   Sensors: gps_gpgga, gps_gprmc, gps_time, gps_locked, gps_servo, mimo_locked, ref_locked
|   |     _____________________________________________________
|   |    /
|   |   |       RX DSP: 0
|   |   |   Freq range: -50.000 to 50.000 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       RX DSP: 1
|   |   |   Freq range: -50.000 to 50.000 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       RX Dboard: A
|   |   |   ID: WBX v3, WBX v3 + Simple GDB (0x0057)
|   |   |   Serial: F35DB9
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Frontend: 0
|   |   |   |   Name: WBXv3 RX+GDB
|   |   |   |   Antennas: TX/RX, RX2, CAL
|   |   |   |   Sensors: lo_locked
|   |   |   |   Freq range: 68.750 to 2200.000 Mhz
|   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Codec: A
|   |   |   |   Name: ads62p44
|   |   |   |   Gain range digital: 0.0 to 6.0 step 0.5 dB
|   |   |   |   Gain range fine: 0.0 to 0.5 step 0.1 dB
|   |     _____________________________________________________
|   |    /
|   |   |       TX DSP: 0
|   |   |   Freq range: -250.000 to 250.000 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       TX Dboard: A
|   |   |   ID: WBX v3 (0x0056)
|   |   |   Serial: F35DB9
|   |   |   ID: WBX + Simple GDB, WBX v3 + Simple GDB, WBX v4 + Simple GDB (0x004f)
|   |   |   Serial: 0
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Frontend: 0
|   |   |   |   Name: WBXv3 TX+GDB
|   |   |   |   Antennas: TX/RX, CAL
|   |   |   |   Sensors: lo_locked
|   |   |   |   Freq range: 68.750 to 2200.000 Mhz
|   |   |   |   Gain range PGA0: 0.0 to 31.0 step 1.0 dB
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Codec: A
|   |   |   |   Name: ad9777
|   |   |   |   Gain Elements: None

Test Benchmark

cd /usr/local/src/uhd.git/host/build/examples
./benchmark_rate --rx_rate 10000000 --tx_rate 10000000

Hasilnya kira-kira

..
..
-- Detecting internal GPSDO.... Found a Jackson Labs GPS
-- found
-- Setting references to the internal GPSDO
-- Initializing time to the internal GPSDO

UHD Warning:
    get_time: ValueError: get_nmea(): no GPRMC message found
Using Device: Single USRP:
  Device: USRP2 / N-Series Device
  Mboard 0: N210r4
  RX Channel: 0
    RX DSP: 0
    RX Dboard: A
    RX Subdev: WBXv3 RX+GDB
  TX Channel: 0
    TX DSP: 0
    TX Dboard: A
    TX Subdev: WBXv3 TX+GDB

Testing receive rate 10.000000 Msps on 1 channels
Testing transmit rate 10.000000 Msps on 1 channels

Benchmark rate summary:
  Num received samples:    100107777
  Num dropped samples:     0
  Num overflows detected:  0
  Num transmitted samples: 100229019
  Num sequence errors:     0
  Num underflows detected: 0 

Done!

Referensi

Pranala Menarik

Persiapan

Script

OpenBTS 2.6

OpenBTS 2.8

Multi OpenBTS 2.8

OpenBTS 3.1.x

Ettus E110

Ettus N210

RangeNetworks

GPRS

Briker OpenBTS

FreeSWITCH OpenBTS

Power Amplifier

Lain Lain

Catatan Legal dan Pendukung

Catatan Sejarah

Dokumentasi Video

Perjuangan OpenBTS