[kismac] Re: Signal strength (small bug report, big PS)

  • From: Robin L Darroch <robin@xxxxxxxxxxxxx>
  • To: kismac@xxxxxxxxxxxxx
  • Date: Tue, 28 Feb 2006 23:14:03 +0800

Another possible bug: while gathering data to compare my DWL-122 with my Airport Extreme (active and passive modes), I actually hit a bug which needed a reboot to fix... but I *think* it may be reproducible:

- install one passive driver (e.g. DWL-122)
- tell it to scan only one channel
- quit and relaunch
- click "scan"

I'm pretty sure, with my DWL-122, that killed it. As far as I can tell, if you start scanning the first time with more than one channel, then subsequently scan with only one channel, it's fine... but if the first scan since starting KisMAC is a single-channel scan (at least with a USB Prism2) then it hangs.

Can anyone else reproduce this?


P.S. I think the algorithm in my other message needs a little more work - the Airport Extreme passive mode never seems to report anything less than about 60, which doesn't make sense... so I think we may need to scale both the upper and lower limits. The problem then is where to initialise the values so that the algorithm will work before gathering data and after. Also, it occurs to me that the minimum must be 1, not 0, since 0 is reserved for "no longer picking up this network".


Perhaps:

max_sig = null
min_sig = null

(if already saved, load the above values from the driver prefs)

[on signal received: raw strength = r (must be > 0)]

if (! max_sig) {
        max_sig = r;
        s = 100;
} else if (! min_sig) {
        if (r > max_sig) {
                min_sig = max_sig;
                max_sig = r;
                s = 100;
        } else if (r < max_sig) {
                min_sig = r;
                s = 1;
        } else {
                s = 100;
} else {
        if (r > max_sig) {
                max_sig = r;
                s = 100;
                rescale_previous();
        } else if (r < min_sig) {
                min_sig = r;
                s = 1;
                rescale_previous();
        } else {
                // raw value is in existing min-max range
                s = 1 + 99*(r - min_sig)/(max_sig - min_sig)
        }
}


I think the above pseudo-code should more or less work, and automatically give scaled readouts between 1 and 100 for any adapter in any mode... anyone feel like having a go at implementing it? Naturally the max_sig and min_sig values would need to be saved to the driver prefs record at the end of each scan, and the *raw* strengths for the current network list would need to be kept for the rescale_previous function to work. Not quite sure how we'd handle loaded files yet.
--


-------------------------------------------------------------------------
 Robin L. Darroch - PO Box 2715, South Hedland WA 6722 - +61 421 503 966
      robin@xxxxxxxxxxxxx - robin@xxxxxxxxxxx - robin@xxxxxxxxxxxxx


Other related posts: