Is there an API, shell command, or AppleScript to get an accurate reading of the current Wi-Fi power in Mac OSX?
FYI I can also open a browser and use JavaScript if it has this value.
What I'm trying to do is test the power of Wi-Fi for different places in my kitchen or living room. I need to check the power of WiFi for every place. If it is low, Iβm moving to a new place. The WiFi bars displayed by OSX don't have enough data for me.
There is a built-in airport team that will do this. This location:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
, .
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
airport -I
http://osxdaily.com/2007/01/18/airport-the-little-known-command-line-wireless-utility/
, , AppleScript, :
set wirelessRSSI to do shell script "airport -I | grep CtlRSSI | sed -e 's/^.*: //g'" set wirelessStrength to (wirelessRSSI + 100) * 2 display notification "Wireless sigal quality: " & wirelessStrength & "%"
Python script, CoreWLAN framework:
CoreWLAN
#!/usr/bin/python from AppKit import CWInterface IFACE = 'en0' NAME = 'MyWifiNetwork' interface = CWInterface.interfaceWithName_(IFACE) results, error = interface.scanForNetworksWithName_error_(NAME, None) for result in results: print 'SSID:', result.ssid() print 'RSSI:', result.rssiValue()
, , OS X , , .
, RF, , - , , , , .
, - , , , . WiFi - , , . , GUI , , , , ( , ).
, - " WiFi A , WiFi B" . , - , , OSI. - , UDP- pingable. , , , UDP , , ( ping ICMP, - , ).
ping
. Finder
/System/Library/CoreServices/Applications
Wireless Diagnostics.app
.
"" ( ) "" :
:
date_string.wdmon
Window menu
Warning users about data collection is good. Thank you for your explicit warning.