Using t2-build
, we can generate a special version of kmod-rt2x00-lib.ipk
and kmod-rt2800-lib.ipk
that allows modification of testing parameters at runtime.
- Link to the patched file: https://gist.github.com/tcr/9d1c0442bd7d494c336a
- saved to ./openwrt/package/kernel/mac80211/patches/999-tim_did_a.patch
Explicitly run make package/kernel/mac80211/compile V=s -C openwrt
or the full build process. Find the file by running
ls ./openwrt/bin/ramips/packages/base/kmod-rt2x00-lib_*.ipk
ls ./openwrt/bin/ramips/packages/base/kmod-rt2800-lib_*.ipk
Install those onto T2 with opkg install *.ipk
.
fccadventure needs to be updated to write to /proc/tcr-wifi. See https://gist.github.com/tcr/9d1c0442bd7d494c336a#file-999-tim_did_a-patch-L356
for the encoding.
uh
RT2860 = MT7620
For encoding txpower: http://lxr.free-electrons.com/source/drivers/net/wireless/rt2x00/rt2800lib.c?v=4.4#L3612
- http://rfmw.em.keysight.com/wireless/helpfiles/n7617a/coding_and_modulation.htm
- http://chimera.labs.oreilly.com/books/1234000001739/ch02.html#transmission_modulation_coding_and_guard_interval
For the corresponding registers:
- Read that max is 0x27.
- Might be 0x14 for 10 dBm? "WHO KNOWS"
What registers are available?
TX_PWR_MCS_0
, 2, 4, 7, 8, 10, 12, 14, 15, (HT MCS)TX_PWR_OFDM_6
, 12, 24, 48, 54,TX_PWR_CCK_1
, 5(.5),TX_PWR_STBC_0
, 2, 4, 6, 7,
- TXWI fields:
TX_PWR_ADJ
Explanation:
- MCS - n
- OFDM - g
- CCK - b
- STBC - n with two antennas
TXWI fields: TX_PWR_ADJ: Transmit Power Adjustment Sets Tx power to a value from -16 dB to +7 dB. When negative, each unit represents 2 dB; when positive, each unit represents 1 dB.
Definitely: http://lxr.free-electrons.com/source/drivers/net/wireless/rt2x00/rt2800lib.c?v=3.18#L4090
-
BBP R1 sets some deltas for TX power. See
BBP1_TX_POWER_CTRL
andrt2800_config_txpower_rt28xx
-
TX power is set in the configuration registers. See
rt2800_config_txpower_rt28xx
andrt2800_compensate_txpower
-
What about TX power? Maybe this TX field which isn't modified ANYWHERE. See
rt2800pci_write_tx_desc
TX_PWR_CFG_0
through 4
rt2800_register_write(rt2x00dev, TX_PWR_CFG_0-4, 7-9, (u32) reg);
Patching is done through the build system. Here we are using a stock deployment of t2-build
. In /work/openwrt-tessel, we find our build system. We'll find a file like this:
/work/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/compat-wireless-2015-03-09/drivers/net/wireless/rt2x00/rt2x00queue.h
Copy "/work/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/compat-wireless-2015-03-09" to a new folder. Instantiate this as a new git repo and add everything. Then by modifying your files, you can run git diff
to create a patch similar to the following: https://gist.github.com/tcr/9d1c0442bd7d494c336a
We want to dump this patch e.g. here:
git diff HEAD~1 > /work/openwrt-tessel/openwrt/package/kernel/mac80211/patches/999-tim_did_a.patch
```
Then we can rebuild only these particular components:
```
make -j64 V=s
make package/kernel/mac80211/compile V=s -C openwrt
cp ./openwrt/bin/ramips/packages/base/kmod-rt2x00-lib_3.18.17+2015-03-09-3_ramips_24kec.ipk /vagrant/
```
Then on your Tessel:
```
opkg install kmod-rt2x00-lib_3.18.16+2015-03-09-3_ramips_24kec.ipk
```
## How to update Tessel
Write to `/tmp/openwrt.bin`
```
sysupgrade /tmp/openwrt.bin
```
To find these builds:
```
ls openwrt/bin/ramips/openwrt-ramips-mt7620-tessel-squashfs-sysupgrade.bin
```
Reference: http://blog.gaku.net/upgrading-openwrt-firmware-from-command-line/
## How to clear local Tessel changes?
```
mtd -r erase rootfs_data
```
## Requirements
1. What are the TELEC requirements for transmission power?
2. What does Tessel 2 need to do differently to pass TELEC?
Wifi modes:
* `b` needs 10 dBm or above
* `g` needs 7-10 dBm
* `n` needs 0 dDm or above, but (can be? must be?) lower than `g` mode.
We must turn up our transmission power to meet these requirements.
## RF Exploring
Spectrum comparison: <http://rfexplorer.com/models/>
### Okay now setting
Ranges are as follows:
* TWXI4 is 4 bits, +7 to -16 (doubled) i.e. 0x7 is +7 and, 0x8 is -2, 0xf is -16
* TX\_CFG uses 8 bits, -16 db to 15.5db with 0.5 step (-0x20 to 0x1f ???)
* BBP sets gains of -12, -6, 0, +6 for (2, 1, 0, 3) respectively
Settings are as (TWXI4, TX_CFG, BBP). The combinations:
- (+7, 0xc, 3) => -69
- ( 0, 0x0, 2) => -60 /-59.5
Possible explanation: Don't understand TX_CFG option totally. BBP could have been set wrong (to begin with). Or TXWI is wrong, but unlikely?
TODO
- (+7, 0xc, 3) => -69
- ( 0, 0x0, 2) => -60 /-59.5
- (-16, 0xc, 3) => -60
- (+7, 0, 3) => -69.5
- (+7, 0xc, 2) => 68.5
- (+3, 0xc, 3) => 58.5
- (+1, 0xc, 0) => -59.0
- (+7, 0xc, 3) => 58.5
- (+7, 0x0, 3) => 58.5
Looks like we're not getting anywhere. I applied tape.
- ( 0, 0xc, 3) => -72.5
- (-16, 0x0, 2) => -80
- ( 7, 0xf, 3) => -75.5
- ( 7, 0xc, 3) => -73.5
- (-16, 0xc, 3) => -75.5
- (-16, 0xc, 2) => -75.5
With unplugging:
- (-16, 0x0, 2) => -85.5
- ( 7, 0xf, 3) => -71.5
- ( 7, 0xf, 2) => -75.5
- ( 7, 0x0, 3) => -75.0
- ( 7, 0xf0, 3) => -74.5
- (-16, 0xf, 3) => -75.5
- (-16, 0x0, 3) => -76
Hm.
- ( 7, 0xf, 3) => -69.5
- (-16, -0xf, 2) => -69.0
- (-16, 0x0, 2) => -84.5
- (-16, 0x2, 2) => -71.0
- (-16, 0x0, 3) => -70.0
- ( 7, 0x0, 2) => -69.5
- (-16, 0x0, 2) => -84.5
Maybe unplug, plug, install, run?
- ( -2, 0x0, 2) => -84.5
- ( -2, 0x0, 1) => -71.5
- ( -2, 0x0, 2) => -
- ( 2, 0x0, 2) => -