This tutorial explains how to set up unidirectional communication from a normal WiFi card to the SDR.
On the host, we have to generate any IEEE 802.11a/g/p frames. An easy way is opening an access point in the 5GHz band, which will send periodic beacons. When opening an access point in the 2.4 GHz band, one has to ensure that the card is in pure-G mode and not in IEEE 802.11b compatibility mode. The latter has a different (backwards compatible) preamble that is not supported at the moment.
Another option is to put the card in monitor mode and manually inject frames.
This has the advantage that the number of frames, the transmit power, the size, and the encoding scheme can be controlled.
An example application for frame injection is included in the utils/packetspammer
folder.
On the receiver, we use the wifi_rx.grc
flow graph from the examples folder.
By default, the flow graph will output correctly received frames to the console.
To better monitor the frames, it’s possible to enable the Wireshark Connector block and the File Sink to dump the frames in a PCAP file, which can be open in Wireshark. Like with normal WiFi cards, the SDR annotates each frame with a Radiotap header, that contains information like an SNR estimate and the modulation and coding scheme.
Dumping the frames into a file is not very interactive and requires reloading the file in Wireshark to check if new frames arrived. It is possible to get live updates by
mkfifo /tmp/wifi.pcap
.wireshark -k /tmp/wifi.pcap
.An example script with error handling can be found at apps/rx_demo.sh
.
With this setup, the receiver will look similar to this:
With the GUI on the right, it is possible to change parameters and algorithms on-the-fly. This way it’s possible to change the channel estimation algorithm and watch the impact on the constellation plot.
Using a Tun/Tap interface and the corresponding GNU Radio block in the flow graph, it is possible to connect the SDR transceiver to the Linux TCP/IP stack.
See the transceiver.grc
flow graph and the nic.sh
script from the apps folder for an example.
If it does not work out of the box you can try the following: