tessel / project

The open source Tessel Project. Start here!
https://tessel.io/
344 stars 69 forks source link

Passing FCC Certification with Tessel 2 #79

Closed tcr closed 8 years ago

tcr commented 9 years ago

Tessel 2 is seeking FCC approval. Tessel 2 runs OpenWRT, a distribution of Linux designed as open firmware for routers with very granular control over wireless capabilities. Currently Tessel 2 is stuck in FCC approval pending its demonstration of being able to generate packets in the 802.11n range.

Testing instructions

Installation on a Tessel 2:

opkg update
opkg install tcpdump
wget https://kevinmehall.net/tmp/packetspammer -O /usr/bin/packetspammer
chmod +x /usr/bin/packetspammer

To configure monitor on wlan0 (this goes away on each reset):

ifconfig wlan0 down
iw dev wlan0 interface add mon0 type monitor
ifconfig mon0 up
iw mon0 set channel 11

To set which transmit mode you want:

iw mon0 set bitrates legacy-2.4 1 2 11 # b
iw mon0 set bitrates legacy-2.4 6 12 24 # g
iw dev mon0 set bitrates ht-mcs-2.4 4 10 # n

# to reset these values:
iw mon0 set bitrates legacy-2.4
iw dev mon0 set bitrates ht-mcs-2.4

Lastly run the packetspammer command, and see if the resulting output is being transmitted at a speed that correlates with the given spec:

packetspammer -d40000 mon0

Output may resemble:

1818:20:58.209712 1.0 Mb/s 2462 MHz 11b -38dB signal [bit 29] 0us 13:22:33:44:55:66
(oui Unknown) Unknown SSAP 0x60 > 13:22:33:44:55:66
(oui Unknown) Unknown DSAP 0x50 Unnumbered, ua, Flags [Response], length 72

Note the "1.0 Mb/s" indicating the output speed (1.0 Mb/s, 802.11g)

Issue

We observe that in spite of the iw dev mon0 set bitrates ht-mcs-2.4 4 10 command, Tessel 2 always transmits at b or g rates.

Possible diagnoses:

  1. Our OpenWRT distribution is old and this has been fixed in a more recent build. We can rebase the OpenWRT build to a newer one.
  2. There is an issue in the MT7620 driver that we must dig into and fix.
  3. ???

    References

Frijol commented 9 years ago

Post on the OpenWRT forums with more details: https://forum.openwrt.org/viewtopic.php?pid=288858#p288858

pastcompute commented 9 years ago

Hi. I'm not an OpenWRT project developer (I only have a couple of patches accepted) , but I have a bit of experience swearing at its build system for my own projects using a similar product I like experimenting with, the carambola2... I saw the article at http://makezine.com/2015/08/27/new-fcc-rules-tessel-2/

Have you been able to make any progress in narrowing down this fault? I had a quick look at this and had a couple of troubleshooting ideas, although as I am not a wireless device expert its pretty much just what I'd do next in this situation:

(1) Post to the openwrt-devel list as well - there seems to be different people there from the forums sometimes : openwrt-devel@lists.openwrt.org / https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

(2) I noticed the mt76 driver has its own git repository at https://github.com/openwrt/mt76 and there seems to be quite active ongoing development, so it should be reasonably painless to patch openwrt to try a newer commit than openwrt itself uses in package/kernel/mt76 - YMMV

(3) Rule out the userspace and mac80211 layer causing interference: add some instrumentation printk into the driver to see if it is actually receiving the rate mask change through the netlink / mac80211 layers or if they are getting filtered by something in between

HTH

Frijol commented 9 years ago

Thanks for the comment @pastcompute ! I think @tcr might have made some progress on this today

pastcompute commented 9 years ago

No worries! Bugs like this seem to draw me in...