Thursday, June 21, 2012

WiFi at One Kilometer

Introduction

Today I tried an experiment to see how far I could get useable WiFi signals. I made something called a cantenna, which is a type of home made directional antenna. I also used an external WiFi adaptor with a removable SMA antenna jack (so I could hook my antenna into it).

Pictured are my two main peripherals, on the left was the cantenna I made out of a Bushes Baked Beans can. I designed it based on some very useful instructions on turnpoint.net. On the right is my wireless adaptor. It's the engenius wireless 11n, fortunetly it uses the rtl8188su chipset, which has drivers for Linux. 

Setup

Of course, when doing this experiment, I wanted to ensure that I could get the best reception possible. 

Pictured above, my router sits on top of a ladder in the front of my yard. This was to make sure that I had as close to line of sight as I could get. My router isn't anything special, just a Rosewill n150 WiFi router. 

For my set up in the field, I carried with me my laptop, a table and my peripherals.

Experiment

In this experiment I observed ping times and packet losses, from pining the router, at five locations from the router. I used both the omni-direction high gain antenna that came with the adaptor and the cantenna I made to compare their ping times.

Location 1

Location 1 was 587 feet away from the router.

The ping output using the omni-direction antenna was:
16 packets transmitted, 16 received, 0% packet loss, time 15016ms
rtt min/avg/max/mdev = 0.815/3.236/19.571/4.490 ms
No packet loss (which is good).

The ping output using the cantenna was:
16 packets transmitted, 15 received, 6% packet loss, time 15030ms
rtt min/avg/max/mdev = 0.921/4.787/41.169/9.755 ms
Ouch, a packet loss. So early in the game and already the directional antenna is doing worse than the omni-directional one.

Location 2

Location 2 was 1,365 feet away from the router.

The ping output using the omni-direction antenna was:
17 packets transmitted, 16 received, 5% packet loss, time 16032ms
rtt min/avg/max/mdev = 2.249/9.219/49.795/11.473 ms
Looks like the omni-directional lost a packet this time.

The ping output using the cantenna was:
17 packets transmitted, 17 received, 0% packet loss, time 16025ms
rtt min/avg/max/mdev = 1.340/3.313/15.711/3.280 ms
Looks like the cantenna is doing better no packet loss, its average response time is also about three times lower too. Maybe location 1 was just a slight hickup.

 Location 3

Location 3 was 1,987 feet away from the router.

The ping output using the omni-direction antenna was:
17 packets transmitted, 15 received, 11% packet loss, time 16021ms
rtt min/avg/max/mdev = 1.547/13.897/41.956/12.821 ms
That's much more significant packet loss than before, response time is also up by about 4 milliseconds too.

 The ping output using the cantenna was:

17 packets transmitted, 17 received, 0% packet loss, time 16026ms
rtt min/avg/max/mdev = 1.520/12.951/71.046/16.841 ms
No packet loss, and average response time is a bit quicker than the omni-directional antenna.

Location 4

Location 4 was 2,968 feet away from the router. 

At this point, I was unable to use the omni-directional antenna to get a signal. Its max ranges seems to be between two and three thousand feet. 

But the cantenna still worked. 

The ping output using the cantenna was:
17 packets transmitted, 16 received, 5% packet loss, time 16031ms
rtt min/avg/max/mdev = 3.760/15.199/48.870/12.584 ms
Not too bad for over a half mile. At this distance I was still able to stream 360p youtube videos. Look at the output of the network history graph.

Location 5

Location 5 was 3289 feet away from the router.

This seems to be the last place I was able to get a signal of any sort. I was on top of a hill for this one (which was the only place where I could get a line of sight path to the router at this point).

The ping output using the cantenna was:
16 packets transmitted, 16 received, 0% packet loss, time 15023ms
rtt min/avg/max/mdev = 3.523/12.998/44.225/11.653 ms
This was a kilometer away from the router. I don't think this is too bad. I would have tried to go out further and see if I could find another hill or ridge to get on top of, but by this point I was tired of walking in the desert. I'll save extended range tests for another day.

Conclusion

I was able to attain a usable WiFi signal, a kilometer away from a router, using either commercially available products or home made equipment that can be acquired for under $100.

I'm sure I could push the range even further in the right environment. 1 kilometer was the furthest distance I could get a dependable line of sight connection. As long as you can achieve a line of sight path between the receiver and the router, who knows how far you can achieve reception?

High range line of sight WiFi has many applications. It can be used in highly dispersed computer networks over large desolate areas where a conventional wired network would be unfeasible. I'm also intrigued with the possibility of using this for something like remote controlled aircraft. The range should be sufficient for a small model aircraft, and if enough bandwidth can be procured you could even do things like provide a live 720p video stream from the aircraft or provide what ever kind of sensor data you can think of.

Wednesday, June 20, 2012

Porting Data Sanctuary

A friend of mine recently released a top down shooter called Data Sanctuary. Although the only playable file he made was a Windows binary, he also released the source code. I spent part of my day using it to port it over to Mac.


You can download the Mac version of the game here. Be careful when you're playing it, things can quickly get tense if you're not careful.

Note: Make sure you have a decent graphics card or you will have very choppy frame rates.