Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Getting Wireless Signal Strength / Windows XP

Reply
Thread Tools

Getting Wireless Signal Strength / Windows XP

 
 
williambattersea@gmail.com
Guest
Posts: n/a
 
      02-13-2008
Hello,

I'm looking for a way to get wireless signal strength on Windows XP
with Python. I see there's a library for Linux, but I can't find
anything for windows. However, I see that using WMI I can access it in
theory at least, using a query like "select
Ndis80211ReceivedSignalStrength from
MSNdis_80211_ReceivedSignalStrength where active=true"

(I got this from: http://www.dotnet247.com/247referenc...36/181397.aspx)

I just began playing with the WMI library, but I can't get a hold of
the signal strength.

As far as I can tell, I should be able to get a handle on it with:

import wmi
c = wmi.WMI()

wql = "select Ndis80211ReceivedSignalStrength from
MSNdis_80211_ReceivedSignalStrength where active=true"

o = c.query(wql)

But I get an error.
Traceback (most recent call last):
File "<pyshell#45>", line 1, in <module>
c.query("select Ndis80211ReceivedSignalStrength from
MSNdis_80211_ReceivedSignalStrength where active=true")
File "C:\Python25\Lib\site-packages\wmi.py", line 889, in query
return [ _wmi_object (obj, instance_of, fields) for obj in
self._raw_query(wql) ]
File "C:\Python25\lib\site-packages\win32com\client\util.py", line
83, in next
return _get_good_object_(self._iter_.next())
com_error: (-2147217392, 'OLE error 0x80041010', None, None)

Is this not available to me? Any ideas? Am I going about this in the
wrong way?

Thanks
 
Reply With Quote
 
 
 
 
Tim Golden
Guest
Posts: n/a
 
      02-14-2008
[Somehow got stuck in my outbox... ]

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hello,
>
> I'm looking for a way to get wireless signal strength on Windows XP
> with Python. I see there's a library for Linux, but I can't find
> anything for windows. However, I see that using WMI I can access it in
> theory at least, using a query like "select
> Ndis80211ReceivedSignalStrength from
> MSNdis_80211_ReceivedSignalStrength where active=true"
>
> (I got this from: http://www.dotnet247.com/247referenc...36/181397.aspx)
>
> I just began playing with the WMI library, but I can't get a hold of
> the signal strength.
>
> As far as I can tell, I should be able to get a handle on it with:
>
> import wmi
> c = wmi.WMI()
>
> wql = "select Ndis80211ReceivedSignalStrength from
> MSNdis_80211_ReceivedSignalStrength where active=true"
>
> o = c.query(wql)
>
> But I get an error.
> Traceback (most recent call last):
> File "<pyshell#45>", line 1, in <module>
> c.query("select Ndis80211ReceivedSignalStrength from
> MSNdis_80211_ReceivedSignalStrength where active=true")
> File "C:\Python25\Lib\site-packages\wmi.py", line 889, in query
> return [ _wmi_object (obj, instance_of, fields) for obj in
> self._raw_query(wql) ]
> File "C:\Python25\lib\site-packages\win32com\client\util.py", line
> 83, in next
> return _get_good_object_(self._iter_.next())
> com_error: (-2147217392, 'OLE error 0x80041010', None, None)
>
> Is this not available to me? Any ideas? Am I going about this in the
> wrong way?
>
> Thanks
>


I don't have a machine to test this on at present, but one thing to note
is that the article specifies the WMI namespace (the default is CIMv2),
so at the very least you'd need to do something like this:

import wmi
c = wmi.WMI (namespace="WMI")

Once you've got the namespace, you should be able to use the standard
syntax to query the -- frankly, unwieldy -- WMI class:

for result in c.MSNdis_80211_ReceivedSignalStrength (active=True):
print result.Ndis80211ReceivedSignalStrength

The machine I'm on is Win2k and non-wireless so I don't have the class
available to check.

Hope that helped

TJG

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless Strength Signal Wireless Networking 0 08-18-2005 05:25 AM
J2ME - Getting signal strength information? Daniel Dyer Java 1 04-11-2005 05:51 PM
System Tray Signal Strength -vs- Wireless Properties Strength =?Utf-8?B?U2NvdHQ=?= Wireless Networking 3 04-07-2005 10:17 PM
wireless signal strength =?Utf-8?B?V2lsc29u?= Wireless Networking 4 01-12-2005 12:51 AM
wireless signal strength is really poor? Devin Panchal Wireless Networking 2 07-20-2004 12:40 AM



Advertisments