2019-07-22 | UNLOCK

2019-7-22-zigbee环境搭建

ubiqua和cc2531实现zigbee抓包

首先安装ubiqua软件
然后安装cc2531驱动(不安装驱动计算机识别不出来,无法使用)
然后在ubiqua软件中选择菜单栏Device->Add device->local devices->cc2531(如果驱动安装成功,能识别出是cc2531),点击add
之后在Device Manager栏中会出现USB2531设备,往右拖动按钮可以开始抓包,如果没抓到,可以右击设备或者在Device->channel中选择不同频道

USRP-B210和GNUradio实现zigbee发包

第一步:安装gr-foo

1
2
3
4
5
6
7
8
git clone https://github.com/bastibl/gr-foo.git
cd gr-foo
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig

中间cmake报错

1
CMake 3.8 or higher is required.  You are running version 3.5.1

更新cmake,参考:https://askubuntu.com/questions/829310/how-to-upgrade-cmake-in-ubuntu

1、Check your current version with

1
cmake --version

2、Uninstall it with

1
sudo apt remove cmake

3、Visit https://cmake.org/download/ and download the latest binaries
In my case cmake-3.6.2-Linux-x86_64.sh is sufficient copy the binary to /opt/
4、

1
chmod +x /opt/cmake-3.*your_version*.sh (chmod makes the script executable)

5、

1
sudo bash /opt/cmake-3.*your_version.sh* (you'll need to press y twice)

The script installs to /opt/cmake-3.your_version so in order to get the cmake command, make a symbolic link:

6、

1
sudo ln -s /opt/cmake-3.*your_version*/bin/* /usr/local/bin

Test your results with

1
cmake --version

cmake版本的问题解决后又出现了新问题

1
2
3
4
5
6
7
CMake Error at CMakeLists.txt:98 (find_package):
Could not find a configuration file for package "Gnuradio" that is
compatible with requested version "3.8".

The following configuration files were considered but not accepted:

/usr/local/lib/cmake/gnuradio/GnuradioConfig.cmake, version: 3.7.13.4

谷歌不到类似问题,之后阅读github上的readme,可能是我的gr-foo的branches有问题,因为我的gnuradio最新版本就是3.7.13.4,看了之前gnuradio的安装过程,我尝试在gr-foo下用

1
git checkout maint-3.7

改变branch,成功cmake

之后一切顺利。

第二步:安装gr-ieee802.15.4

1
2
3
4
5
6
7
8
9
git clone https://github.com/bastibl/gr-ieee802.15.4.git
cd gr-ieee802.15.4
mkdir build
cd build
cmake ..
git checkout maint-3.7
make
sudo make install
sudo ldconfig

打开gr-ieee802-15-4下的examples中的transceiver_CSS_USRP.grc可能会发现miss block,这是因为有些模块是由其它模块组成的,没办法在安装的过程中直接载入到GNUradio中,这时候把examples下的几个流程图都打开并运行一遍,重启GNUradio就会发现缺失的模块出现了

第三步:运行gr-ieee802.15.4下app文件中的transceiver.sh

运行transceiver.sh前需要在gr-ieee802-15-4下的examples创建transceiver_OQPSK.py文件,创建方法就是在gnuradio-compation中选中流程图后点击绿色箭头左边的generate按钮,就会生成一个py文件,运行这个py文件就相当于运行这个流程图(流程图可以参考gr-ieee802.15.4官网的zigbee教程搭建,具体参数可以参考gr-ieee802-15-4下的examples中的transceiver_CSS_USRP.grc流程图)

如果运行失败,可以用vim查看transceiver.sh文件,寻找原因

评论加载中