Alert.png

Notice: This page contains information for the legacy Phidget21 Library.

Phidget21 is out of support. Bugfixes may be considered on a case by case basis.

Phidget21 does not support VINT Phidgets, or new USB Phidgets released after 2020. We maintain a selection of legacy devices for sale that are supported in Phidget21.

We recommend that new projects be developed against the Phidget22 Library.


Click on the 2phidget22.jpg button in the menu bar to go to the Phidget22 version of this page.

Alert.png

SBC3 Wifi Testing

From Phidgets Legacy Support
Revision as of 22:17, 26 November 2012 by Mwbenedi (talk | contribs)

This page is currently a work in progress

While our current wifi adapters do work well on the SBC, they are, unfortunately, rather slow. And though the speed, or lack thereof, of our current wifi adapter rarely has a notable impact on our projects, it does occasionally raise some issues. So after it started to negatively affect the performance and functionality of one of our recent projects, we sought to find something a little faster and, if possible, more reliable than what we had available.

But finding a fast and reliable wifi adapter isn't always as simple as going to the store and picking up the first thing you see. Most wifi adapters are created to work well with Windows and have very little concern for the select few users that might purchase their product to use with a Linux based operating system, such as the one that runs on the SBC. And though many of these same wifi adapters do work on Linux , the drivers to run them are rarely a shining example of perfection. The developers don't make enough money to justify perfecting the Linux drivers, they only want to get them working, not working well. The end result almost always has a handful of cut-corners and strange bugs popping up from time to time. So, inevitably, finding a fast and reliable wifi adapter means that you're going to have to do some testing yourself.

-About why Wifi testing is important.


-About why Wifi testing is difficult

Wifi testing can be a very difficult thing to do. Wireless signals are not constrained inside a tiny wire, they fly around in the air and bump into walls, people, animals, and even each other. A simple analogy might be to think about sending data across an ethernet cable as if you put a letter on a train in Chicago destined to New York. Unless the train derails, there's a pretty good chance that letter you sent is actually going to get to New York. Whereas sending data wirelessly would be like strapping your letter to a stray dog in Chicago and telling it to go to New York. I don't have the same confidence that your letter is ever going to arrive in New York.

Different wireless protocols developed over the years have come to solve a lot of the issues that you can run into with wireless data transfers, but it's never going to be as simple as sending your data through a cable. Thes protocols need to implemented properly, and the hardware to transmit and receive signals can be very advanced. Small errors can render a device completely inoperable and utterly useless. And while large companies can afford to spend a million dollars, purchase some expensive equipment, hire some professionals, and build a warehouse to properly test every aspect of the devices in question, small companies and home users can't afford to be so lavish. Luckily, we don't have to spend a lot of money to narrow down the list of promising candidates and choose a good wifi adapter.

-About the tools that I used to monitor the wifi devices.

When it comes to wifi testing, there are a number of different tools you can use. When it comes to wifi testing on Linux, that number shrinks... a lot... And when it comes to wifi testing on Linux using only console-based applications, you don't have a lot of options. Fortunately, we don't need a whole lot. The kind of things that I thought were important to test were all things that could be tested with three simple programs.


iperf

This program lets you test bandwidth between two locations over a set amount of time. For all intents and purposes, it forms the backbone of our testing suite. We'll need to have a computer running Linux (preferably connected to our local network with an ethernet cable) in addition to our SBC. This Linux computer is going to be considered our "server".

From our server, two terminal windows and use one of them to SSH into the SBC. On the server, run the command:

iperf -s

And on the SBC, run:

iperf -c [ip address of server] -t 1200

(If you don't know the ip address of the server you can find it by opening a third terminal window and typing: ifconfig )

This will run a 20 minute long test. (you can change the length of the test by increasing or increasing the number 1200 above.) At the end, it will simply tell you the bandwidth over the network. For us, however, this program fills a vital role in flooding the network with signals. If the wifi adapter is going to fail, it's going to fail during a time like this and we're going to be able to see it.


iptraf

This is one of the programs we're going to use to monitor the connection. It has a pretty, colourful interface when you compare it with the other programs we're using and lot's of nice options to monitor different parts of the connection. Personally, I found the "Detailed Interface Statistics" to be the most useful.

You can get a lot of data out of this program, but to be totally honest, I just used it as a way of checking to make sure that the wireless adapter hadn't failed catastrophically. If the numbers stopped changing for a period of time, I assumed that the connection had been completely lost and I took note of it.


watch 'netstat -s | grep retransmited'

This is actually more of a hack than a real program, but it works very well for what it is. By running this command in the terminal, you can see how many packets have been retransmitted since the device has been powered on. This number will update once every two seconds, so you can simply start it up and leave it running. Pay close attention to how many packets have been retransmitted. If the number climbs unexpectedly, you may have a problem with your wifi adapter. Typically, I found that good wifi adapters had 100 or less retransmits over a 20 minute test, while bad wifi adapters had over 1000!

-About the results that I was able to gather immediately after single and multiple tests were completed.

You can experiment by running these tests at different distances and taking note of how the performance is affected. For each wifi adapter I tested, I ran three tests at short range and then three more at the longest range I could reach without having the wireless adapter completely disconnect. During the tests I took note of three things: the average bandwidth, the number of retransmits, and the number of times that the wifi adapter failed catastrophically. (By this I mean that the wifi adapter lost connection with the server.) Depending on how much testing you want to do, you could keep track of other things too, such as minimum bandwidth and maximum bandwidth. However, it's difficult to try and keep track of too many things at once without completely automating the tests, so I tried to gather only the most important data.

In the end, these were some of the results that I gathered from some of the wifi adapters that we purchased:


-About the final conclusion for all the wifi adapters that we tested. (Should I include exact prices here? Probably not. Definitely don't include links to the devices that I tested in the end. It's probably okay to include the actual names of the devices that we tested though. That is, is the names actually exist. It seems like many of the devices didn't even have proper names...)

-Talk about the possibility for anyone to do any of their own testing at home and how they could streamline or automate the process to make it perhaps a little less time consuming.