README.txt for Horst Spectrum Analyser patch
David Rowe
Nov 29 2010


Introduction
------------

This patch adds a spectrum analyser feature to horst:

     http://br1.einfach.org/tech/horst/

The goal of this work is to develop a tool for debugging mesh links,
expecially those with interference.  The target platform is the Mesh
Potato, however it also runs on x86 platforms, see the horst READE for
more information.


Installing and Use on a Mesh Potato
-----------------------------------

1. scp "horst" and "horst.sh" to /sbin/usr.  You can download binaries
   from:

     http://rowetel.com/downloads/mp/horst
     http://rowetel.com/downloads/mp/horst.sh

2. Connect to your Mesh Potato via Ethernet.

3. Resize your ssh console to 100 x 30 so all the menus work and
   options appear.

4. Start with:

   $ horst.sh

5. Press n for the SpecAn function, use C-Channel to start scanning.

6. When you have finished make sure you set your Mesh Potato back to
   the channel used for your mesh network:

   $ iwconfig ath0 channel 10

Use on an x86
-------------

See also the horst README.

1. I have a Lenovo X200 laptop with Ubuntu 10, Atheros PCI-E card, and
ath5k driver:

  $ wget http://rowetel.com/downloads/x86/horst
  $ sudo /etc/init.d/network-manager stop
  $ sudo ifconfig wlan1 down
  $ sudo iwconfig wlan1 mode monitor

2. Resize your console to 100 x 30, then:

  $ sudo ./horst -i wlan1 -s

3. To get your Wifi working again:

  $ sudo ifconfig wlan1 down
  $ sudo iwconfig wlan1 mode managed
  $ sudo /etc/init.d/network-manager start

Notes
-----

1. If nothing happens when you press C for the Channel menu make your ssh
console bigger.

2. For stable operation on the Mesh Potato, we need to set a small
capture buffer size, (e.g. -b 50000).  This is included in horst.sh

3. If using the scanning option (-s on the command line, or via C-Channel
menu), you need to connect to your Mesh Potato via Ethernet, as a Wifi
connection won't work if the channel keeps changing.

4. If you don't use the scanning option, it should work over Wifi.
However it may be more difficult to see strong signals on adjacent
channels without scanning.

5. The SpecAn feature filters out (does not display) packets the current
Mesh Node is sending, although you can still see these in main horst
window with a very strong signal (0dBm).

6. We don't just want to see beacon packets carry ESSIDs from AP, we
want to see APs, clients of APs, mesh devices, any wireless device
that is transmitting packets.

7. Low bit rate packets (like beacons) get received quite well on
adjacent channels, I think this is a feature of the 802.11b spread
spectrum modulation.  For very close radios, there is significant
energy at large frequency offsets.

8. BSSID/SRC MACs are truncated to last 4 hex digits to save space


Compiling
---------

Get a copy of horst-git-latest.tar.gz from http://br1.einfach.org/tech/horst/

  $ tar xvzf horst-git-latest.tar.gz
  $ patch -p0 < ../specan.patch
  $ cd horst-git-latest

Edit Makefile for MIPS_PATH for your toolchain location, then:

  $ make

To compile for x86 comment out the Mesh Potato specific lines in Makefile


TODO
----

- low pass filter when not scanning to average out packet signals.
- make pause work
- get it running on Nanostatoons 2 (supernode firmware)
- need a get current channel to set current_channel at start up
- way to automaticaly detect how many channels area available and scan that many

