summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c086da)
raw | patch | inline | side by side (parent: 8c086da)
author | JoW <xm@leipzig.freifunk.net> | |
Mon, 9 Jun 2008 11:27:16 +0000 (13:27 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Mon, 9 Jun 2008 11:27:16 +0000 (13:27 +0200) |
Hi list,
I currently develop an embedded statistics application and web interface
for OpenWrt Kamikaze based on Collectd and RRDTool.
While working with the wireless plugin I noticed some incompatibilities
with different drivers, namely the Broadcom proprietary driver and madwifi.
/proc/net/wireless on Broadcom:
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 18
wl0: 0000 2. 179. 163. 0 0 8040 723 0 0
With the Broadcom proprietary driver you get the actual signal and noise
dbm units by substracting 255 from the values in /proc:
level: 179 - 255 = -76 dBm
noise: 163 - 255 = -92 dBm
/proc/net/wireless on Atheros SoC:
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 22
ath0: 0004 21. -73. -94. 21841 0 0 0 0 0
Madwifi writes the actual dBm values into /proc.
So we have (at least for now) three possible types of values:
( x > 0.0 && x <= 100.0 ) current implementation: x is in percent (?)
( x > 100.0 && x <= 255.0 ) broadcom: range intersects with percents but
values below 100.0 (100.0 - 255.0 = -155.0 dBm)
are somewhat unlikely to occur
( x < 0.0 ) atheros: value is already in dBm
A patch which implements the two additional possibilities in collectd's wireless
plugin can be found in the OpenWrt Trac:
https://dev.openwrt.org/browser/packages/utils/collectd/patches/200-wireless-compat.patch
The patch was made against v4.4.0 of collectd but should work with v4.4.1 too.
It would be nice to have this in the next release or so :)
Greetings,
JoW
I currently develop an embedded statistics application and web interface
for OpenWrt Kamikaze based on Collectd and RRDTool.
While working with the wireless plugin I noticed some incompatibilities
with different drivers, namely the Broadcom proprietary driver and madwifi.
/proc/net/wireless on Broadcom:
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 18
wl0: 0000 2. 179. 163. 0 0 8040 723 0 0
With the Broadcom proprietary driver you get the actual signal and noise
dbm units by substracting 255 from the values in /proc:
level: 179 - 255 = -76 dBm
noise: 163 - 255 = -92 dBm
/proc/net/wireless on Atheros SoC:
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 22
ath0: 0004 21. -73. -94. 21841 0 0 0 0 0
Madwifi writes the actual dBm values into /proc.
So we have (at least for now) three possible types of values:
( x > 0.0 && x <= 100.0 ) current implementation: x is in percent (?)
( x > 100.0 && x <= 255.0 ) broadcom: range intersects with percents but
values below 100.0 (100.0 - 255.0 = -155.0 dBm)
are somewhat unlikely to occur
( x < 0.0 ) atheros: value is already in dBm
A patch which implements the two additional possibilities in collectd's wireless
plugin can be found in the OpenWrt Trac:
https://dev.openwrt.org/browser/packages/utils/collectd/patches/200-wireless-compat.patch
The patch was made against v4.4.0 of collectd but should work with v4.4.1 too.
It would be nice to have this in the next release or so :)
Greetings,
JoW
src/wireless.c | patch | blob | history |
diff --git a/src/wireless.c b/src/wireless.c
index 285fb744748c64714aa7eed8948e2f5b73df73c3..fdea9d3bfdce76af90cc2733636cbe2ce6b2ea43 100644 (file)
--- a/src/wireless.c
+++ b/src/wireless.c
power = 1.0; /* invalid */
else if ((power >= 0.0) && (power <= 100.0))
power = wireless_percent_to_power (power);
- else if (power > 100.0)
+ else if ((power > 100.0) && (power <= 256.0))
+ power = power - 256.0;
+ else if (power > 0.0)
power = 1.0; /* invalid */
/* noise [dBm] < 0.0 */
noise = 1.0; /* invalid */
else if ((noise >= 0.0) && (noise <= 100.0))
noise = wireless_percent_to_power (noise);
- else if (noise > 100.0)
+ else if ((noise > 100.0) && (noise <= 256.0))
+ noise = noise - 256.0;
+ else if (noise > 0.0)
noise = 1.0; /* invalid */
wireless_submit (device, "signal_quality", quality);