Wireless Heatmap
python, wirelessheatmapI wrote an application to generate a wireless (802.11) heat map based on signal strength. The reason for it was to find the best place/area (for my laptop) to be with the highest signal strength. Below is a screenshot of the application (with the ESSID and BSSID removed for security reasons).
This heat map has about 100 samples in it, which are shown as white dots. There is a balcony at the top of the image and the common office area on the right, which was drawn by hand (hence the waviness). As you can see it has pinpointed the location of the access point in the red area.
Below is another heat map with the same points but on a different access point.
Even though I don’t have points of data on the neighbour’s office area, the algorithm has worked out the approximate area of the access point.
The application (which is tentatively named “wirelessheatmap”) is written in Python with the OpenGL library, pyglet. It relies on a wireless packet sniffer called airodump-ng from the Aircrack-ng suite of wireless tools. I also had to patch airodump-ng so that it writes the (later explained) CSV (comma-separated values) file more often.
After setting my Wi-Fi device to “monitor” mode, I run airodump-ng, listening on all channels. It writes a CSV file containing the signal strength of all access points from where my laptop is. With the patched version it updates this file every second. While airodump-ng is running, I also run the Python application with an image overlay containing the floor plan for reference.
To map out the points, I simply go to a location, wait a second or two for the signal strength to stabilize and for the CSV file to be updated. In the application, I click on my location on the floor plan map, then the application reads the CSV file along with all of the access point information, then saves the data for the location. I continue collecting points until I have a nice supply of sample points. This creates a mapping of 2D points to signal strength data for every access point.
The way the application generates the heat map is fairly straightforward. It allocates a 2D grid which overlaps the sample area. For each grid position it works out the nearest 10 sample points (or another tweakable number depending on your data), then works out the average signal strength of all the points. I went through several iterations of different methods and this turned out to be the most accurate and best for projection access point locations.
If you want to run this application yourself, the source code is available but is not user friendly, buggy and may require you to know some Python to work out. To start you off run “./heat –help” to see the options. “–image” is the image file you want as the overlay reference map. “–dump” is the airodump-ng CSV file. “–store” is the file that contains the mapping between sample points and access point information.
I may continue this project in the future if there is enough demand for it, but for now it will stay as is.










August 18th, 2008 at 3:25 am
Nice! Definitely package this one up, I’d bet there is a ton of geeky interest in this. There certainly is from me. And I’ve always wondered where that internet signal I’m “borrowing” is coming from
August 18th, 2008 at 3:49 am
This is the most useful new app I have seen in a while. Well done sir.
August 18th, 2008 at 4:23 am
Very cool. What’s the waviness all about see (http://www.reddit.com/comments/6woaj/create_a_map_of_wifi_signal_strengh_with_a/)?
August 18th, 2008 at 5:15 am
Any chance of making a GUI for this so the non-technical can use it? =\
August 18th, 2008 at 5:18 am
[...] cool. This guy wrote an app that essentially saves the signal strength at a given location and then collates the data points into a little map, giving an approximate location of the access point and the places where one finds the best average [...]
August 18th, 2008 at 5:34 am
Hi
I thought this idea was pretty cool so i wanted to give it a try. i set everything up (compiled airodump-ng with the change etc) but when i run it i just get a window with my reference map on it. if i click on the map, nothing happens. I dont get any errors in the console, only the following output:
heatinfo loaded (the store file)
1 stores
{ ‘BSSID OF MY NETWORK’ WeiFei }
do you have any idea what im missing here?
thx in advance
shat
August 18th, 2008 at 10:27 am
This is so awesome, keep up the good work!
August 18th, 2008 at 11:28 am
@idontgetthis,
I just drew some lines in Gimp for the parts of floor plan layout that I didn’t have. I have replied to the reddit post and updated the article to explain what the waviness is.
@Jordan Meeter,
Yes, I am considering making a GUI for it to make it easy for people to use.
@shat,
The “1 stores” message means there is one sample point. Maybe the dot isn’t visible for some reason?
August 18th, 2008 at 12:03 pm
Just stopping by to say that this is really neat
I’m just a casual user, but I’d definitely like a user-friendly version of this application. Nice job!
August 18th, 2008 at 12:04 pm
Just stopping by to say that this is really neat
I’m just a casual user, but I would definitely like a user-friendly version of this application. Nice job!
August 18th, 2008 at 12:25 pm
I’m no longer willing to pay for internet access, but I’m sure as Hell willing to pay good money for such an application! You can have my $29.95 for WinWirelessHeatmap right now!
August 19th, 2008 at 3:37 am
ok i got it to work (somehow my driver always reported the same PWR , this resulted in the program not calculating anything)
however, i encounter massive memory problems when using the script. after 30 Min it has eaten up my whole ram (512 Mb) and 300 mb swap on my laptop.. any idea where that may come from?
August 19th, 2008 at 9:08 am
@shat,
The program isn’t very efficient in storing data in memory–it wasn’t a priority when writing it. It depends on the number of access points available and the number of sample points you’ve made.
August 19th, 2008 at 10:33 am
[...] author has shared his work and development. It’s written with the opengl library pyglet and the source code is [...]
August 20th, 2008 at 1:12 am
[...] How clever! If you ever wanted to know what your 802.11 signal looks like, you can geek it up with a heatmap! Slowchop Studios - Wireless Heatmap [...]
August 20th, 2008 at 9:47 am
Cool! I’ll spend a day playing with this on our hubs.
August 21st, 2008 at 12:04 am
Major points to whomever takes this, adds in reading location from a GPS, and then creates Google Maps overlays from the data.
August 21st, 2008 at 1:19 am
[...] Here’s a cool mapping app you can use to help choose the best place to work in your office. Source code is available. Seems like with a microphone attached, it would be possible to make a noise-level heatmap, then do a weighted overlay. [...]
August 21st, 2008 at 7:42 am
Nice post. One small clarification: the term ‘heatmap’ doesn’t really mean what you think that it does. That is a map of gridded, interpolated wifi signal strength values. Although seriously misused, the term ‘heatmap’ should be used to refer to density maps- i.e. kernel-smoothed estimations of *count* data, like number of things/area. Here is a link to a similar idea, leveraging open source GIS software to overcome memory-related problems.
August 21st, 2008 at 9:18 am
@Dylan Beaudette,
Thanks for the clarification. I had no idea that I was misusing the term “heatmap”. I’ll try to use the proper terminology in the future.
August 21st, 2008 at 4:51 pm
This is one of the most useful apps i’ve seen in quite a while. I’d like to see this expanded upon. two features I’d like to see are a gui and possibly something to interface with a gps. I think gps’ have a drift of a couple of feet so maybe that last ones impossible
August 21st, 2008 at 10:39 pm
Really cool app!!
I’d love to be able to use a user friendly version.
August 22nd, 2008 at 12:08 am
As Randy said this would be one of the most useful apps published lately.
It just need to be packaged up in a more user friendly version!
Great work anyway!
Marcello
August 22nd, 2008 at 1:28 am
@Dylan Beaudette,
I have to say that I find your definition of “heat map” to be rather restrictive. I think the phrase is well suited to the project. It is clear and effective communication. Besides, “A heat map is a graphical representation of data where the values taken by a variable in a two-dimensional map are represented as colors.” is one accepted definition of the phrase.
August 27th, 2008 at 8:33 am
I had a friend do something similar, except without the spectacular heatmap image. He’s checked his code into google code under lewifi.
August 29th, 2008 at 11:27 pm
[...] slowchop.com|thnkx [...]
September 16th, 2008 at 5:46 am
At my school (Olin College), a couple of students mave mapped the entire compus based on wireless signal strengths from various access points. All the data is on a server which will interpolate a position to about room level accuracy based on the strengths. Currently a bunch of students run the client so I can see where they are at any time.
September 18th, 2008 at 7:20 am
You can consider this comment the aforementioned “demand”. Please continue development.
October 5th, 2008 at 12:57 am
[...] Slowchop Studios - Wireless Heatmap [...]
October 16th, 2008 at 6:19 pm
[...] public links >> heatmap Wireless Heatmap Saved by thinkmassive on Tue 14-10-2008 Do you rent or sell? HotPad heat map will show you the [...]
November 11th, 2008 at 10:04 am
[...] Slowchop Studios - Wireless Heatmap (tags: wireless visualization tools todo signal python tool wifi visualisation) [...]
November 17th, 2008 at 7:07 pm
This is a great idea. Kudos man! Hell, I would certainly be willing to purchase this program if it had a GUI. As it is, I still say that you should package it.