Kismet Wireless

Kismet Forums

 

Posted by:abpsoft
Subject:signalbar vs. dBm
Date:21:47:26 01/07/2006

Hi,

I noticed that there is a new signalbar column (though the quality one that used to display SNR seems gone), but in my case (old madwifi that supplies useful dBm values instead of some percentage RSSI rubbish) it just doesn't show anything but fifteen equal signs. This was a simple fix, but the display code for the dBm case didn't work at all. So I tried to fix it. Now signalbar is actually no signal bar but a SNR bar, but that seemed to be the intention of the original code anyway.

BTW, I'd like to replace the power meter (l) with a somewhat more informative channel analyzer (graphing per-channel noise, signal and SNR). Having not seen much of the code yet, I'd just like to ask how complicated that might become. Essentially I need to collect individual noise, signal and decay information per actively scanned channel. Coding the display is just a matter of work, but getting the info is one of structure.

Ah yep, the patch (I can also mail it as the forum is likely to wrap it to death):

--- orig/kismet-2006.04.R1/panelfront_display.cc 2005-08-15 17:52:16.000000000 +0200
+++ kismet-2006.04.R1/panelfront_display.cc 2006-07-01 23:09:12.000000000 +0200
@@ -226,16 +226,20 @@
snprintf(element, 6, "%4ldM", net->datasize/1024/1024);
len = 5;
} else if (colindex == mcol_signalbar) {
- if (net->best_signal > 0) {
+ if (net->best_signal != 0) {
int sx = 0;

// see if it looks like dBm...
if (net->signal < 0 && idle_time < (decay * 2)) {
- // If we have a dB noise level, get the percentage of signal to noise
+ // If we have a dBm noise level, get the SNR and scale
+ // it in a way that makes sense. As SNR_MAX is already
+ // used to saturate in the power meter, do the same
+ // here. SNR_MAX should be 60dB, though.
if (net->noise < 0)
- sx = (int) (double) (net->noise / net->signal) * 15;
+ sx = (int) (double) (net->signal - net->noise) / (SNR_MAX/15);
else
- sx = (int) (double) (100 / abs(net->signal)) * 15;
+ // Assume a noise floor of -96dBm
+ sx = (int) (double) (net->signal - -96) / (SNR_MAX/15);
} else if (idle_time < (decay * 2)) {
// Extract the signal percentage of the best signal seen
sx = (int)((double)(idle_time < (decay * 2) ? net->signal : 0) /
@@ -1455,7 +1459,7 @@
mvwaddstr(kwin->win, 2, 2, "SNR:");
mvwaddstr(kwin->win, 2, 7, bar);

- snprintf(bar, width, "SNR: %ddB, Signal %ddB, Noise %ddB",
+ snprintf(bar, width, "SNR: %ddB, Signal %ddBm, Noise %ddBm",
snr, pwr, nse);

// center it

HTH,
Andre.


Reply to this message