0.0.g version

PREREQS

First, you need a driver for your Wi-Fi NIC that supports monitor mode. It's supposed to return frames in wlan_ng format. 

For example acx100 does that. There is one bug in acx100 driver - it returns nose in signal field and vice versa. 
Change idma.c file of acx100 open source driver to fix it. Or change sniffer.c to accept value of the noise field of wlan_ng header.

This particular release was used on WRTSL54GS Wi-Fi router running OpenWrt linux distribution. It does not have an open source
wireless driver, but Broadcom's binary driver supplied with it supports monitor mode and conviently reports frame headers in wlan_ng format.
Another advantage is that the Broadcom driver creates additional prism0 interface to allow access to monitor data, at the same time
keeping main eth2 interface in operational mode.

Second, you need to dowload and install libpcap.

And third, you lickly need wireless tools to configure your NIC and put it in monitor mode.


COMPILATION

Edit INCLUDE and SNIF_LIBS in makefile to point to correct libpcap locations.
Run make.

Visit OpenWrt site for instructions on how to set crossplatform of native development environment:
http://wiki.openwrt.org/BuildingPackagesHowTo?highlight=%28HowTo%29

RUN

ACX100
Load you NIC driver (insmod acx100_pci.o debug=0x01 firmware_dir=/lib/modules/acx100_frmwe for example).
Config you wireless parameters (iwconfig wlan0 cannel 6 etc.).
Bring up you interface (ifconfig wlan0 192.168.0.10 for example).
Put your NIC in monitor mode (iwpriv wlan0 1 6).

WRTSL54GS Broadcom 
Put your NIC in monitor mode (iwpriv eth2 set_monitor 1).


1.
Run sniffer <interface> <timeout> < <infile> > <outfile>, 
where <timeout> is the time the sniffer exits after, <infile> is the saved <outfile> from previous run or just empty file for the first run, 
<outfile> is the file where sniffed Wi-Fi nodes will be printed out.
Data from old run(s) in <infile> will be used for a new mean and deviation calculations for the corresponding MACs,
unless they were used for calibration or distance between transmitter and receiver was calculated using 'radius' utility.
If you do not want to reuse old data, specify --dyn option.
If you know coordinates of the receiver, specify them in --xr and --yr options.
If you know coordinates of a transmitter, specify its MAC in --mact <AA:BB:CC:DD:EE:FF> option and coordinates in --xt and --yt options.

2. 
Run calibr < <infile> > <outfile>.
It will calculate and update parameters of attenuatinon functions, approximated by calibration data, type will be updated also. 
If you need to update/add transmitters' coordinates, use the same --mactx, --xt and --yt options as for sniffer.

3.
Run radius < <infile> > <outfile>.
Make sure there is at leas one calibrated record of the environment from calibr's output file.
Specify what attenuation function you want to use to calculate distance between transmitter and receiver: 
--k for S=S0-20LogR-10kRlog(e),
--n for S=S0-10nLogR.
Default is --k.
If you need to update/add transmitters' coordinates, use the same --mactx, --xt and --yt options as for sniffer. 

4.
Run dgraphgen < <infile> > <graphfile> with --[sigma,sigma2,power,powern,epowern,powerk,epowerk,powerc,epowerc,er,sigmar] options to create data files 
for density diagrams to feed in webMatematica plotter. For example via http://cose.math.bas.bg/webMathematica/MSP/Sci_Visualization/Contour3DDataPlot interface.

5.
Run triangle or brute or rod < <infile> 1> 2> <summaryfile>. Programs will try to triangulate location of all receivers and transmitters if data for the triangulation 
is sufficient. 'trinagle' uses full set of data, 'brute' searches for 3 best (minimal preducted located deviation is used as a criterion) anchors using brute fource,
'rod' searches for 3 best anchors using ROD algorithm. Use --noc option to exclude calibration records from calculation. It's more important for receiver location.
Use --rx or --tx tp calculate onl receivers' or transmitters' coordinates. Default is both.
are available. Type of the record with calculated transmitter locations will be incremented by 0x4 and for receiver locations by 0x8.