98 | | 1. Add a 'custom_kernel_mm6108' script |
99 | | {{{#!bash |
100 | | cat <<\EOF > custom_kernel_mm6108 |
101 | | #!/bin/bash -e |
102 | | |
103 | | DIR=$PWD/mm610x |
104 | | OUTDIR=$DIR/out |
105 | | DESTDIR=$2 |
106 | | |
107 | | MORSE_VER=1.12.4 |
108 | | LIBNL_VER=libnl3_11_0 |
109 | | OPENSSL_VER=openssl-3.4.0 |
110 | | COUNTRY=US |
111 | | mkdir -p $DESTDIR/usr/sbin |
112 | | mkdir -p $DESTDIR/etc/modprobe.d |
113 | | mkdir -p $DIR |
114 | | cd $DIR |
115 | | |
116 | | # get repos of what we will build |
117 | | [ -d morse_driver ] || git clone --recurse-submodules https://github.com/Gateworks/morse_driver.git -b gateworks-venice |
118 | | [ -d libnl ] || git clone https://github.com/thom311/libnl.git -b $LIBNL_VER |
119 | | [ -d openssl ] || git clone https://github.com/openssl/openssl.git -b $OPENSSL_VER |
120 | | [ -d hostap ] || git clone https://github.com/MorseMicro/hostap.git -b $MORSE_VER |
121 | | [ -d morse_cli ] || git clone https://github.com/MorseMicro/morse_cli.git -b $MORSE_VER |
122 | | |
123 | | echo "Building mm6108 driver..." |
124 | | ARGS="KERNEL_SRC=$1 \ |
125 | | CONFIG_MORSE_SDIO=y \ |
126 | | CONFIG_MORSE_USER_ACCESS=y \ |
127 | | CONFIG_MORSE_VENDOR_COMMAND=y \ |
128 | | CONFIG_MORSE_SDIO_ALIGNMENT=4 \ |
129 | | CONFIG_MORSE_POWERSAVE_MODE=0 \ |
130 | | CONFIG_MORSE_COUNTRY=$COUNTRY \ |
131 | | CONFIG_MORSE_RC=y \ |
132 | | CONFIG_WLAN_VENDOR_MORSE=m" |
133 | | make -C morse_driver $ARGS |
134 | | make -C morse_driver $ARGS INSTALL_MOD_PATH=$2 modules_install |
135 | | |
136 | | # firmware: |
137 | | # - mm6108 firmware |
138 | | # - board configuration file (BCF) that provides driver with calibration constants and chip gpio config |
139 | | echo "Copying mm6108 firmware..." |
140 | | mkdir -p $2/lib/firmware/morse |
141 | | wget http://dev.gateworks.com/firmware/gw16159/mm6108.bin -O $2/lib/firmware/morse/mm6108.bin |
142 | | wget http://dev.gateworks.com/firmware/gw16159/LICENSE -O $2/lib/firmware/morse/LICENSE |
143 | | wget "http://dev.gateworks.com/firmware/gw16159/HY103760XB_SX-SDMAH-R2(US)_20240807_5V0.bin" -O $2/lib/firmware/morse/bcf_sxsdmah_fem5p0.bin |
144 | | |
145 | | [ -d $OUTDIR/include/libnl3 ] || { |
146 | | cd libnl |
147 | | ./autogen.sh |
148 | | ./configure --host=$ARCH CC=${CROSS_COMPILE}gcc --prefix=$OUTDIR --disable-shared |
149 | | make clean |
150 | | make -j32 |
151 | | make install |
152 | | cd .. |
153 | | } |
154 | | |
155 | | [ -d $OUTDIR/include/openssl ] || { |
156 | | cd openssl |
157 | | ./Configure linux-generic32 no-shared no-dso no-async -DL_ENDIAN --prefix=$OUTDIR --openssldir=$OUTDIR |
158 | | # needed no-async to build latest openssl against uclib |
159 | | make -j32 \ |
160 | | CC=${CROSS_COMPILE}gcc \ |
161 | | RANLIB=${CROSS_COMPILE}ranlib \ |
162 | | LD=${CROSS_COMPILE}ld \ |
163 | | MAKEDEPPROG=${CROSS_COMPILE}gcc \ |
164 | | PROCESSOR=ARM |
165 | | #make install # installs man pages too |
166 | | make install_sw |
167 | | cd .. |
168 | | } |
169 | | |
170 | | # wpa_supplicant |
171 | | [ -r hostap/wpa_supplicant/wpa_supplicant_s1g.bin ] || { |
172 | | cp hostap/wpa_supplicant/defconfig hostap/wpa_supplicant/.config |
173 | | make -C hostap/wpa_supplicant/ clean |
174 | | CFLAGS="-I $OUTDIR/include/libnl3 -I $OUTDIR/include" \ |
175 | | LDFLAGS="-L $OUTDIR/lib/ --static" \ |
176 | | DESTDIR="$OUTDIR/sbin" \ |
177 | | BINDIR=/usr/sbin \ |
178 | | LIBS="-lnl-3 -lm -lpthread -lcrypto -lssl" \ |
179 | | CC=${CROSS_COMPILE}gcc \ |
180 | | make -j32 -C hostap/wpa_supplicant/ CONFIG_MESH=y |
181 | | } |
182 | | cp hostap/wpa_supplicant/{wpa_supplicant_s1g,wpa_cli_s1g,wpa_passphrase_s1g} $DESTDIR/usr/sbin/ |
183 | | |
184 | | # hosapd |
185 | | [ -r hostap/hostapd/hostapd_s1g.bin ] || { |
186 | | cp hostap/hostapd/defconfig hostap/hostapd/.config |
187 | | make -C hostap/hostapd/ clean |
188 | | CFLAGS="-I $OUTDIR/include/libnl3 -I $OUTDIR/include" \ |
189 | | LDFLAGS="-L $OUTDIR/lib/ --static" \ |
190 | | DESTDIR="$OUTDIR/sbin" \ |
191 | | BINDIR=/usr/sbin \ |
192 | | LIBS="-lnl-3 -lm -lpthread -lcrypto -lssl" \ |
193 | | CC=${CROSS_COMPILE}gcc \ |
194 | | make -j32 -C hostap/hostapd/ |
195 | | } |
196 | | cp hostap/hostapd/{hostapd_s1g,hostapd_cli_s1g} $DESTDIR/usr/sbin/ |
197 | | |
198 | | # morse_cli |
199 | | [ -r morse_cli/morse_cli.bin ] || { |
200 | | make -C morse_cli clean |
201 | | CFLAGS="-I $OUTDIR/include/libnl3 -I $OUTDIR/include" \ |
202 | | LDFLAGS="-L $OUTDIR/lib/ --static" \ |
203 | | CC=${CROSS_COMPILE}gcc \ |
204 | | make \ |
205 | | CONFIG_MORSE_TRANS_NL80211=1 \ |
206 | | CONFIG_MORSE_STATIC=1 \ |
207 | | -j32 -C morse_cli |
208 | | } |
209 | | cp morse_cli/morse_cli $DESTDIR/usr/sbin/ |
210 | | |
211 | | # module parameters |
212 | | echo "options morse country=$COUNTRY enable_ext_xtal_init=1 bcf=bcf_sxsdmah_fem5p0.bin" > $DESTDIR/etc/modprobe.d/morse.conf |
213 | | EOF |
214 | | chmod +x custom_kernel_mm6108 |
215 | | }}} |
216 | | 3. rebuild the ubuntu-image: |
217 | | {{{#!bash |
218 | | source ./setup-environment |
219 | | make ubuntu-image |
220 | | }}} |
221 | | |
222 | | Module Parameters: |
223 | | - There are a number of module parameters supported by morse.ko however the required ones for the GW16167 are: |
224 | | * country=US |
225 | | * enable_ext_xtal_init=1 |
226 | | * bcf=bcf_sxsdmah_fem5p0.bin |
227 | | - These can be placed in /etc/modprobe..d such as: |
228 | | {{{#!bash |
229 | | echo "options morse country=US enable_ext_xtal_init=1 bcf=bcf_sxsdmah_fem5p0.bin" > /etc/modprobe.d/morse.conf |
230 | | }}} |
231 | | |
232 | | |
| 95 | * coming soon |
618 | | [=#performance] |
619 | | == Performance |
620 | | The MM8108 supports: |
621 | | * Spacial Streams: 1 |
622 | | * Channel bandwidths: 1/2/4/8 MHz |
623 | | * Modulation and Coding Schemes: MCS 0-9 (1/2/4/8 Mhz); MCS 10 (1Mhz only) |
624 | | * Data rates up to 43.3Mbps (MCS 9, 64-QAM, 8 Mhz channel, 4 us GI) |
625 | | |
626 | | Since 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. |
627 | | |
628 | | 802.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: |
629 | | - 1 MHz: 24 data subcarriers. |
630 | | - 2 MHz: 52 data subcarriers. |
631 | | - 4 MHz: 108 data subcarriers. |
632 | | - 8 MHz: 234 data subcarriers. |
633 | | |
634 | | The PHY rate is calculated as: PHY Rate = (Number of Data Subcarriers) × (Bits per Subcarrier) × (Coding Rate) × (Symbols per Second) × (Number of Spatial Streams): |
635 | | - Data Subcarriers: |
636 | | * 1 MHz: 24 data subcarriers. |
637 | | * 2 MHz: 52 data subcarriers. |
638 | | * 4 MHz: 108 data subcarriers. |
639 | | * 8 MHz: 234 data subcarriers. |
640 | | - Bits per Subcarier and Coding Rate: Depends on MCS index |
641 | | - Symbols per Second: |
642 | | * Long GI (8us): 4 us data + 4 us GI: 125,000 symbols/s |
643 | | * Short GI (4us): 4 us data + 0 us GI: 250,000 symbols/s |
644 | | - Spatial Streams: 1 (common for IoT devices). |
645 | | |
646 | | |
647 | | |
648 | | |
649 | | Note 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. |
650 | | |
651 | | Actual throughput will be less taking into account overhead, congestion, and RF factors. To examine your link you can use the following: |
652 | | * examine the rate control stats: |
653 | | {{{#!bash |
654 | | cat /sys/kernel/debug/ieee80211/phy0/morse/mmrc_table |
655 | | }}} |
656 | | * examine your link status (RSSI and MCS info): |
657 | | - AP: |
658 | | {{{#!bash |
659 | | iw dev wlan0 station dump |
660 | | }}} |
661 | | - STA: |
662 | | {{{#!bash |
663 | | iw dev wlan0 link |
664 | | }}} |
665 | | |
666 | | The rate control stats {{{/sys/kernel/debug/ieee80211/phy0/morse/mmrc_table}}} will provide statistics from the Morse S1G TX Rate rate control algorithm: |
667 | | - each line represents stats for a given channel bandwidth, guard band interval, and MCS index |
668 | | - the 'rate_sel' column uses the following definitions: |
669 | | * A : Highest throughput |
670 | | * B : 2nd highest throughput |
671 | | * C : baseline throughput |
672 | | * P : Maximum delivery probability |
673 | | * L : Used for additional lookarounds when traffic is very low |
674 | | |
675 | | Examining 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. |
676 | | |
677 | | |
678 | | |
679 | | == Transmit Power |
680 | | |
681 | | It allows up to 26dBm at specific frequencies, bandwidth and MCS rate as noted in the table below. |