The instructions below assume that a complete development environment
is already present on the PC, including SDL, SDL_gfx, and GSL.
If any prerequisites are not met,
compilation will fail, and you'll have to install the corresponding
package and try again.
A different directory prefix can be chosen by overriding the
INSTALL_PREFIX variable, e.g.,
Note that the test scripts expect ${INSTALL_PREFIX}/bin
to be in PATH.
If NTP is not available, it may be necessary to increase the test's
tolerance by changing the variable CLOCK_DRIFT_PPM in
the script atusb.
If the Ben is running Jlime, the address would be as follows:
If using the same PC with Bens running OpenWrt and Jlime, one may choose
different host names depending on the distribution, and adapt the commands
used in the production and testing process accordingly. For example,
The Makefile also contains the variable SPECTRUM_MARGIN that
defines how many dB of tolerance should be allowed below and above the
reference signal strength. The default is to allow a margin of 5 dB in
either direction.
The scripts atusb and atusb-flash also contain
configuration variables. If the names of the files containing the
atusb firmware binaries are not boot.hex and
atusb.bin, atusb-flash needs to be adapted.
The instructions below apply for OpenWrt and Jlime. For building
things from source, a cross-compilation toolchain has to be installed
on the PC.
These are the settings for OpenWrt, assuming the network device is
called "usb0". If using Jlime, the command would be as follows:
If a WPAN-enabled kernel has been installed, the AT86RF230 driver takes
the place of the MMC driver. To disable it, run
This takes about 5 seconds.
Note that the result depends on the tolerance of the crystal in the Ben
and is also affected by temperature. Good accuracy can therefore
only be obtained if this measurement is performed individually on each
Ben, and if a stable temperature is maintained.
The physical arrangement of the devices should have the characteristics
described in the test section. The orientation
of the devices should be chosen such that the overall signal strength is
near its maximum, that the spectrum is relatively "flat", and that small
changes in the orientation only produce small variations in the measured
signal strength.
To generate the profiles for atben and atusb, simply run
After a obtaining the reference spectrum, press Q to exit. The
Makefile will then record the signal strength limits for an atben
DUT in the file ben.profile and proceed with the reverse
measurement, i.e., with atusb acting as the DUT.
git clone git://projects.qi-hardware.com/ben-wpan.git
cd ben-wpan/tools
make
make install
make INSTALL_PREFIX=/usr install
git clone git://git.openezx.org/dfu-util.git
cd dfu-util
./autogen.sh
./configure
make
make install
Note that some Linux distributions already provide a pre-compiled
version of dfu-util, which could be used instead of building
it from source.
wget -O atusb.bin \
http://downloads.qi-hardware.com/people/werner/wpan/bindist/atusb-ce16a16.bin
Instructions for building the binary from sources are
here.
echo 192.168.254.101 ben >>/etc/hosts
echo 192.168.1.202 ben >>/etc/hosts
echo 192.168.254.101 ben >>/etc/hosts
echo 192.168.1.202 jlime >>/etc/hosts
ssh ben 'cat >>/etc/dropbear/authorized_keys' <~/.ssh/id_rsa.pub
git clone git://projects.qi-hardware.com/ben-wpan.git
cd ben-wpan/tools
If you have already checked out the repository, cd to
ben-wpan/tools/ and run
make clean
Next, if on OpenWrt, compile the tools with
make TARGET=ben_openwrt
If on Jlime, use
make TARGET=ben_jlime
Finally, upload the tools to the Ben and install them under
/usr/bin/ with
make HOST=ben upload
Where ben is the host name or IP address assigned to the Ben.
wget http://downloads.qi-hardware.com/people/werner/wpan/bindist/avrdude-5.10-de72af351f661b538add81cbc9965278a2f8c40c.tar.gz
tar -xz -C / -f avrdude-5.10-de72af351f661b538add81cbc9965278a2f8c40c.tar.gz
Instructions for building avrdude from sources are
here.
wget -O boot.hex \
http://downloads.qi-hardware.com/people/werner/wpan/bindist/boot-ce16a16.hex
Instructions for building the binary from sources are
here.
ifconfig usb0 192.168.254.100 up
ifconfig usb0 192.168.1.200 up
echo jz4740-mmc.0 >/sys/bus/platform/drivers/jz4740-mmc/unbind
echo spi2.0 >/sys/bus/spi/drivers/at86rf230/unbind
Note that the above command only has the desired effect if used
before running any of the user-space tools. If the kernel driver and
the user-space tools have already clashed over access to the board, the
driver will not unbind and a reboot is needed.
atrf-proxy -b
atrf-xtal 1000 >ben.xtal
make spectrum
Then place the devices appropriately and press D
to use the displayed spectrum as the reference. Multiple spectra
can be merged into the reference, e.g., if unavoidable environmental
variations cause
significant changes. Spectra included in the reference are shown in blue.