Changes between Initial Version and Version 1 of wireless/wifi/mesh


Ignore:
Timestamp:
03/30/2020 10:29:53 PM (4 years ago)
Author:
Cale Collins
Comment:

First

Legend:

Unmodified
Added
Removed
Modified
  • wireless/wifi/mesh

    v1 v1  
     1[=#mesh]
     2= Mesh Network =
     3== What is mesh
     4A mesh network is a local network topology in which nodes connect dynamically without a hierarchy.  Data transfer will follow the most efficient path between clients.  This technology is applicable in many different industries, such as transportation, defense, and energy sectors.
     5
     6https://en.wikipedia.org/wiki/Mesh_networking
     7
     8== Getting started with mesh ==
     9Unfortunately, there's not an all purpose approach for how a mesh network should be configured.  It will require research to decide what hardware and software configuration will fit your needs closest.  The first thing to consider is what radio to use, not all radios support mesh and some that do will require specific kernel versions or firmware to accomplish this.  The best source of information will be the radio manufacturer — something to consider when selecting a radio is the level of support that will be available.  Linux kernel mailing lists should be used as a primary resource if you suspect there's an issue with the driver, kernel, or radio firmware.  WLE900VX is an excellent choice of radio and is available from the [https://shop.gateworks.com/ Gateworks store].  This radio has been tested to work with 4.14, 4.20, and 5.4 kernels.  A second radio which has been tested by Gateworks is the WPEQ-261ACNI(BT), this card is half length and includes bluetooth.  According to the manufacturer this card will only mesh in kernel versions 5.3 and newer, and only when using a custom built wpa_supplicant.  When creating a mesh network not all radios need to be the same model, we have tested creating a mesh network using a combination of these two radio models successfully.
     10
     11Select a BSP that is appropriate for your application.  In our testing the Bionic Ubuntu root filesystem was used with both Newport and Ventana family boards.  OpenWRT and Buildroot are viable options as well.  Enabling the necessary kernel modules will be required, though you may find in Gateworks kernel defconfigs these options have already been added. In our testing the following kernel config options were enabled:
     12
     13CONFIG_MAC80211_MESH=y
     14
     15CONFIG_LIBERTAS_MESH=y
     16
     17This can be verified in Linux userspace with the command:
     18{{{#!bash
     19zcat /proc/config.gz |grep mesh -i
     20}}}
     21
     22During testing attach antennas or attenuators depending on the proximity of the radios.  Without a strong clean signal the network may behave unpredictably. 
     23
     24=== Configuring your BSP ===
     25
     26Beyond the aforementioned steps providing anything more than general pointers would be impractical. There are many variables in how hardware can behave, what works in one case will cause a different configuration to fail.  The following guidance is intended for those using Ath10k radios. 
     27
     28Some circumstances will require testing multiple firmware versions.  Ath10k firmware can be downloaded from this repository:
     29
     30https://github.com/kvalo/ath10k-firmware
     31
     32The version of the current firmware being used can be verified by checking dmesg.
     33{{{#!bash
     34dmesg |grep ath -i
     35}}}
     36Example:
     37{{{
     38[   16.699066] ath10k_pci 0000:07:00.0: firmware ver 10.2.4-1.0-00037 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 a4a52adb
     39}}}
     40
     41Depending on the firmware version you may be required to use a module parameter for rawmode.  In some situations using rawmode will cause the interface to not appear, it is best to test without this option enabled first.  When configuring the network you may receive a message informing you that it is required.
     42
     43To enable raw mode: 
     44{{{#!bash
     45setenv bootargs "${bootargs} ath10k_core.rawmode=1"
     46}}}
     47This option can also be enabled in the bootscript.  On Newport make changes to "newport.env".   
     48
     49Check that your wireless interface is available:
     50{{{#!bash
     51ls /sys/class/net/
     52}}}
     53
     54Check mesh point is an available network type:
     55{{{#!bash
     56iw list |grep "mesh point"
     57}}}
     58If these two items are present proceed with bringing up the mesh interface.
     59
     60=== Bringing up the mesh network interface using "iw" ===
     61
     62Reference:
     63* https://wireless.wiki.kernel.org/en/users/drivers/ath10k/mesh
     64
     65Create a mesh point interface “mesh0”.
     66{{{#!bash
     67iw phy phy0 interface add mesh0 type mp
     68}}}
     69Confirm the creation of the new interface.
     70{{{#!bash
     71iw mesh0 info
     72Interface mesh0
     73        type mesh point
     74}}}
     75Configure channel information, all radios on the networking must be configured to use the same frequency.
     76{{{#!bash
     77iw dev mesh0 set freq 5745 80 5775
     78}}}
     79
     80Optionally, the interface’s MAC address can be set.
     81{{{#!bash
     82ifconfig mesh0 hw ether 00:11:22:33:44:56
     83}}}
     84
     85Assign a static IP and bring up the interface.
     86{{{#!bash
     87ifconfig mesh0 192.168.1.10
     88}}}
     89
     90Join a network. “mesh-ath10k” is the mesh ID which can be maximum of 32 bytes long.
     91{{{#!bash
     92iw dev mesh0 mesh join mesh-ath10k
     93}}}
     94
     95Verify link status, this command will not return anything unless there are minimum two peers on the network. 
     96{{{#!bash
     97iw mesh0 station dump
     98}}}
     99
     100=== Bringing up the mesh network interface using "wpa_supplicant" ===
     101
     102Some firmware will require compiling wpa_supplicant from source.
     103
     104Download the source code from this address:
     105
     106http://www.linuxfromscratch.org/blfs/view/svn/basicnet/wpa_supplicant.html
     107
     108Install required packages:
     109{{{#!bash
     110apt-get install libssl-dev dbus libdbus-1-dev libdbus-glib-1-2 libdbus-glib-1-dev libnl-3-dev libnl-genl-3-dev build-essential -y
     111}}}
     112Extract the .tar and create a .config:
     113{{{#!bash
     114tar -xvf wpa_supplicant-2.9.tar.gz
     115cd wpa_supplicant-2.9/wpa_supplicant/
     116cp defconfig .config
     117}}}
     118
     119Use "vi" to edit the .config file, make sure CONFIG_MESH is not commented out and verify it is enabled:
     120{{{
     121CONFIG_MESH=y
     122}}}
     123
     124Build wpa_supplicant:
     125{{{#!bash
     126make all & make install
     127}}}
     128* Optional - execute the command "which wpa_supplicant" to locate the file that is currently in your $PATH and replace it with the one you have freshly built.
     129Verify that wpa_supplicant is the desired version:
     130{{{#!bash
     131wpa_supplicant -v
     132}}}     
     133Create an /etc/wpa_supplicant.conf file with the following contents:
     134{{{
     135ctrl_interface=/var/run/wpa_supplicant
     136user_mpm=1
     137network={
     138        ssid="Mesh0"
     139        mode=5
     140        frequency=2442
     141        key_mgmt=NONE
     142}}}
     143Create a mesh point interface “mesh0”:
     144{{{#!bash
     145iw phy phy0 interface add mesh0 type mp
     146}}}
     147Optinally set the interface’s MAC address:
     148{{{#!bash
     149ifconfig mesh0 hw ether 00:11:22:33:44:56
     150}}}
     151Assign a static IP and bring up the interface.
     152{{{#!bash
     153ifconfig mesh0 192.168.1.10
     154}}}
     155Verify wpa_supplicant is not already running, if so kill the PID:
     156{{{#!bash
     157ps -ef |grep wpa
     158kill -9 <PID>
     159}}}
     160Launch wpa_supplicant, run in the background.
     161{{{#!bash
     162wpa_supplicant -Dnl80211 -imesh0 -c /etc/wpa_supplicant.conf -B $
     163}}}
     164Check that two peers are connected:
     165{{{#!bash
     166iw mesh0 station dump
     167}}}
     168=== Pre-built image ===
     169Gateworks does not offer an official pre-built image for mesh networking.  The .img.gz that was used for testing with Newport is linked below.   
     170
     171http://dev.gateworks.com/fae/mesh-newpor54.img.gz