To setup the Testbed, one can simply follow the instructions below. For a successfull measurement one should follow the instruction precisely.
Required Material for our Testbed
- HOST PC with Ubuntu installed
- 1x Raspberry Pi
- 2x USB - Extension Cable
- 1x Powerbank (optional for portable use of the setup)
- 1x Power Supply
- 2x CC2531 Sticks (TI)
- 1x SD Card (16GB recommend)
- 1x WLAN Stick (in this case TL-WN722N)(if connection via wlan to the network is required, cable would work as well)
- Flash Device for example CC-Debugger
- Our scripts provided below
Prepare the Host
To prpeare the Host please follow the next instructions. Please enter the commandline by opening terminal or pressing CTRL+ALT+T. After that enter the following line to prepare your host system.
Please execute line by line (The console lines are in a box)
sudo apt-get install autoconf autogen sudo apt-get install gpp sudo apt-get install g++ sudo apt-get install libtool sudo add-apt-repository ppa:chris-lea/libsodium
next things have to be done by root
sudo su echo "deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list echo "deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list apt-get update && sudo apt-get install libsodium-dev exit
from here no root shell required zmq
wget https://github.com/zeromq/zeromq4-1/releases/download/v4.1.4/zeromq-4.1.4.tar.gz tar -xvzf zeromq-4.1.4.tar.gz cd zeromq-4.1.4 ./autogen.sh ./configure make -j 4 make check sudo make install sudo ldconfig
sudo apt-get install python-zmq python-dev python-qt4 libzmq3-dev python-numpy
Plot Function: After you are done with the configuration and installation of the required programms, download our plot.pyc script. This is availabe here in a couple of days.
Prepare the CC2531 Stick
Before we continue with the Raspberry we have to configure the CC2531 Stick. The required firmware can be downloaded (soon) here. To install this firmware to the Stick we use the CC Debugger, which is able to communicate via the proprietary TI Connection, which is installed on the Stick. In our testenvironment we install SmartRF Programmer on a Windows PC, there are other tools and devices, that offer the installation to the CC2531 device as well, but we want to focus on the way we worked with.
The required Tool can be found here : Smart RF Programmer by TI. After the installation of this tool on the computer, the user can connect the CC2531 Stick to the Debugger. In addition to that, make sure, that the Stick is connected to a power supply as well. In our case it is connected to a powerbank. If the Stick is connected in a correct way, the light of the CC Debugger-Light turn from red to green. It should look similar to the picture in the right. Be sure the cable is placed in the right direction, otherwise it might harm the CC2531.
After the right connection one has to choose the right device. Usually there is only one device listed, if only one CC Stick is connected at the same time. After that you select the File, which you downloaded before. Select the Radiobutton "Erase, program and verify" and press "Perform actions" to install the firmware on the CC Stick. After that the CC Stick is ready for the usage.
Set up a Raspberry
Download and install the latest version of RASPBIAN and install it to the SD Card. Several installation guides can be found on the internet. (For example this one). Put the SD card into the Raspberry, connect the two CC2531 Sticks with the enhancement cables to the raspberry, connect the WLAN Stick or the Ethernet cable and connect the power cable to the raspberry. After the installation of the operating system please connect the Raspberry to your network. Now download the measurement files which will be available HERE soon. The measurement files are everything, that is required on the Raspberry. In the measurement folder there are several config files for different scenarios. One of the config files allows the communication of two CC2531 Stick on one Raspberry. In this config file there are some addresses which needs to be defined. One is the node0 which is the central node. It is defined as the master of the sticks. The last variable of this node is radio_addr. At this place it is neccessary to enter the particular address of the stick. Therefore open a terminal and open the place where the cfg and the framework is stored and enter the following.
This command will show the addresses of the connected CC2531 devices. Transfer the adress of one device to the above mentioned radio_address. In its central role, this address is also required for the second node, whose radio_coord_addr has to be set to the same address as the first node's radio adress. Furthermore you have to add the second address, which you can find out in the way, mentioned above, to the radio_addr of the second node.
After that it is neccessary to start the framework. To do so, enter the following command to the terminal:
./framework -c config.cfg
Open another terminal The framework is now started and the only thing that is required at this moment is the ip address. Simply find it out by opening another (don't use the same!) terminal and start
This command shows the ip address which is neccessary for the start of the plot script on the computer.
Start the function plotter
To see the measurements you open a terminal at the computer (the one with the prepared Ubuntu mentioned in the beginning), and move to the place where you stored the plot.pyc file. After that please enter the following command:
python plot.pyc -r EnterYourIpHere:6000 -l256
For example: python plot.pyc -r 192.168.1.42:6000 -l256. 6000 defines the port which is used. After pressing enter a window appears which shows the graphical output of the measurement. If you touch the CC2531 sticks right now, you can see variances in the plot, similar to the image below. Your done! The connection is established.
- Tutorial of howtoforge.com
- It has to be the same network, where the above mentioned Ubuntu computer is connected to