Changes between Version 50 and Version 51 of wireless/wifi


Ignore:
Timestamp:
03/30/2020 09:56:42 PM (5 years ago)
Author:
Cale Collins
Comment:

added mesh section

Legend:

Unmodified
Added
Removed
Modified
  • wireless/wifi

    v50 v51  
    578578  - git git://w1.fi/srv/git/hostap.git (cgit: http://hostap.epitest.fi/cgit/hostap/)
    579579
     580[=#mesh]
     581= Mesh Network =
     582== What is mesh
     583A 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.
     584
     585https://en.wikipedia.org/wiki/Mesh_networking
     586
     587== Getting started with mesh ==
     588Unfortunately 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.
     589
     590Select 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:
     591
     592CONFIG_MAC80211_MESH=y
     593
     594CONFIG_LIBERTAS_MESH=y
     595
     596This can be verified in Linux userspace with the command:
     597{{{#!bash
     598zcat /proc/config.gz |grep mesh -i
     599}}}
     600
     601During testing attach antennas or attenuators depending on the proximity of the radios.  Without a strong clean signal the network may behave unpredictably. 
     602
     603=== Configuring your BSP ===
     604
     605Beyond the aforementioned steps providing anything more than general pointers would be impractical. There are may 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. 
     606
     607Some circumstance will require testing multiple firmware versions.  Ath10k firmware can be downloaded from this repository:
     608
     609https://github.com/kvalo/ath10k-firmware
     610
     611The version of the current firmware being used can be verified by checking dmesg.
     612{{{#!bash
     613dmesg |grep ath -i
     614}}}
     615Example:
     616{{{
     617[   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
     618}}}
     619
     620Depending 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.
     621
     622To enable raw mode: 
     623{{{#!bash
     624setenv bootargs "${bootargs} ath10k_core.rawmode=1"
     625}}}
     626This option can also be enabled in the bootscript.  On Newport make changes to "newport.env".   
     627
     628Check that your wireless interface is available:
     629{{{#!bash
     630ls /sys/class/net/
     631}}}
     632
     633Check mesh point is an available network type:
     634{{{#!bash
     635iw list |grep "mesh point"
     636}}}
     637If these two items are present proceed with bringing up with mesh interface.
     638
     639=== Bringing up the mesh network interface using "iw" ===
     640
     641Reference:
     642* https://wireless.wiki.kernel.org/en/users/drivers/ath10k/mesh
     643
     644Create a mesh point interface “mesh0”.
     645{{{#!bash
     646iw phy phy0 interface add mesh0 type mp
     647}}}
     648Confirm the creation of the new interface.
     649{{{#!bash
     650iw mesh0 info
     651Interface mesh0
     652        type mesh point
     653}}}
     654Configure channel information, all radios on the networking must be configured to use the same frequency.
     655{{{#!bash
     656iw dev mesh0 set freq 5745 80 5775
     657}}}
     658
     659Optionally, the interface’s MAC address can be set.
     660{{{#!bash
     661ifconfig mesh0 hw ether 00:11:22:33:44:56
     662}}}
     663
     664Assign a static IP and bring up the interface.
     665{{{#!bash
     666ifconfig mesh0 192.168.1.10
     667}}}
     668
     669Join a network. “mesh-ath10k” is the mesh ID which can be maximum of 32 bytes long.
     670{{{#!bash
     671iw dev mesh0 mesh join mesh-ath10k
     672}}}
     673
     674Verify link status, this command will not return anything unless there are minimum two peers on the network. 
     675{{{#!bash
     676iw mesh0 station dump
     677}}}
     678
     679=== Bringing up the mesh network interface using "wpa_supplicant" ===
     680
     681Some firmware will require compiling wpa_supplicant from source.
     682
     683Download the source code from this address:
     684
     685http://www.linuxfromscratch.org/blfs/view/svn/basicnet/wpa_supplicant.html
     686
     687Install required packages:
     688{{{#!bash
     689apt-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
     690}}}
     691Extract the .tar and create a .config:
     692{{{#!bash
     693tar -xvf wpa_supplicant-2.9.tar.gz
     694cd wpa_supplicant-2.9/wpa_supplicant/
     695cp defconfig .config
     696}}}
     697
     698Use "vi" to edit the .config file, make sure CONFIG_MESH is not commented out and verify it is enabled:
     699{{{
     700CONFIG_MESH=y
     701}}}
     702
     703Build wpa_supplicant:
     704{{{#!bash
     705make all & make install
     706}}}
     707* 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.
     708Verify that wpa_supplicant is the desired version:
     709{{{#!bash
     710wpa_supplicant -v
     711}}}     
     712Create an /etc/wpa_supplicant.conf file with the following contents:
     713{{{
     714ctrl_interface=/var/run/wpa_supplicant
     715user_mpm=1
     716network={
     717        ssid="Mesh0"
     718        mode=5
     719        frequency=2442
     720        key_mgmt=NONE
     721}}}
     722Create a mesh point interface “mesh0”:
     723{{{#!bash
     724iw phy phy0 interface add mesh0 type mp
     725}}}
     726Optinally set the interface’s MAC address:
     727{{{#!bash
     728ifconfig mesh0 hw ether 00:11:22:33:44:56
     729}}}
     730Assign a static IP and bring up the interface.
     731{{{#!bash
     732ifconfig mesh0 192.168.1.10
     733}}}
     734Verify wpa_supplicant is not already running, if so kill the PID:
     735{{{#!bash
     736ps -ef |grep wpa
     737kill -9 <PID>
     738}}}
     739Launch wpa_supplicant, run in the background.
     740{{{#!bash
     741wpa_supplicant -Dnl80211 -imesh0 -c /etc/wpa_supplicant.conf -B $
     742}}}
     743Check that two peers are connected:
     744{{{#!bash
     745iw mesh0 station dump
     746}}}
     747=== Pre-built image ===
     748Gateworks does not offer an official pre-built image for mesh networking.  The .img.gz that was used for testing with Newport is linked below.   
     749
     750http://dev.gateworks.com/fae/mesh-newpor54.img.gz
     751
     752
     753= Drivers =
    580754[=#drivers]
    581755== Linux Kernel Drivers ==