Changes between Version 5 and Version 6 of expansion/gw16159


Ignore:
Timestamp:
03/11/2025 04:47:48 PM (3 weeks ago)
Author:
Tim Harvey
Comment:

add additional details

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16159

    v5 v6  
    1 = GW16159 !HaLow M.2 Card
    2 
    3 This wiki page discusses the Gateworks GW16159 !HaLow !WiFi card
    4 
    5 ''' NOTE: This card only works on VeniceFLEX because it requires a M.2 slot with SDIO signalling. This will not work on a regular Venice SBC, even with a M.2 adapter.'''
    6 
    7 The [https://www.gateworks.com/products/mini-pcie-expansion-cards/gw16159-802-11ah-halow-wifi-m2-card/ GW16159] is a M.2 E-Key 2242 form factor 802.11ah radio consisting of:
    8 - [https://www.silextechnology.com/connectivity-solutions/embedded-wireless/sx-sdmah Silex SX-SDMAH ] module based on [https://www.morsemicro.com/wp-content/uploads/2024/01/USA_MM6108-MF08651-US_Product-Brief_240104-CES-Digital.pdf Morse Micro MM6108] (US only)
    9 
     1[[PageOutline]]
     2
     3= GW16159 M.2 E-Key 802.11ah (!HaLow) radio
     4The GW16159 M.2 E-Key Sub-1GHz 802.11ah radio uses the Silex SD-SDMAH module which itself uses the !MorseMicro MM6108 chip.
     5
     6'''NOTE: Th GW16159 requires an M.2 E-Key socket with SDIO. For Gateworks this exists only on the VeniceFLEX product family.'''
    107
    118View the [https://www.gateworks.com/products/mini-pcie-expansion-cards/gw16159-802-11ah-halow-wifi-m2-card/ GW16159 Product Page] for pricing and specifications
    129
    13 
    14 == GW16159 Software
    15 
    16 Coming soon, contact Gateworks Support
     10IEEE 802.11ah is a wireless networking protocol published in 2017 called Wi-Fi !HaLow as an amendment of the IEEE 802.11-2007 wireless networking standard. It uses 900 MHz license-exempt bands to provide extended-range Wi-Fi networks, compared to conventional Wi-Fi networks operating in the 2.4 GHz, 5 GHz and 6 GHz bands. It also benefits from lower energy consumption, allowing the creation of large groups of stations or sensors that cooperate to share signals, supporting the concept of the Internet of things (IoT). The protocol's low power consumption competes with Bluetooth, !LoRa, and Zigbee, and has the added benefit of higher data rates and wider coverage range.
     11
     12The radio communicates of the SDIO bus with 3.3V I/O at 50MHz.
     13
     14Datasheets:
     15 * [https://www.morsemicro.com/wp-content/uploads/2024/12/MM6108-Data-Sheet-v4.pdf MorseMicro MM6108 Datasheet]
     16 * [https://205257.fs1.hubspotusercontent-na1.net/hubfs/205257/SX-SDMAH_R2_Prod_Brochure_EN_v1.pdf SX-SDMAH Product Brief] ([https://www.silextechnology.com/connectivity-solutions/embedded-wireless/sx-sdmah Contact Silex for Datasheet])
     17
     18M.2 Pin Details:
     19 * M2.56 W_DISABLE1# routed to the RESET_N pin of the SX_SDMAH with a 200k pu to VDD_3P3
     20 * M2.54 W_DISABLE2# routed to the WAKE pin of the SX_SDMAH with a 10k pu to VDD_3P3
     21
     22!WiFi Details:
     23 * !WiFi !HaLow 802.11ah 850-950MHz bands 1/2/4/8MHz channel width 21dBm max output power and 32Mbps theoretical maximum transmission rate
     24 * SDIO: 0x325b:0x0306
     25
     26Software Details:
     27 * required software:
     28  * out-of-tree kernel driver: https://github.com/Gateworks/morse_driver/tree/gateworks-venice (forked from https://github.com/MorseMicro/morse_driver.git)
     29  * firmware: https://github.com/MorseMicro/morse_firmware.git
     30  * required CLI app: https://github.com/MorseMicro/morse_cli.git
     31  * custom version of hostapd/wpa_supplicant: https://github.com/MorseMicro/hostap
     32  * kernel patches: https://github.com/Gateworks/linux-venice/tree/v6.6.8-venice-mm6108
     33
     34== Software
     35
     36=== Pre-built images
     37Currently the mm6108 driver requires the Linux 6.6 kernel and therefore it is not compatible with our Linux 6.12 pre-built images. Gateworks has pre-built images with the mm6108 driver here:
     38 * [https://dev.gateworks.com/venice/images/noble-venice-mm6108.img.gz noble-venice-mm6108.img.gz] (see [http://trac.gateworks.com/wiki/venice/firmware#disk-images compressed-disk-image])
     39 * [https://dev.gateworks.com/venice/kernel/linux-venice-mm6108.tar.xz linux-venice-mm6108.tar.xz Kernel tarball] (see [http://trac.gateworks.com/wiki/linux/kernel#install kernel-tarball install])
     40 
     41=== Driver
     42The mm6108 on the GW16159 is supported by the open-source out-of-tree Linux kernel driver from !MorseMicro.
     43
     44building with the Gateworks Venice BSP:
     45  1. change the Linux branch to v6.6.8-venice-mm6108
     46{{{#!bash
     47git -C linux remote update
     48git -C linux checkout v6.6.8-venice-mm6108
     49}}}
     50  2. add a 'custom_kernel_mm6108' script
     51{{{#!bash
     52cat <<\EOF > custom_kernel_mm6108
     53#!/bin/bash -e
     54
     55DIR=$PWD/mm610x
     56OUTDIR=$DIR/out
     57DESTDIR=$2
     58
     59MORSE_VER=1.12.4
     60LIBNL_VER=libnl3_11_0
     61OPENSSL_VER=openssl-3.4.0
     62COUNTRY=US
     63mkdir -p $DESTDIR/usr/sbin
     64mkdir -p $DESTDIR/etc/modprobe.d
     65mkdir -p $DIR
     66cd $DIR
     67
     68# get repos of what we will build
     69[ -d morse_driver ] || git clone --recurse-submodules https://github.com/Gateworks/morse_driver.git -b gateworks-venice
     70[ -d libnl ] || git clone https://github.com/thom311/libnl.git -b $LIBNL_VER
     71[ -d openssl ] || git clone https://github.com/openssl/openssl.git -b $OPENSSL_VER
     72[ -d hostap ] || git clone https://github.com/MorseMicro/hostap.git -b $MORSE_VER
     73[ -d morse_cli ] || git clone https://github.com/MorseMicro/morse_cli.git -b $MORSE_VER
     74
     75echo "Building mm6108 driver..."
     76        CONFIG_MORSE_SDIO=y \                                                                                               
     77        CONFIG_MORSE_USER_ACCESS=y \                                                                                       
     78        CONFIG_MORSE_VENDOR_COMMAND=y \                                                                                     
     79        CONFIG_MORSE_SDIO_ALIGNMENT=4 \                                                                                     
     80CONFIG_MORSE_DEBUGFS=y \                                                                                                   
     81CONFIG_MORSE_IPMON=y \                                                                                                     
     82CONFIG_MORSE_MONITOR=y \                                                                                                   
     83        CONFIG_MORSE_POWERSAVE_MODE=0 \                                                                                     
     84        CONFIG_MORSE_COUNTRY=$COUNTRY \                                                                                     
     85        CONFIG_MORSE_RC=y \                                                                                                 
     86        CONFIG_WLAN_VENDOR_MORSE=m"                                                                                         
     87make -C morse_driver $ARGS                                                                                                 
     88make -C morse_driver $ARGS INSTALL_MOD_PATH=$2 modules_install                                                             
     89                                                                                                                           
     90# firmware:                                                                                                                 
     91#  - mm6108 firmware                                                                                                       
     92#  - board configuration file (BCF) that provides driver with calibration constants and chip gpio config                   
     93echo "Copying mm6108 firmware..."                                                                                           
     94mkdir -p $2/lib/firmware/morse                                                                                             
     95wget http://dev.gateworks.com/firmware/gw16159/mm6108.bin -O $2/lib/firmware/morse/mm6108.bin                               
     96wget http://dev.gateworks.com/firmware/gw16159/LICENSE -O $2/lib/firmware/morse/LICENSE                                     
     97wget "http://dev.gateworks.com/firmware/gw16159/HY103760XB_SX-SDMAH-R2(US)_20240807_5V0.bin" -O $2/lib/firmware/morse/bcf_sx
     98sdmah_fem5p0.bin                                                                                                           
     99
     100[ -d $OUTDIR/include/libnl3 ] || {
     101        cd libnl
     102        ./autogen.sh
     103        ./configure --host=$ARCH CC=${CROSS_COMPILE}gcc --prefix=$OUTDIR --disable-shared
     104        make clean
     105        make -j32
     106        make install
     107        cd ..
     108}
     109
     110[ -d $OUTDIR/include/openssl ] || {
     111        cd openssl
     112        ./Configure linux-generic32 no-shared no-dso no-async -DL_ENDIAN --prefix=$OUTDIR --openssldir=$OUTDIR
     113        # needed no-async to build latest openssl against uclib
     114        make -j32 \
     115                CC=${CROSS_COMPILE}gcc \
     116                RANLIB=${CROSS_COMPILE}ranlib \
     117                LD=${CROSS_COMPILE}ld \
     118                MAKEDEPPROG=${CROSS_COMPILE}gcc \
     119                PROCESSOR=ARM
     120        #make install # installs man pages too
     121        make install_sw
     122        cd ..
     123}
     124
     125# wpa_supplicant
     126[ -r hostap/wpa_supplicant/wpa_supplicant_s1g.bin ] || {
     127        cp hostap/wpa_supplicant/defconfig hostap/wpa_supplicant/.config
     128        make -C hostap/wpa_supplicant/ clean
     129        CFLAGS="-I $OUTDIR/include/libnl3 -I $OUTDIR/include" \
     130                LDFLAGS="-L $OUTDIR/lib/ --static" \
     131                DESTDIR="$OUTDIR/sbin" \
     132                BINDIR=/usr/sbin \
     133                LIBS="-lnl-3 -lm -lpthread -lcrypto -lssl" \
     134                CC=${CROSS_COMPILE}gcc \
     135                make -j32 -C hostap/wpa_supplicant/
     136#               MORSE_VERSION=rel_1_11_3_2024_Mar_28
     137}
     138cp hostap/wpa_supplicant/{wpa_supplicant_s1g,wpa_cli_s1g,wpa_passphrase_s1g} $DESTDIR/usr/sbin/
     139
     140# hosapd
     141[ -r hostap/hostapd/hostapd_s1g.bin ] || {
     142        cp hostap/hostapd/defconfig hostap/hostapd/.config
     143        make -C hostap/hostapd/ clean
     144        CFLAGS="-I $OUTDIR/include/libnl3 -I $OUTDIR/include" \
     145                LDFLAGS="-L $OUTDIR/lib/ --static" \
     146                DESTDIR="$OUTDIR/sbin" \
     147                BINDIR=/usr/sbin \
     148                LIBS="-lnl-3 -lm -lpthread -lcrypto -lssl" \
     149                CC=${CROSS_COMPILE}gcc \
     150                make -j32 -C hostap/hostapd/
     151# MORSE_VERSION=rel_1_11_3_2024_Mar_28
     152}
     153cp hostap/hostapd/{hostapd_s1g,hostapd_cli_s1g} $DESTDIR/usr/sbin/
     154                                                             
     155# morse_cli
     156[ -r morse_cli/morse_cli.bin ] || {
     157        make -C morse_cli clean
     158        CFLAGS="-I $OUTDIR/include/libnl3 -I $OUTDIR/include" \
     159                LDFLAGS="-L $OUTDIR/lib/ --static" \
     160                CC=${CROSS_COMPILE}gcc \
     161        make \
     162                CONFIG_MORSE_TRANS_NL80211=1 \
     163                CONFIG_MORSE_STATIC=1 \
     164                -j32 -C morse_cli
     165}
     166cp morse_cli/morse_cli $DESTDIR/usr/sbin/
     167
     168# module parameters
     169echo "options morse country=$COUNTRY enable_ext_xtal_init=1 bcf=bcf_sxsdmah_fem5p0.bin" > $DESTDIR/etc/modprobe.d/morse.conf
     170EOF
     171chmod +x custom_kernel_mm6108
     172}}}
     173  3. rebuild the ubuntu-image:
     174{{{#!bash
     175source ./setup-environment
     176make ubuntu-image
     177}}}
     178
     179Module Parameters:
     180 - There are a number of module parameters supported by morse.ko however the required ones for the GW16159 are:
     181  * country=US
     182  * enable_ext_xtal_init=1
     183  * bcf=bcf_sxsdmah_fem5p0.bin
     184 - These can be placed in /etc/modprobe..d such as:
     185{{{#!bash
     186echo "options morse country=US enable_ext_xtal_init=1 bcf=bcf_sxsdmah_fem5p0.bin" > /etc/modprobe.d/morse.conf
     187}}}
     188
     189Kernel Messages:
     190{{{#!bash
     191# dmesg | grep mmc0
     192[    1.009160] mmc0: SDHCI controller on 30b40000.mmc [30b40000.mmc] using ADMA
     193[    1.029119] mmc_sdio_init_card mmc0 quirks=0x0 ocr_card=0x300000 (1.8v=1)
     194[    1.052784] mmc_sdio_init_card mmc0 setting voltage to 1.8V
     195[    1.166152] mmc0: new high speed SDIO card at address 0001
     196# cat /sys/bus/mmc/devices/mmc0:0001/{vendor,device)
     1970x325b
     1980x0306
     199# modprobe mac80211
     200# modprobe dot11ah
     201[   37.240328] dot11ah: module verification failed: signature and/or required key missing - tainting kernel
     202[   37.251882] Morse Micro Dot11ah driver registration. Version 0-rel_1_12_4_2024_Jun_11-6-g63cd0768
     203# modprobe morse bcf=bcf_default.bin country=US
     204[   37.285877] morse micro driver registration. Version 0-rel_1_12_4_2024_Jun_11-6-g63cd0768
     205[   37.299842] morse_sdio mmc0:0001:1: sdio new func 1 vendor 0x325b device 0x306 block 0x8/0x8
     206[   37.308556] morse_sdio mmc0:0001:2: sdio new func 2 vendor 0x325b device 0x306 block 0x200/0x200
     207[   37.317515] morse_of_probe MORSE_SDIO_RW_ADDR_BOUNDARY_MASK=0xffff0004
     208[   37.324088] morse_sdio mmc0:0001:2: Device node not found
     209[   37.329517] morse_sdio mmc0:0001:2: No pin configs found, using defaults...
     210[   37.336503] morse_sdio mmc0:0001:2: mm_wake_gpio=3 mm_ps_async_gpio=7 mm_reset_gpio=5 mm_spi_irq_gpio=0
     211[   37.357195] morse_sdio mmc0:0001:2: Loaded firmware from morse/mm6108.bin, size 433044, crc32 0x436ba524
     212[   37.367241] morse_sdio mmc0:0001:2: Loaded BCF from morse/bcf_default.bin, size 1127, crc32 0xd9cd0bd3
     213[   37.927510] morse_ieee80211_init tx_sk_pacing_shift=7
     214[   37.932604] morse_ps_init async_gpio=7 irq=35
     215[   37.937046] morse_ps_init request_irq irq=0 ret=35
     216[   37.942141] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
     217[   37.956407] morse_sdio mmc0:0001:2: Driver loaded with kernel module parameters
     218[   37.963794] morse_sdio mmc0:0001:2:     enable_1mhz_probes                      : Y
     219[   37.971548] morse_sdio mmc0:0001:2:     enable_hw_scan                          : Y
     220[   37.971558] morse_sdio mmc0:0001:2:     enable_pv1                              : N
     221[   37.986917] morse_sdio mmc0:0001:2:     enable_page_slicing                     : N
     222[   37.994630] morse_sdio mmc0:0001:2:     log_modparams_on_boot                   : Y
     223[   38.002335] morse_sdio mmc0:0001:2:     enable_mcast_at_op_bw                   : N
     224[   38.010038] morse_sdio mmc0:0001:2:     enable_mcast_whitelist                  : Y
     225[   38.017716] morse_sdio mmc0:0001:2:     ocs_type                                : 1
     226[   38.025382] morse_sdio mmc0:0001:2:     enable_auto_mpsw                        : Y
     227[   38.033051] morse_sdio mmc0:0001:2:     duty_cycle_probe_retry_threshold        : 2500
     228[   38.040979] morse_sdio mmc0:0001:2:     duty_cycle_mode                         : 0
     229[   38.048646] morse_sdio mmc0:0001:2:     enable_auto_duty_cycle                  : Y
     230[   38.056313] morse_sdio mmc0:0001:2:     dhcpc_lease_update_script               : /morse/scripts/dhcpc_update.sh
     231[   38.066499] morse_sdio mmc0:0001:2:     enable_ibss_probe_filtering             : Y
     232[   38.074165] morse_sdio mmc0:0001:2:     enable_dhcpc_offload                    : N
     233[   38.081837] morse_sdio mmc0:0001:2:     enable_arp_offload                      : N
     234[   38.089504] morse_sdio mmc0:0001:2:     enable_bcn_change_seq_monitor           : 0
     235[   38.097173] morse_sdio mmc0:0001:2:     enable_cac                              : 0
     236[   38.104842] morse_sdio mmc0:0001:2:     max_mc_frames                           : 10
     237[   38.112599] morse_sdio mmc0:0001:2:     tx_max_power_mbm                        : 2200
     238[   38.120529] morse_sdio mmc0:0001:2:     enable_twt                              : Y
     239[   38.128193] morse_sdio mmc0:0001:2:     enable_mac80211_connection_monitor      : N
     240[   38.135866] morse_sdio mmc0:0001:2:     enable_airtime_fairness                 : N
     241[   38.143532] morse_sdio mmc0:0001:2:     enable_raw                              : Y
     242[   38.151198] morse_sdio mmc0:0001:2:     max_aggregation_count                   : 0
     243[   38.158863] morse_sdio mmc0:0001:2:     max_rate_tries                          : 1
     244[   38.166528] morse_sdio mmc0:0001:2:     max_rates                               : 3
     245[   38.174194] morse_sdio mmc0:0001:2:     enable_watchdog_reset                   : N
     246[   38.181863] morse_sdio mmc0:0001:2:     watchdog_interval_secs                  : 30
     247[   38.189615] morse_sdio mmc0:0001:2:     enable_watchdog                         : Y
     248[   38.197283] morse_sdio mmc0:0001:2:     country                                 : US
     249[   38.205040] morse_sdio mmc0:0001:2:     enable_cts_to_self                      : N
     250[   38.212707] morse_sdio mmc0:0001:2:     enable_rts_8mhz                         : N
     251[   38.220374] morse_sdio mmc0:0001:2:     enable_trav_pilot                       : Y
     252[   38.228038] morse_sdio mmc0:0001:2:     enable_sgi_rc                           : Y
     253[   38.235701] morse_sdio mmc0:0001:2:     enable_mbssid_ie                        : N
     254[   38.243371] morse_sdio mmc0:0001:2:     virtual_sta_max                         : 0
     255[   38.251035] morse_sdio mmc0:0001:2:     thin_lmac                               : 0
     256[   38.258703] morse_sdio mmc0:0001:2:     enable_dynamic_ps_offload               : Y
     257[   38.266373] morse_sdio mmc0:0001:2:     enable_ps                               : 2
     258[   38.274038] morse_sdio mmc0:0001:2:     enable_subbands                         : 2
     259[   38.281707] morse_sdio mmc0:0001:2:     enable_survey                           : Y
     260[   38.289373] morse_sdio mmc0:0001:2:     mcs10_mode                              : 0
     261[   38.297041] morse_sdio mmc0:0001:2:     mcs_mask                                : 1023
     262[   38.304966] morse_sdio mmc0:0001:2:     no_hwcrypt                              : 0
     263[   38.312630] morse_sdio mmc0:0001:2:     enable_ext_xtal_init                    : Y
     264[   38.320294] morse_sdio mmc0:0001:2:     enable_otp_check                        : 1
     265[   38.327962] morse_sdio mmc0:0001:2:     bcf                                     : bcf_default.bin
     266[   38.336849] morse_sdio mmc0:0001:2:     serial                                  : default
     267[   38.345040] morse_sdio mmc0:0001:2:     debug_mask                              : 8
     268[   38.352708] morse_sdio mmc0:0001:2:     tx_status_lifetime_ms                   : 15000
     269[   38.360723] morse_sdio mmc0:0001:2:     tx_queued_lifetime_ms                   : 1000
     270[   38.368651] morse_sdio mmc0:0001:2:     max_txq_len                             : 32
     271[   38.376403] morse_sdio mmc0:0001:2:     default_cmd_timeout_ms                  : 600
     272[   38.384242] morse_sdio mmc0:0001:2:     enable_short_bcn_as_dtim_override       : -1
     273[   38.392000] morse_sdio mmc0:0001:2:     fw_bin_file                             :
     274[   38.399581] morse_sdio mmc0:0001:2:     sdio_reset_time                         : 400
     275[   38.407420] morse_sdio mmc0:0001:2:     macaddr_suffix                          : 00:00:00
     276[   38.415697] morse_sdio mmc0:0001:2:     macaddr_octet                           : 255
     277[   38.423538] morse_sdio mmc0:0001:2:     max_total_vendor_ie_bytes               : 514
     278[   38.431379] morse_sdio mmc0:0001:2:     coredump_include                        : 1
     279[   38.439047] morse_sdio mmc0:0001:2:     coredump_method                         : 1
     280[   38.446714] morse_sdio mmc0:0001:2:     enable_coredump                         : Y
     281[   38.454381] morse_sdio mmc0:0001:2:     sdio_clk_debugfs                        :
     282[   38.461968] morse_sdio mmc0:0001:2:     enable_mm_vendor_ie                     : Y
     283[   38.475337] uaccess char driver major number is 237
     284[   38.481173] morse_io: Device node '/dev/morse_io' created successfully
     285# ls -l /sys/class/net/wlan0
     286lrwxrwxrwx 1 root root 0 Nov 21 00:59 /sys/class/net/wlan0 -> ../../devices/platform/soc@0/30800000.bus/30b40000.mmc/mmc_host/mmc0/mmc0
     287:0001/mmc0:0001:2/net/wlan0
     288}}}
     289
     290=== Kernel Patches
     291There is a small set of kernel patches that improve the experience for 802.11ah:
     292 * [https://github.com/Gateworks/linux-venice/tree/v6.6.8-venice-mm6108 Linux v6.6]
     293{{{#!bash
     2940d6491779d34 0018-mac80211_ndp_block_ack.patch
     29595967bc5723d 0012-mac80211-mlme-ps-recalc-for-dynamic-ps-v5.15.patch
     296fe47d461c62a 0009-mac80211-Mesh-support.patch
     297027692d8b6ec 0008-mac80211-IBSS-bridge-support.patch
     29838a8d6efb0f9 0007-mac80211_tx_s1g_AP_ecsa_support.patch
     2995c1cd06b8d8f 0006-mac80211_mlme_s1g_ecsa_support.patch
     300}}}
     301   - A basic AP/station !HaLow network without powersave requirements or extended channel switch will function without these patches.
     302   - It has been reported that with these kernel patches have not caused any noticeable obvious issues with other mac80211 radios
     303
     304=== hostapd and wpa_supplicant
     305!MorseMicro has a [https://github.com/MorseMicro/hostap/ custom version of hostapd and wpa_supplicant] with support added for 802.11ah. For most of the added configuration options there is no current way to pass them via ieee80211 APIs with nl80211 so instead the configuration is supplied via vendor-specific commands using the {{{morse_cli}}} userspace application. These are typically built as {{{hostapd_s1g}}} and {{{wpa_supplicant_s1g}}} so that they can coexist with the standard tools.
     306
     307
     308=== morse_cli
     309The {{{morse_cli}}} userspace application can be used to interact with the driver. It communicates over netlink so the interface must be up before you can talk to it. Much of the functionality is present for {{{hostapd_s1g}}} and {{{wpa_supplicant_s1g}}} to use.
     310
     311Examples:
     312{{{#!bash
     313# make sure interface is up
     314ifconfig wlan0 up
     315# morse_cli --interface=wlan0 hw_version
     316HW Version: MM6108-A1
     317# morse_cli --interface=wlan0 version
     318Morse_cli Version: rel_1_12_5_2024_Jul_25-4-g3541610
     319FW Version: rel_1_12_4_2024_Jun_11
     320# morse_cli channel
     321Full Channel Information
     322        Operating Frequency: 916000 kHz
     323        Operating BW: 8 MHz
     324        Primary BW: 2 MHz
     325        Primary Channel Index: 0
     326}}}
     327 - note if not specified the interface defaults to wlan0
     328
     329
     330[=#channels]
     331== Channel Mapping
     332The !HaLow channels are mapped to standard 802.11 channels:
     333 * US
     334||= S1G Op Class =||= Global Op Class =||= Channel Bandwidth =||= Channel Number =||= Center Frequency =||
     335|| 1 || 68 || 1 || 1 || 902.5 ||
     336|| 1 || 68 || 1 || 3 || 903.5 ||
     337|| 1 || 68 || 1 || 5 || 904.5 ||
     338|| 1 || 68 || 1 || 7 || 905.5 ||
     339|| 1 || 68 || 1 || 9 || 906.5 ||
     340|| 1 || 68 || 1 || 11 || 907.5 ||
     341|| 1 || 68 || 1 || 13 || 908.5 ||
     342|| 1 || 68 || 1 || 15 || 909.5 ||
     343|| 1 || 68 || 1 || 17 || 910.5 ||
     344|| 1 || 68 || 1 || 19 || 911.5 ||
     345|| 1 || 68 || 1 || 21 || 912.5 ||
     346|| 1 || 68 || 1 || 23 || 913.5 ||
     347|| 1 || 68 || 1 || 25 || 914.5 ||
     348|| 1 || 68 || 1 || 27 || 915.5 ||
     349|| 1 || 68 || 1 || 29 || 916.5 ||
     350|| 1 || 68 || 1 || 31 || 917.5 ||
     351|| 1 || 68 || 1 || 33 || 918.5 ||
     352|| 1 || 68 || 1 || 35 || 919.5 ||
     353|| 1 || 68 || 1 || 37 || 920.5 ||
     354|| 1 || 68 || 1 || 39 || 921.5 ||
     355|| 1 || 68 || 1 || 41 || 922.5 ||
     356|| 1 || 68 || 1 || 43 || 923.5 ||
     357|| 1 || 68 || 1 || 45 || 924.5 ||
     358|| 1 || 68 || 1 || 47 || 925.5 ||
     359|| 1 || 68 || 1 || 49 || 926.5 ||
     360|| 1 || 68 || 1 || 51 || 927.5 ||
     361|| 2 || 69 || 2 || 2  || 903.0 ||
     362|| 2 || 69 || 2 || 6  || 905.0 ||
     363|| 2 || 69 || 2 || 10 || 907.0 ||
     364|| 2 || 69 || 2 || 14 || 909.0 ||
     365|| 2 || 69 || 2 || 18 || 911.0 ||
     366|| 2 || 69 || 2 || 22 || 913.0 ||
     367|| 2 || 69 || 2 || 26 || 915.0 ||
     368|| 2 || 69 || 2 || 30 || 917.0 ||
     369|| 2 || 69 || 2 || 34 || 919.0 ||
     370|| 2 || 69 || 2 || 38 || 921.0 ||
     371|| 2 || 69 || 2 || 42 || 923.0 ||
     372|| 2 || 69 || 2 || 46 || 925.0 ||
     373|| 2 || 69 || 2 || 50 || 927.0 ||
     374|| 2 || 70 || 4 || 8  || 906.0 ||
     375|| 2 || 70 || 4 || 16 || 910.0 ||
     376|| 2 || 70 || 4 || 24 || 914.0 ||
     377|| 2 || 70 || 4 || 32 || 918.0 ||
     378|| 2 || 70 || 4 || 40 || 922.0 ||
     379|| 2 || 70 || 4 || 48 || 926.0 ||
     380|| 2 || 71 || 8 || 12 || 908.0 ||
     381|| 2 || 71 || 8 || 28 || 916.0 ||
     382|| 2 || 71 || 8 || 44 || 924.0^^^1^^^ ||
     383 1. 924MHz is disabled in mm6108 firmware due to noise exceeding specification
     384
     385
     386== Configuration
     387The changes made by !MorseMicro to hostap add a number of parameters to hostapd.conf:
     388 * ieee80211ah: IEEE 802.11ah (S1G) supported
     389 * s1g_prim_chwidth: Sub-1 GHz primary channel bandwidth
     390 * s1g_prim_1mhz_chan_index: Sub-1 GHz primary 1MHz channel index
     391 * s1g_capab: S1G capabilities (list of flags)
     392 * s1g_traveling_pilots: Sub-1 Ghz traveling pilots
     393 * s1g_bss_color:  Sub-1 GHz BSS color (0-7).
     394 * s1g_max_mpdu: Sub-1 GHz MPDU maximum length
     395 * s1g_ampdu: Sub-1 GHz A-MPDU support
     396 * s1g_max_ampdu_len_exp: Sub-1 GHz A-MPDU length exponent
     397 * s1g_basic_mcs_nss_set: Sub-1 GHz basic NSS/MCS support
     398
     399For documentation on these refer to the code:
     400 * [https://github.com/MorseMicro/hostap/blob/v1.14/hostapd/hostapd_s1g.conf hostapd_s1g.conf]
     401 * [https://github.com/MorseMicro/hostap/blob/v1.14/hostapd_s1g_configuration.md hostapd_s1g_configuration]
     402
     403Example configurations:
     404 * infrastructure mode using WPA2:
     405  - AP:
     406{{{#!bash
     407cat << EOF > hostapd_s1g.conf
     408cat hostapd_s1g.conf
     409interface=wlan0
     410logger_syslog=-1
     411logger_syslog_level=2
     412logger_stdout=-1
     413logger_stdout_level=2
     414ctrl_interface=/var/run/hostapd
     415ctrl_interface_group=0
     416ssid=HaLow-WPA2
     417country_code=US
     418hw_mode=a
     419beacon_int=100
     420dtim_period=2
     421max_num_sta=255
     422rts_threshold=-1
     423fragm_threshold=-1
     424macaddr_acl=0
     425auth_algs=3
     426ignore_broadcast_ssid=0
     427wmm_enabled=1
     428wmm_ac_bk_cwmin=4
     429wmm_ac_bk_cwmax=10
     430wmm_ac_bk_aifs=7
     431wmm_ac_bk_txop_limit=0
     432wmm_ac_bk_acm=0
     433wmm_ac_be_aifs=3
     434wmm_ac_be_cwmin=4
     435wmm_ac_be_cwmax=10
     436wmm_ac_be_txop_limit=0
     437wmm_ac_be_acm=0
     438wmm_ac_vi_aifs=2
     439wmm_ac_vi_cwmin=3
     440wmm_ac_vi_cwmax=4
     441wmm_ac_vi_txop_limit=94
     442wmm_ac_vi_acm=0
     443wmm_ac_vo_aifs=2
     444wmm_ac_vo_cwmin=2
     445wmm_ac_vo_cwmax=3
     446wmm_ac_vo_txop_limit=47
     447wmm_ac_vo_acm=0
     448ieee80211ah=1
     449s1g_prim_chwidth=1
     450s1g_prim_1mhz_chan_index=0
     451s1g_capab=[SHORT-GI-ALL]
     452eapol_key_index_workaround=0
     453own_ip_addr=127.0.0.1
     454#918.5MHz@1
     455#channel=33
     456#op_class=68
     457#907MHz@2
     458#channel=10
     459#op_class=69
     460#922Mhz@4
     461#channel=40
     462#op_class=70
     463#916MHz@8
     464channel=28
     465op_class=71
     466# WPA2 security
     467wpa=2
     468wpa_passphrase=strongpassword123
     469wpa_key_mgmt=WPA-PSK
     470wpa_pairwise=TKIP
     471rsn_pairwise=CCMP
     472EOF
     473hostapd_s1g ./hostapd_s1g.conf -B
     474ifconfig wlan0 192.168.1.1
     475iperf3 -s
     476}}}
     477  * STA:
     478{{{#!bash
     479wpa_passphrase_s1g test strongpassword123 > wpa_supplicant_s1g.conf
     480wpa_supplicant_s1g -iwlan0 -c ./wpa_supplicant_s1g.conf &
     481ifconfig wlan0 192.168.1.128
     482iperf3 -c 192.168.1.1
     483}}}
     484
     485[=#performance]
     486== Performance
     487The MM6108 supports:
     488 * Spacial Streams: 1
     489 * Channel bandwidths: 1/2/4/8 MHz
     490 * Modulation and Coding Schemes: MCS 0-7 (1/2/4 Mhz); MCS 10 (1Mhz only)
     491 * Data rates up to 32.5Mbps (MCS 7, 64-QAM, 8 Mhz channel, 4 us GI)
     492
     493Since 802.11ah is designed for low-power, long-range IoT applications, its rates are lower than higher-frequency Wi-Fi standards like 802.11n/ac/ax.
     494
     495802.11ah uses OFDM with a subcarrier spacing of 31.25 kHz (1/32 µs), scaled down from 802.11ac’s 312.5 kHz to support narrower channels. The number of data subcarriers varies with bandwidth:
     496 - 1 MHz: 24 data subcarriers.
     497 - 2 MHz: 52 data subcarriers.
     498 - 4 MHz: 108 data subcarriers.
     499 - 8 MHz: 234 data subcarriers.
     500
     501The PHY rate is calculated as: PHY Rate = (Number of Data Subcarriers) × (Bits per Subcarrier) × (Coding Rate) × (Symbols per Second) × (Number of Spatial Streams):
     502 - Data Subcarriers:
     503  * 1 MHz: 24 data subcarriers.
     504  * 2 MHz: 52 data subcarriers.
     505  * 4 MHz: 108 data subcarriers.
     506  * 8 MHz: 234 data subcarriers.
     507 - Bits per Subcarier and Coding Rate: Depends on MCS index
     508 - Symbols per Second:
     509  * Long GI (8us): 4 us data + 4 us GI: 125,000 symbols/s
     510  * Short GI (4us): 4 us data + 0 us GI: 250,000 symbols/s
     511 - Spatial Streams: 1 (common for IoT devices).
     512
     513[=#mcs_table]
     514Calculated max PHY Data Rates per MCS, channel bandwidth, and gaurd interval:
     515||= MCS ||= Modulation ||= Coding rate ||= 1 MHz channel (Mbps) Long GI / Short GI ||= 2 MHz channel (Mbps) Long GI / Short GI ||= 4 MHz channel (Mbps) Long GI / Short GI ||= 8 MHz channel (Mbps) Long GI / Short GI ||
     516|| 0 || BPSK || 1/2 || 0.3 / 0.33 || 0.65 / 0.72 || 1.35 / 1.5 || 2.925 / 3.25 ||
     517|| 1 || QPSK || 1/2 || 0.6 / 0.67 || 1.3 / 1.44 || 2.7 / 3.0 || 5.85 / 6.5 ||
     518|| 2 || QPSK || 3/4 || 0.9 / 1.0 || 1.95 / 2.17 || 4.05 / 4.5 || 8.775 / 9.75 ||
     519|| 3 || 16-QAM || 1/2 || 1.2 / 1.33 || 2.6 / 2.89 || 5.4 / 6.0 || 11.7 / 13.0 ||
     520|| 4 || 16-QAM || 3/4 || 1.8 / 2.0 || 3.9 / 4.33 || 8.1 / 9.0 || 17.55 / 19.5 ||
     521|| 5 || 64-QAM || 2/3 || 2.4 / 2.67 || 5.2 / 5.78 || 10.8 / 12.0 || 23.4 / 26.0 ||
     522|| 6 || 64-QAM || 3/4 || 2.7 / 3.0 || 5.85 / 6.5 || 12.15 / 13.5 || 26.3 / 29.3 ||
     523|| 7 || 64-QAM || 5/6 || 3.0 / 3.34 || 6.5 / 7.22 || 13.5 / 15.0 || 29.3 / 32.5 ||
     524|| 10 || BPSK || 1/2 || 0.15 / 0.17 || N/A || N/A || N/A ||
     525
     526
     527Note that MCS10 is a special case in 802.11ah and is for 1MHz cahnnels only with a repetition mode modulated with BPSK and 1/2 coding rate. This is for ultra-low rate extended range. The repetition doubles robustness but halves throughput.
     528
     529Actual throughput will be less taking into account overhead, congestion, and RF factors. To examine your link you can use the following:
     530 * examine the rate control stats:
     531{{{#!bash
     532cat /sys/kernel/debug/ieee80211/phy0/morse/mmrc_table
     533}}}
     534 * examine your link status (RSSI and MCS info):
     535  - AP:
     536{{{#!bash
     537iw dev wlan0 station dump
     538}}}
     539  - STA:
     540{{{#!bash
     541iw dev wlan0 link
     542}}}
     543
     544The rate control stats {{{/sys/kernel/debug/ieee80211/phy0/morse/mmrc_table}}} will provide statistics from the Morse S1G TX Rate rate control algorithm:
     545 - each line represents stats for a given channel bandwidth, guard band interval, and MCS index
     546 - the 'rate_sel' column uses the following definitions:
     547  * A : Highest throughput
     548  * B : 2nd highest throughput
     549  * C : baseline throughput
     550  * P : Maximum delivery probability
     551  * L : Used for additional lookarounds when traffic is very low
     552
     553Examining this tells you what MCS rate you are using; if it is not the highest then look at RF characteristics such as antenna, transmit strength, RSSI, and interference.
     554
     555Example:
     556 * Using 8MHz Short GI:
     557{{{#!bash
     558# cat /sys/kernel/debug/ieee80211/phy0/morse/mmrc_table | head -n4; cat /sys/kernel/debug/ieee80211/phy0/morse/mmrc_table | grep 8MHz | grep SGI
     559
     560Morse Micro S1G RC Algorithm Statistics:
     561Peer 1c:bc:ec:33:56:4c
     562   bw   guard evid rate_sel mcs#/ss index airtime TP(max)  TP(avg) prob last_rty last_suc last_att  tot_suc  tot_att mpdu_suc mpdu_fail
     563  8MHz   SGI   0      C     MCS0 /1   7     3165   0.00     0.00     0      0        0        0          0        0      0        0
     564  8MHz   SGI   0            MCS1 /1  15     2122   0.00     0.00     0      0        0        0          0        0      0        0
     565  8MHz   SGI   0            MCS2 /1  23     1582   0.00     0.00     0      0        0        0          0        0      0        0
     566  8MHz   SGI   0            MCS3 /1  31     1043   0.00     0.00     0      0        0        0          0        0      0        0
     567  8MHz   SGI   0            MCS4 /1  39      791   0.00     0.00     0      0        0        0          0        0      0        0
     568  8MHz   SGI   0       P    MCS5 /1  47      503   0.00     0.00     0      0        0        0          0        0      0        0
     569  8MHz   SGI   0     B      MCS6 /1  55      395  29.25    29.24   100      0        0        0         81       81      0        0
     570  8MHz   SGI   0    A   L   MCS7 /1  63      323  35.10    32.17    99      0        0        0     214300   218411      0        0
     571
     572}}}
     573  - the above shows the majority of the packets are using MCS7, the highest rate.
     574
     575Gateworks Testing Results:
     576 * Infrastructure mode:
     577||= channel BW =||= channel =||= op_class =||= freq =||= TCP (mbps) =||= UDP (mbps) ||
     578|| 2MHz || 10 || 69 || 907Mhz || 6 || 6.8 ||
     579|| 4MHz || 40 || 70 || 922Mhz || 10 || 12 ||
     580|| 8MHz || 28 || 71 || 916MHz || 19 || 23 ||