wmi script to display signal strength

Have a question or want to start a discussion? Post it! No Registration Necessary.  Now with pictures!

Threaded View


I couldn't get Netstumbler to work with some of my cards and dongles
so I did some searching on the net and learned that a wireless card's
signal strength is available as a WMI (Windows Management
Instrumentation) value. So I put together this quick and dirty script
that gives a continuous real time display of received signal strength
for an active wireless connection. It's worked with all my clients,
even ones that don't work under Netstumbler. I'm posting it here
thinking that maybe someone else will find it useful. Perhaps someone
will suggest improvements too.

To use the script, just paste the text below into an editor like
Notepad and save it with the name bjs555monitor.vbs. Then open a
command window and navigate to the folder where you saved the script.
Start the script by typing cscript bjs555monitor.vbs. Stop it with
Ctrl + C. If you try to run it outside of a command window, it will
work, but you'll only get updates when you press OK and you'll have to
shut it down by pressing Ctrl+Alt+Del and killing the Windows Script
Host task or rebooting. You should be connected to an access point
before you start the script.

Here it is:

'bjs555monitor.vbs
'This script will continuously display the received signal
'strength of an active wireless connection in a command
'window. The update rate is once per second. Start it by
'typing cscript bjs555monitor.vbs at a command prompt.
'Stop it by pressing Ctrl + C. If you paste this script into a
'text editor, just save it with the name bjs555monitor.vbs
'(or anything ending with .vbs) so that Windows will recognize
'it as a vbscript file.
set objSwbemServices = GetObject("winmgmts:\\\\.\\root\\wmi")
do while 1
  set colInstances = objSwbemServices.ExecQuery _
    ("Select * From MSNdis_80211_ReceivedSignalStrength "_
    & "Where Active = True")
  for each objInstance in colInstances
    signal = objInstance.Ndis80211ReceivedSignalStrength & " dBm"
  next
  wscript.echo signal
  wscript.sleep(1000)
loop

I found out something interesing using this script. I have a Linksys
WUSB11v4 radio that I tried it on. When I look at the output, I see
that all readings are multiples of 5 dB. It seems that the Linksys
client doesn't report signal strength with resolution better than 5
dB. The other 2 radios I tried it on (Zonet ZEW2501 and Hawking
HWU54G) both showed readings with resolutions of 1 dB. I'd be
interested in finding out if all Linksys products show only crude
approximations of signal strength.

Bruce

Re: wmi script to display signal strength



Quoted text here. Click to load it

My Linksys WMP54GX mimo PCI adapter shows 1 dB resolutions.  Your script is
less intrusive than Netstumbler for aiming my antenna since it doesn't
interupt Windows Wireless Zero Config.  Cool.  Thanks!

alien



Site Timeline