Friday, November 30, 2012
Full source code, including Arduino shield PCB files are released under GPL and CC-BY-SA licenses.
We are still waiting for the semi-rigid SMA cables (and hoping they will give us a bit better isolation), but even with just the standard double-shielded cable we feel the results are acceptable. Here is a link to some test results using the LANforge WiFIRE test systems (based on ath9k NICs) and the attenuator.
If you have any questions, please send email to: firstname.lastname@example.org
Monday, November 19, 2012
LMR-195 SMA to SMA patch cables, which I am using to connect the AP and Station machines to the attenuator. Per spec, these are >90 dB shielding, and they are shielded with both aluminum foil and a wire braid. But, in some testing, I found that just grabbing the 3 cables and gently lifting them up above the table they were hanging from took the maximum attenuation from around -86 dB to -65 dB. This indicates to me that these cables must be leaking more than expected.
To improve the SMA to SMA patch cable performance, I ordered some new assemblies based on KSR-100 cable to connect the attenuator modules to the faceplate. This cable has an inner aluminum foil shield and standard woven shield on the outside. It claims >90db shielding, and it did seem better. (The attenuator project can now go down to about -86 dB signal, and before it was tricky to go below -82). I now have some supposedly even better SMA to SMA cables on order, for both inside the attenuator and to connect the attenuator to AP and Station machines....
For comparison, here is a smaller diameter single-shielded pigtail that came standard with a pci-e to mini-pci-e adapter card.
So, for now, I'm using 1.32mm coax for the u.fl to SMA pigtails, and have some 670-141 semi-flexible cable, that claims > 100dB shielding....
Tuesday, October 23, 2012
It is actually fairly easy to order SMA to SMA cables that have double-shielded cable, I had just not realized the importance when ordering the previous batch. I put in an order for some cables using KSR-100 cable, which has an aluminium shield as well as woven shield, and claims > 90 dB shielding.
But, that will take a week or two to arrive... I had previously ordered a roll of copper tape, and thought wrapping my existing single-shielded cables with copper tape would add some much needed signal shielding. After a bit of fairly tedious work, all 6 cables were done and back in the attenuator.
I reconnected the AP and Station machines to the attenuator and ran some more tests. Throughput was around 340Mbps at lower attenuation levels, which is great performance. But, even when the attenuator was set to 95 dB attenuation, I still saw signal strength of around -71. This was significantly worse signal leakage than before! I then took some aluminium foil and wrapped the (fanless) AP and Station machines as completely as I could, being careful to crimp it in around the cables. After wasting several yards of aluminium foil, I was disappointed to see that I had at most shaved 1 dB off the leakage. I removed all the foil...
I knew that the SMA to U.fl pigtails inside the AP and Station were also single-shielded, and even thinner than the SMA to SMA cables. So, I took those machines apart and copper-clad those cables a well. While looking closely at the U.fl ends, I noticed that there is a small bit of cable that is without shielding. I tried to wrap this part with copper tape as well. I again connected everything together and ran some more tests. Now the signal level would go a bit lower, around -76 dB with full attenuation. This is still worse than before I copper-clad anything, but at least cladding the U.fl pigtails seemed to help a little.
At this point, I could only assume that adding copper cladding to the cables in the attenuator made them leak more instead of less. Perhaps the small amount of signal that leaks out of the cable shielding is then amplified by the copper tape I had added. I cut open a double-shielded LMR-195 cable and noticed that its foil layer was just under the woven metal shielding (and the woven shielding was under a rubber insulating layer). Maybe that makes all the difference. I removed all the copper clad cables and put the unmodified single-shielded cables back in place.
I directly connected some LMR-195 cables from the AP to the attenuator modules. I had to leave the Station modules using the single-shielded cable since I had only 3 of the correct type of SMA adapters for the LMR-195 cables. This brought total isolation back up to around -80 dB, right around where I started at the beginning of the day!
There are companies (such as rfmall.com) that sell double-shielded SMA to U.fl cables, so I ordered a few sets of pigtails from them. I'll try this all again when the new cables arrive.
In summary: WiFi signal isolation is not trivial. You have to pay close attention to cable types and connector construction, and solutions that appear obvious may actually exacerbate the problem!
Monday, October 8, 2012
Here's the Hunt Script configuration for this run:
The graphs below are two views of the 3D graph that shows the relationship between UDP payload size, WiFi RX-Signal level, and RX-BPS. The test case is an AP connected through the attenuator to a WiFi station system. The test shows that at very low attenuation (less that you would see in over-the-air testing), throughput suffers, and it starts suffering again at around -55 signal quality. Larger PDU sizes help throughput as well, but at least some of that is because the AP system has a fairly weak CPU and was running lots of other processes when this test was running. I still need to work on better RF shielding, so the signal does not go below about -75 dBm.
Friday, October 5, 2012
A few days later, I found time to install the new components in a new aluminium case. Stamping the metal is quite costly, so I did it by hand with a hand punch, drill, and lots of quality time with a 'nibbler' to cut out the rectangular holes for LCD and USB plug. I put the LCD panel hole too low, so it's been hacked a bit and is no longer level. I need to move the attenuator modules closer to the panel mounting holes so that the cables don't have to stretch quite as far too. Will be more careful measuring the next one!
With my new attenuator in hand, I set about trying to test it. I set up two Atom based systems with Atheros 9380 3x3 MIMO wifi adapters. These each have three antenna, and I connected on to each of the attenuator modules. After lots of fiddling around, I had the station uploading to the AP at what I believe is near maximum speed, about 330Mbps UDP throughput. The download speed from AP to Station is only about 230Mbps, but I have not had time to figure out why there is such a discrepancy. I updated our LANforge software to graph the rx-signal and wifi link speed and ran some tests with the Attenuator. The attenuation starts at 20 and is adjusted in increments of 5 up the the max of 95.5. Due to RF leakage in the AP and Station systems, the signal is never completely extinguished, but it does go to about -82 dBm signal, with noise at about -93. It is still able to pass traffic reliably (at lower rates) at this attenuation. Here's a graph of the results. Note that the signal quality is on the left-hand axis, so it is not to scale with the other graph lines. Overall, it seems that the system handled the test well.
Wednesday, October 3, 2012
There did not seem to be any vendors providing affordable attenuators, so we decided to build one ourselves. I quickly settled on the Arduino micro-controller as the brains of the attenuator. There were other interesting systems that could have worked, like the Beagle Board, but the attenuator modules we are using need +5v TTL, and Beagle Board uses +3. I have been very satisfied with the Arduino Mega. After mucking with full operating systems all my professional life, it is a joy to work with such a simple programming environment, and at the same time have the ability to easily
sense and control the physical world.
I ordered the Arduino Mega, Arduino proto shield, starter packs and various other electronic goodies from Adafruit, digikey, local hardware stores, and various other places. The attenuator modules come from Eubus Electronics.
After a few hours of learning curve, I had hello-world working on the Arduino, and shortly after, I had basic functionality controlling the attenuator modules. Next, I needed some useful physical input/output, so I ordered the Arduino LCD shield from Adafruit. It comes with a small set of directional buttons so I could select the different attenuator modules and adjust the attenuation up or down.
Since the Arduino Mega has plenty of pins, and there was some question of heat dissipation when the system is enclosed in a real chassis, I added a simple heat sensor. It has only 3 pins, but I managed to wire it up backwards (+5 to ground, ground to +5). It got hot enough to melt the plastic insulators on the wires and smoke a bit of my fingers before I got it disconnected. Luckily, once I had it wired properly, it seemed to work just fine, so I guess it's one tough sensor.
One problem with the LCD panel is that there is no good way to get access to the buttons through the front panel. We decided to use two rotary encoders (one to select menus, one to adjust values up/down) instead of buttons. It took a while to get the rotary code working properly, much of which probably can be blamed on me not fully understanding the consequences of using pull-up v/s pull-down logic on the encoders. Eventually I got it working, using interrupts and a 2ms de-bounce time.
At this point, I began worrying about how we could manufacture this (in small quantities) reliably. There was quite mess of wires, even with efforts to use ribbon cables where we could, and as working with the Temp Sensor showed, it is way to easy to get pins mixed up. Smoking a $2 sensor is one thing..but the Attenuator modules cost significantly more! After poking around, I found an excellent guide for building your own Arduino Shield. This guide suggests using the Eagle PCB design software, and it seems to work quite well. After a few days of poking around, I had the first revision finished and ready to send off for printing. I used OSH Park, as suggested by the Arduino Shield guide. The price is right, and the web site is simple enough. I've yet to receive the boards, but hope to do so shortly!
Here's a picture of the Rev-0 attenuator project!
Wednesday, November 11, 2009
But, it took hours. It turns out that if you have an extra space in the manifest file, it will not be able to find your main class. Someone should have written some extra debugging in the java and/or jar command to make this much more obvious. Since they did not, hopefully someone will find this page before they waste 3 hours like I did! Another thing: The lines in the manifest file cannot be too long. If they are, it will auto-wrap, but it does a bad job of that too, so be sure to wrap them youself by hand, as I do with Class-Path below. The spaces in front of the jar
files must be there or the manifest will be treated as invalid.
This one works:
iText-2.1.5.jar jfreechart-1.0.13.jar jcommon-1.0.16.jar
jfreechart-1.0.13-swt.jar swtgraphics2d.jar .
This one will not:
iText-2.1.5.jar jfreechart-1.0.13.jar jcommon-1.0.16.jar
jfreechart-1.0.13-swt.jar swtgraphics2d.jar .
It will give an error like:
$ java -jar lfclient.jar
Exception in thread "main" java.lang.NoClassDefFoundError: candela/lanforge/lfclient
Caused by: java.lang.ClassNotFoundException: candela.lanforge.lfclient
at java.security.AccessController.doPrivileged(Native Method)
Could not find the main class: candela.lanforge.lfclient. Program will exit.
Hard to see the difference, eh?