Getting started with 3G | ip.access nano3G+OpenBSC+Osmocom-bb Part 1

简介:
Getting started with 3G | ip.access nano3G+OpenBSC+Osmocom-bb Part 1

English Version could be find at Osmocom.org

https://osmocom.org/projects/cellular-infrastructure/wiki/Accelerate3g5_--_unicornteam

0x01环境搭建

PC:Ubuntu16.04

HardWare:ip.access nano3G

SoftWare:Osmocom

1.1 安装交叉编译环境

复制代码
sudo apt-get update

sudo apt-get install libtool shtool autoconf git-core pkg-config make gcc build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev texinfo flex bison libncurses5 libncurses5-dbg libusb-0.1-4 libpcsclite1 libccid pcscd libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev libpcsclite-dev 
sudo ldconfig

mkdir osm
cd osm
mkdir build install src
wget http://bb.osmocom.org/trac/raw-attachment/wiki/GnuArmToolchain/gnu-arm-build.3.sh
cd src
wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.1a.tar.bz2
wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz

cd ..
chmod +x gnu-arm-build.3.sh
sudo bash gnu-arm-build.3.sh
复制代码

1.2 设置交叉编译环境变量

复制代码
cd install/bin
pwd

vi ~/./.bashrc
export PATH=$PATH:/home/$username(change this to your name)/osm/install/bin

#save and quit
source ~/.bashrc
复制代码

0x02 源码编译CalypsoBTS

2.1 编译libosmo-dsp

复制代码
git clone git://git.osmocom.org/libosmo-dsp.git
cd libosmo-dsp/
autoreconf -i
./configure
make
sudo make install
cd ..
复制代码

2.2 编译osmocom-bb

复制代码
git clone git://git.osmocom.org/osmocom-bb.git trx
cd trx/
git checkout jolly/testing
cd src/

# 需要 TX 功能支持
# 取消target/firmware/Makefile代码中'CFLAGS += -DCONFIG_TX_ENABLE' 前边的注释
# 并在make时启用transceiver功能支持
make HOST_layer23_CONFARGS=--enable-transceiver 
复制代码

2.3 安装依赖包

sudo apt-get install sqlite3 libdbi-dev libdbd-sqlite3 libsctp-dev

2.4 编译 Ortp

复制代码
wget http://download.savannah.gnu.org/releases/linphone/ortp/sources/ortp-0.22.0.tar.gz
tar -xvf ortp-0.22.0.tar.gz
cd ortp-0.22.0/
./configure
make
sudo make install
sudo ldconfig
cd ..
复制代码

2.5 编译libosmo-abis

复制代码
git clone git://git.osmocom.org/libosmo-abis.git
cd libosmo-abis
autoreconf -i
./configure
make
sudo make install
sudo ldconfig
cd ..
复制代码

2.6 编译libosmo-netif

复制代码
git clone git://git.osmocom.org/libosmo-netif.git
cd libosmo-netif/
autoreconf -i
./configure
make
sudo make install
sudo ldconfig
cd ..
复制代码

2.7 编译openbsc

编译Openbsc时需用到PCAP库文件,编译前先搜索&安装依赖包:

复制代码
apt-cache search PCAP
sudo pat-get install libpcap-dev libpcap0.8 libpcap0.8-dbg libpcap0.8-dev
sudo ldconfig

git clone git://git.osmocom.org/openbsc.git
cd openbsc/openbsc/
autoreconf -i
./configure
make
sudo make install
cd ../..
复制代码
复制代码
git clone git://git.osmocom.org/openbsc.git
cd openbsc/openbsc/
autoreconf -i
./configure
make
sudo make install
cd ../..
复制代码

2.8 编译osmo-bts

复制代码
git clone git://git.osmocom.org/osmo-bts.git
cd osmo-bts
autoreconf -i
./configure --enable-trx
make
sudo make install
cd ..
复制代码

2.9 创建OpenBSC配置文件

复制代码
#如果配置文件不存在需要先创建 Create the configuration folder if it isn't exist yet
mkdir ~/.osmocom
cd ~/.osmocom
touch ~/.osmocom/open-bsc.cfg
touch ~/.osmocom/osmo-bts.cfg
复制代码

0x03 源码编译Cellular Infrastructure

3.1 克隆源码

复制代码
git clone git://git.osmocom.org/libosmocore
git clone git://git.osmocom.org/libosmo-abis
git clone git://git.osmocom.org/openbsc
git clone git://git.osmocom.org/libosmo-netif
git clone git://git.osmocom.org/libosmo-sccp
git clone git://git.osmocom.org/libsmpp34
git clone git://git.osmocom.org/openggsn
复制代码

3.2 下载&执行自动编译脚本

复制代码
wget https://osmocom.org/attachments/download/2438/build_2G.sh
chmod 777  build_2G.sh
sudo bash build_2G.sh
复制代码

0x04 配置OpenBSC

4.1 启动BTS

终端1:

osmo-nitb -c ~/.osmocom/open-bsc.cfg -l ~/.osmocom/hlr.sqlite3 -P -C --debug=DRLL:DCC:DMM:DRR:DRSL:DNM

终端2:

telnet localhost 4242

4.2 配置IP

PC

IP:192.168.31.147 (通过WiFi连接)

路由器

IP:192.168.31.1

3G Access Point

IP:未知

方法1:进入路由后台,查找3G Access Point IP

方法2:通过abissip-find找到3G Access Point IP

复制代码
cd openbsc/openbsc/src/ipaccess
#or
cd openbsc/openbsc/build-2G/src/ipaccess

sudo ./abisip-find
复制代码

4.3 Telnet连入3G Access Point

telnet 3G Access Point's IP 8090

4.4 SSH连入

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 root@192.168.31.136
password:newsys

ipaccess-config

复制代码
init3@0xroot:~/osm/openbsc/openbsc/src/ipaccess$ ./ipaccess-config --help
ipaccess-config (C) 2009-2010 by Harald Welte and others
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY

Usage: ipaccess-config IP_OF_BTS
Commands for writing to the BTS:
  -u --unit-id UNIT_ID        Set the Unit ID of the BTS
  -o --oml-ip IP        Set primary OML IP (IP of your BSC)
  -i --ip-address IP/MASK    Set static IP address + netmask of BTS
  -g --ip-gateway IP        Set static IP gateway of BTS
  -r --restart            Restart the BTS (after other operations)
  -n --nvram-flags FLAGS/MASK    Set NVRAM attributes
  -S --nvattr-set FLAG    Set one additional NVRAM attribute
  -U --nvattr-unset FLAG    Set one additional NVRAM attribute
  -l --listen TESTNR        Perform specified test number
  -L --Listen TEST_NAME        Perform specified test
  -s --stream-id ID        Set the IPA Stream Identifier for OML
  -d --software FIRMWARE    Download firmware into BTS

Miscellaneous commands:
  -h --help            this text
  -H --HELP            Print parameter details.
  -f --firmware FIRMWARE    Provide firmware information
  -w --write-firmware        This will dump the firmware parts to the filesystem. Use with -f.
  -p --loop            Loop the tests executed with the --listen command.
复制代码

ipaccess-proxy

复制代码
init3@0xroot:~/osm/openbsc/openbsc/src/ipaccess$ ./ipaccess-proxy --help
Usage: ipaccess-proxy [options]
 ipaccess-proxy is a proxy BTS.
 -h --help. This help text.
 -l --listen IP. The ip to listen to.
 -b --bsc IP. The BSC IP address.
 -g --gprs IP. Take GPRS NS from that IP.

 -s --disable-color. Disable the color inside the logging message.
 -e --log-level number. Set the global loglevel.
 -T --timestamp. Prefix every log message with a timestamp.
 -V --version. Print the version of OpenBSC.
复制代码

0x05 Reference

https://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source
http://osmocom.org/projects/baseband/wiki/CalypsoBTS
https://osmocom.org/projects/cellular-infrastructure/wiki/Getting_Started_with_3G
https://osmocom.org/projects/osmocscn/wiki/Osmocom_3G_-_Getting_Started/3
https://osmocom.org/projects/cellular-infrastructure/wiki/Configuring_the_ipaccess_nano3G

本文转自 K1two2 博客园博客,原文链接:http://www.cnblogs.com/k1two2/p/6700662.html  ,如需转载请自行联系原作者

相关文章
E: flAbsPath on /var/lib/dpkg/status failed - realpath (2: 没有那个文件或目录)
E: flAbsPath on /var/lib/dpkg/status failed - realpath (2: 没有那个文件或目录)
157 0
|
5月前
|
应用服务中间件 数据安全/隐私保护 容器
websphere Error 404:SRVE0190E: File not found: index.action
websphere Error 404:SRVE0190E: File not found: index.action
No package ‘mate-settings-daemon‘ found
No package ‘mate-settings-daemon‘ found
57 0
Package sqlite3 was not found in the pkg-config search path.add the directory containing `sqlite3.pc
Package sqlite3 was not found in the pkg-config search path.add the directory containing `sqlite3.pc
143 0
flAbsPath on /var/lib/dpkg/status failed - realpath
flAbsPath on /var/lib/dpkg/status failed - realpath
88 0
sed: 1: “s/os.remove(“/xx/xxx. ...“: invalid command code f
sed: 1: “s/os.remove(“/xx/xxx. ...“: invalid command code f
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
76 0
|
Android开发
com.android.tools.aapt2.Aapt2Exception: AAPT error: check logs for details
com.android.tools.aapt2.Aapt2Exception: AAPT error: check logs for details
GET_PERS_LIST_4_CONFIG_ID (UI2CL_WD_CFG_UTILS)
Created by Wang, Jerry, last modified on Apr 21, 2015
108 0
GET_PERS_LIST_4_CONFIG_ID (UI2CL_WD_CFG_UTILS)
file not found:libRNDeviceInfo-tvOS.a
link 之后 这个 包根本就没有 image.png 解决方法 把 test工程删除 image.png
1042 0