Skip to content

Intel 5300 WiFi card

ninja-hu edited this page Aug 2, 2022 · 13 revisions

The WiFi driver and supplementary tool repositories are a modified version of code released as part Linux 802.11n CSI Tool. Modifications include embedding the MAC ID of a robot in the header of WiFi packets broadcasted from it to enable unique identification and a frame-id in packets to match them for cancelling CFO. The driver modification also allows robot to immediately auto-transmit packets when it detects a broadcasted packet from robot any other robot. Additional details can be found on the System Architecture Wiki page.

Modified Driver and Firmware Setup Steps

All the instructions are available in the WSR-WiFiDriver readme.

Hardware Requirements

The driver requires Ubuntu 16.04 and SBC which has a mpcie or M2 slot to connect the Intel 5300 WiFi card. Currently tested on the following platforms:

  • UP Squared Board (OS installation steps here). Check Specs here
  • Intel NUC8i3CYSN (Same OS installation steps as above). Check specs here
  • Intel Apollo Lake N4200 (Same OS installation steps as above). Check specs here

Hardware connection example

This shows hardware connection using mpcie slot applicable to UP Squared Board and Apollo Lake N4200 board.

Sample-hardware-connection

This shows hardware connection using the m2 slot applicable to UP Squared board and Intel NUC. It requires using a M2 to mpcie connector

M2-NUC-hardware-connection

Note:

  1. Use the shortest FPC cable for the connector since using a longer one can potentially lead to hardware delays causing incorrect CFO cancellation.
  2. For Intel NUC, disable auto connection for the inbuild WiFi card interface (e.g., wlo1) as it interferes with the 5300 card during to usage of same driver. It can be disabled by making the following entry :
echo iface wlo1 inet manual | sudo tee -a /etc/network/interfaces
  1. For Intel NUC, disable Secure Boot from the BIOS; without this step, the modified WiFi driver will not be updated in the kernel.

Data packet structure

The structure to store information extracted from the WiFi packets and their corresponding CSI data is as follows:

struct DataPacket{
    unsigned long timestamp_low;
    unsigned short bfee_count;
    unsigned int Nrx;
    unsigned int Ntx;
    unsigned int rssi_a; // Signal strength at antenna 1
    unsigned int rssi_b; // Signal strength at antenna 2
    unsigned int rssi_c; // Signal strength at antenna 3
    char noise;
    unsigned int agc;
    unsigned int fake_rate_n_flags;
    unsigned long tv_sec;  //  Default: Broadcasted packet local timestamp (seconds)
    unsigned long tv_usec; //  Default: Broadcasted packet local timestamp (micro seconds)
    unsigned long frame_count; // New : Broadcasted packet ID
    double ts; // New : Broadcasted packet ID
    std::string mac_real;
    std::complex<double> csi[30][3];
    double perm[3];
};

Some of the fields in the above structure are directly extracted from the data packet information logged in the csi.dat files obtained using log_to_file, while others are calculated in the function read_bfee_timestamp_mac when parsing. This function is a modified version of the one available in Linux 802.11n CSI Tool.

Broadcasted Packet structure

Note: Check random_packets.