Speccy with labels

I messed around with “speccy” a bit today to see what I could do with it to make it look slightly nicer. It really needed a grid so one can more easily see the frequencies and power levels. So now it looks like this:

(This is with iperf running on channel 6 to a nearby AP).

I have in mind a couple of other visualizations. An obvious one is to show the overall max or average power level rather than a scatter plot. This would be a cleaner display, although there could be co-channel interference sources you wouldn’t see that way. Here’s a first cut at that:

I am doing some averaging for multiple (~8) samples with the same subcarrier frequency, but clearly more smoothing is needed. Also I notice that I occasionally get some artifact where all the subcarriers have the exact same power level. Not sure what that is, but it wants filtering.

Another interesting visualization would be a scrolling chart of frequency vs time, with power level indicated by pixel intensity. Then you could get an idea of historical changes in the medium. (Oh hey, the neighbors are watching Netflix now.)

The code is still an ugly pile of hacks, which it will probably continue to be until I decide just what kind of processing needs doing on the raw samples. Sorry for that.

August 31, 2015 · bob

VHT mesh

…is a thing now.

# iw dev
phy#0
    Interface wlan0
		ifindex 4
		wdev 0x1
		addr 30:b5:c2:fb:34:d8
		type mesh point
		channel 149 (5745 MHz), width: 80 MHz, center1: 5775 MHz

# iperf -c 192.168.1.20
------------------------------------------------------------
Client connecting to 192.168.1.20, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.21 port 34175 connected with 192.168.1.20 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   148 MBytes   124 Mbits/sec

July 14, 2015 · bob

DWM-W034 UART

In response to my previous post about UART access on the Alfa AWUS036NHA, I got a nice email from Jim Ewing about the DWM-W034, an ath9k_htc device that apparently is embedded inside HDTVs and readily available for $10. He found the TX/RX pins on the board, and it looks like it would be a bit easier to put a socket on one of these compared to the Alfa since there are no pesky chips nearby.

With his permission, and so that this information doesn’t get lost to the sands of time, here’s the pic he sent me. Enjoy!

May 15, 2015 · bob

Reserialized

I got a shiny new device today and the first thing I did was crack it open and heat it to 680 degrees. A good feeling.

The device in question is an ath9k_htc USB wifi dongle. A colleague suggested this one has an easy to access UART because they brought out the TX/RX pins out from the SoC to dedicated pads. He and I apparently have different definitions for “easy.” Unlike the TP-Link routers which give you through-holes to work with, these are simply SMT pads, and they are tiny in comparison. My soldering iron tip is at least double the size of the pad. Yes, it is somewhat better than trying to solder directly to the pins on the SoC, but not by a whole lot.

As it happens, this is my first attempt at soldering SMT. What could go wrong?

Because the pads are small I used some wire-wrap wire (30 gauge? All I know is that it’s at least two stops smaller than the smallest hole on my wire stripper: getting insulation off was “fun”). During my comedic attempts at getting the wires stuck in the right places, I managed to completely obliterate one of the two pads. Luckily, the one I screwed up was the RX pin, which I don’t really need or care about. Having got the TX and ground wires (badly) soldered in place, I made a some circumspect passes with the magnifying glass and continuity tester to convince myself there were no shorts.

Even so, I am as surprised as you are that it actually worked when I turned it on the first time. And the wifi still works too.

==>[cUSB_REQ_COMP]: 0x%08x
VendorCmd: DownloadComplete!
1. usb only!!
 A_WDT_INIT()
 ==>warm start<==
ALLOCRAM start 0x50d80c size 106484
Enable Tx Stream mode: 0x367
USB mode: 0xf
[+++Magpie_init]
[+++VBUF_init(100)]
[+++VBUF_init(100)]
: Attaching the driver
: Vendor id 0x168c Dev id 0x24
ath_pci_probe 24
 ath_hal = 0x00510928

        =>[dnQ] 0x0050f288
[       =>[upQ] 0x0050f264
[       =>[hp dnQ] 0x0050f240
[       =>[mp dnQ] 0x0050f21c
[Tgt running]

May 10, 2015 · bob

mesh on ath10k

I’ve had my ath10k AP (TP-Link Archer C7 v2) since last October or so, with the goal of having a VHT-capable device with which to test (currently non-existent) VHT mesh. Unfortunately, for nearly all of that time, I’ve been stuck on a firmware crash shortly after bringing up the device. Not that I’ve spent a whole lot of time on it, but there’s only so much one can do when getting to the point of “firmware crashes and it has something to do with peers but that’s all I know and I don’t have the time, tools, or code to dig deeper.”

I think there’s some variant on rubber duck debugging where you complain publicly about some issue, and doing that makes you think about it more, and then the way forward is magically revealed. That, plus some helpful hints from the residents of the ath10k ML, got me over the hump, so now it works!

Next up, finding a spare mini PCIe slot for the other ath10k device I have, and getting the VHT bits done…

April 28, 2015 · bob

On Reddit

My lowly internet outpost wound up at the top of /r/programming on Reddit over Easter weekend due to my silly goto-in-bash hack. It turns out that that one page is probably the most searched-for out of anything on my website. There are a lot of frustrated shell programmers out there.

Regarding the critiques from the discussion, comments of the form “you’ve an X/Y problem” were least interesting to me. Yes, I know about Makefiles. Sometimes it is fun to do something different, which is known to be far from a best practice, just because one can.

Comments that improved my sed syntax, or provided a historical context, were most interesting. For the record: no, I didn’t intend to use branching in sed as a self-referential nod to the topic du jour, but I like pretending that I was that clever instead of the reality, which is that I just didn’t know the right sed magic. So, I’ll keep the branching.

See if you can spot the traffic spike:

April 14, 2015 · bob

Scoped

G# I have this more-expensive-than-my-car hunk of metal on loan for the next few weeks. It’s a pretty far cry from the old Tektronix analog scopes I trained on back in the day (which, at the time, were also much more expensive than my then-primary mode of transportation: shoes). As a warmup exercise, I hooked it up to the output of my guitar amplifier and played an A, which you can see pictured. You can also see that I’m apparently tuned down a half-step as the frequency measured on the scope is about a semitone shy of 220 Hz.

Making waves This was a neat teaching opportunity for my four year-old: I showed Alex visually that sound is just made up of different kinds of waves. Later at bathtime he connected that with the physical waves he was making in the tub: “Just like music!” he said.

March 26, 2015 · bob

serialized

router += serial My ath10k-based router now has serial headers, after I managed to crash it a few times over the weekend while testing out some patches. Thank you, TP-Link, for making the pins so easily accessible, to the extent that it’s easier to whip out the soldering iron than remind oneself how to setup kexec/kdump.

I do need to get one of these nifty usb-serial cables so that the JTAG ribbon cable + FTDI-breakout-on-a-breadboard monstrosity can go back into the parts bin, but it is working fine otherwise. [The pictured 7-segment display and TTL chips are just misdirection, by the way.]

There was a momentary bit of confusion on my part when the console showed the router stuck in a loop requesting recovery firmware over TFTP instead of the normal boot process…until I realized that the reset button was wedged in the depressed state by the case. Whoops.

February 20, 2015 · bob

website rebuilt

Until recently, my vhost was running some ancient Ubuntu that was probably vulnerable to all manner of things, so I’ve finally upgraded it to a recent Debian release. A few things are still offline (including the blog theme) so there may be some broken links here and there for a few days until I get around to restoring everything.

I believe I’m going to leave comments off permanently going forward, there’s just too much spam even with it moderated, to the extent that I almost never bother to go through them. Comments out-of-band are always welcome, of course.

January 12, 2015 · bob

Spectrum

The ath9k and later chips support a spectral scan feature for measuring channel occupancy. I played with it for the first time last week over the Thanksgiving holiday. Simon Wunderlich’s FFT_eval is a great tool to look at the captured RF spectrum, but I found myself wanting something more real-time, and the various other things I found on github with that aim didn’t work for me. So, this too-ugly-to-live python hack happened.

It turns out that the samples are rather coarse and infrequent, so the result is not as dynamic as I’d hoped. However, I made the pretty heatmap below with a few hours’ worth of samples, and although I didn’t yet label frequencies, you can see a couple of channels in active use. There’s still plenty of room for improvement in the visualization.

December 1, 2014 · bob