wifi signal levelstrength wifi 多少稳定

ZigBee网络中基于多信道的WiFi干扰避免方法,信道避免干扰,zigbee wifi 干扰,wif..
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
ZigBee网络中基于多信道的WiFi干扰避免方法
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer--144.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口3基于WiFi信号强度特征的室内定位系统设计_图文_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
3基于WiFi信号强度特征的室内定位系统设计
上传于||暂无简介
阅读已结束,如果下载本文需要使用
想免费下载本文?
下载文档到电脑,查找使用更方便
还剩3页未读,继续阅读
你可能喜欢How to convert Wifi signal strength from Quality (percent) to RSSI (dBm)? - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
How should I convert Wifi signal strength from a Quality in percentage, usually 0% to 100% into an RSSI value, usually a negative dBm number (i.e. -96db)?
Wifi Signal Strength Percentage to RSSI dBm
Microsoft defines Wifi signal quality in their
structure as follows:
wlanSignalQuality:
A percentage value that represents the signal quality of the network.
WLAN_SIGNAL_QUALITY is of type ULONG. This member contains a value
between 0 and 100. A value of 0 implies an actual RSSI signal strength
of -100 dbm. A value of 100 implies an actual RSSI signal strength of
-50 dbm. You can calculate the RSSI signal strength value for
wlanSignalQuality values between 1 and 99 using linear interpolation.
RSSI (or "Radio (Received) Signal Strength Indicator") are in units of 'dB' (decibel) or the similar 'dBm' (dB per milliwatt) (See ) in which the smaller magnitude negative numbers have the highest signal strength, or quality.
Therefore, the conversion between quality (percentage) and dBm is as follows:
quality = 2 * (dBm + 100)
where dBm: [-100 to -50]
dBm = (quality / 2) - 100
where quality: [0 to 100]
Pseudo Code (with example clamping):
// dBm to Quality:
if(dBm &= -100)
quality = 0;
else if(dBm &= -50)
quality = 100;
quality = 2 * (dBm + 100);
// Quality to dBm:
if(quality &= 0)
dBm = -100;
else if(quality &= 100)
dBm = -50;
dBm = (quality / 2) - 100;
Check the definition of Quality that you are using for your calculations carefully. Also check the range of dB (or dBm). The limits may vary.
Medium quality:
= (50 / 2) - 100
Low quality:
= 2 * (-96 + 100)
7,90052648
In JS I prefer doing something like:
Math.min(Math.max(2 * (x + 100), 0), 100)
My personal opinion is that it's more elegant way to write it, instead of using if's.
From experience:
Less than -50dB (-40, -30 and -20) = 100% of signal strength
From -51 to -55dB= 90%
From -56 to -62dB=80%
From -63 to -65dB=75%
The below is not good enough for Apple devices
From -66 to 68dB=70%
From -69 to 74dB= 60%
From -75 to 79dB= 50%
From -80 to -83dB=30%
Windows laptops can work fine on -80dB however with slower speeds
Im glad I found this post cause I was looking for a way to convert the dbm to percentage. Using David's post, I wrote up a quick script in python to calculate the quality percentage.
#!/usr/bin/python
cmd = "iwconfig wlan0 | grep Signal | /usr/bin/awk '{print $4}' | /usr/bin/cut -d'=' -f2"
strDbm = os.popen(cmd).read()
if (strDbm):
dbm = int(os.popen(cmd).read())
quality = 2 * (dbm + 100)
print("{0} dbm = {1}%".format(dbm, quality))
print("Wifi router connection signal strength not found")
In order to get the highest wifi quality from where my computer is located, I moved/rotated my antenna until I received the highest quality. To see real time quality, I ran the above script using:
watch -n1 "python getwifiquality.py"
please read the link for some more info
RSSI is an indicator and RSS is the real value. Ok, now what do you mean by indicator, indicator mean it can be a relative value and RSSI is
always a positive value and there is no unit for the RSSI.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
The week's top questions and answers
Important community announcements
Questions that need answers
By subscribing, you agree to the
Stack Overflow works best with JavaScript enabledpublic classWifiManagerextends&Objectjava.lang.Object&&&?android.net.wifi.WifiManager类概述This class provides the primary API for managing all aspects of Wi-Fi connectivity. Get an instance of this class by calling&Context.getSystemService(Context.WIFI_SERVICE). It deals with several categories of items:The list of configured networks. The list can be viewed and updated, and attributes of individual entries can be modified.The currently active Wi-Fi network, if any. Connectivity can be established or torn down, and dynamic information about the state of the network can be queried.Results of access point scans, containing enough information to make decisions about what access point to connect to.It defines the names of various Intent actions that are broadcast upon any sort of change in Wi-Fi state.This is the API to use when performing Wi-Fi specific operations. To perform operations that pertain to network connectivity at an abstract level, use&ConnectivityManager.摘要嵌套类classWifiManager.MulticastLockAllows an application to receive Wifi Multicast packets.&classWifiManager.WifiLockAllows an application to keep the Wi-Fi radio awake.&常量StringACTION_PICK_WIFI_NETWORKActivity Action: Pick a Wi-Fi network to connect to.intERROR_AUTHENTICATINGThe error code if there was a problem authenticating.StringEXTRA_BSSIDThe lookup key for a String giving the BSSID of the access point to which we are connected.StringEXTRA_NETWORK_INFOThe lookup key for a&NetworkInfo&object associated with the Wi-Fi network.StringEXTRA_NEW_RSSIThe lookup key for an&int&giving the new RSSI in dBm.StringEXTRA_NEW_STATEThe lookup key for a&SupplicantState&describing the new state Retrieve with&getParcelableExtra(String).StringEXTRA_PREVIOUS_WIFI_STATEThe previous Wi-Fi state.StringEXTRA_SUPPLICANT_CONNECTEDThe lookup key for a boolean that indicates whether a connection to the supplicant daemon has been gained or lost.StringEXTRA_SUPPLICANT_ERRORThe lookup key for a&SupplicantState&describing the supplicant error code if any Retrieve with&getIntExtra(String, int).StringEXTRA_WIFI_STATEThe lookup key for an int that indicates whether Wi-Fi is enabled, disabled, enabling, disabling, or unknown.StringNETWORK_IDS_CHANGED_ACTIONThe network IDs of the configured networks could have changed.StringNETWORK_STATE_CHANGED_ACTIONBroadcast intent action indicating that the state of Wi-Fi connectivity has changed.StringRSSI_CHANGED_ACTIONThe RSSI (signal strength) has changed.StringSCAN_RESULTS_AVAILABLE_ACTIONAn access point scan has completed, and results are available from the supplicant.StringSUPPLICANT_CONNECTION_CHANGE_ACTIONBroadcast intent action indicating that a connection to the supplicant has been established (and it is now possible to perform Wi-Fi operations) or the connection to the supplicant has been lost.StringSUPPLICANT_STATE_CHANGED_ACTIONBroadcast intent action indicating that the state of establishing a connection to an access point has changed.One extra provides the new&SupplicantState.intWIFI_MODE_FULLIn this Wi-Fi lock mode, Wi-Fi will be kept active, and will behave normally, i.e., it will attempt to automatically establish a connection to a remembered access point that is within range, and will do periodic scans if there are remembered access points but none are in range.intWIFI_MODE_SCAN_ONLYIn this Wi-Fi lock mode, Wi-Fi will be kept active, but the only operation that will be supported is initiation of scans, and the subsequent reporting of scan results.StringWIFI_STATE_CHANGED_ACTIONBroadcast intent action indicating that Wi-Fi has been enabled, disabled, enabling, disabling, or unknown.intWIFI_STATE_DISABLEDWi-Fi is disabled.intWIFI_STATE_DISABLINGWi-Fi is currently being disabled.intWIFI_STATE_ENABLEDWi-Fi is enabled.intWIFI_STATE_ENABLINGWi-Fi is currently being enabled.intWIFI_STATE_UNKNOWNWi-Fi is in an unknown state.公有方法intaddNetwork(WifiConfiguration&config)Add a new network description to the set of configured networks.static intcalculateSignalLevel(int rssi, int numLevels)Calculates the level of the signal.static intcompareSignalLevel(int rssiA, int rssiB)Compares two signal strengths.WifiManager.MulticastLockcreateMulticastLock(String&tag)Create a new MulticastLockWifiManager.WifiLockcreateWifiLock(int lockType,&String&tag)Creates a new WifiLock.WifiManager.WifiLockcreateWifiLock(String&tag)Creates a new WifiLock.booleandisableNetwork(int netId)Disable a configured network.booleandisconnect()Disassociate from the currently active access point.booleanenableNetwork(int netId, boolean disableOthers)Allow a previously configured network to be associated with.List&WifiConfiguration&getConfiguredNetworks()Return a list of all the networks configured in the supplicant.WifiInfogetConnectionInfo()Return dynamic information about the current Wi-Fi connection, if any is active.DhcpInfogetDhcpInfo()Return the DHCP-assigned addresses from the last successful DHCP request, if any.List&ScanResult&getScanResults()Return the results of the latest access point scan.intgetWifiState()Gets the Wi-Fi enabled state.booleanisWifiEnabled()Return whether Wi-Fi is enabled or disabled.booleanpingSupplicant()Check that the supplicant daemon is responding to requests.booleanreassociate()Reconnect to the currently active access point, even if we are already connected.booleanreconnect()Reconnect to the currently active access point, if we are currently disconnected.booleanremoveNetwork(int netId)Remove the specified network from the list of configured networks.booleansaveConfiguration()Tell the supplicant to persist the current list of configured networks.booleansetWifiEnabled(boolean enabled)Enable or disable Wi-Fi.booleanstartScan()Request a scan for access points.intupdateNetwork(WifiConfiguration&config)Update the network description of an existing configured network.[展开]继承的方法&来自 class&java.lang.Object常量public static final&String&ACTION_PICK_WIFI_NETWORK引入自:API 级别1Activity Action: Pick a Wi-Fi network to connect to.Input: Nothing.Output: Nothing.常量值:&&android.net.wifi.PICK_WIFI_NETWORK&public static final int&ERROR_AUTHENTICATING引入自:API 级别1The error code if there was a problem authenticating.常量值:&1 (0x)public static final&String&EXTRA_BSSID引入自:API 级别1The lookup key for a String giving the BSSID of the access point to which we are connected. Only present when the new state is CONNECTED. Retrieve with&getStringExtra(String).常量值:&&bssid&public static final&String&EXTRA_NETWORK_INFO引入自:API 级别1The lookup key for a&NetworkInfo&object associated with the Wi-Fi network. Retrieve with&getParcelableExtra(String).常量值:&&networkInfo&public static final&String&EXTRA_NEW_RSSI引入自:API 级别1The lookup key for an&int&giving the new RSSI in dBm.常量值:&&newRssi&public static final&String&EXTRA_NEW_STATE引入自:API 级别1The lookup key for a&SupplicantState&describing the new state Retrieve with&getParcelableExtra(String).常量值:&&newState&public static final&String&EXTRA_PREVIOUS_WIFI_STATE引入自:API 级别1The previous Wi-Fi state.参见EXTRA_WIFI_STATE常量值:&&previous_wifi_state&public static final&String&EXTRA_SUPPLICANT_CONNECTED引入自:API 级别1The lookup key for a boolean that indicates whether a connection to the supplicant daemon has been gained or lost.&true&means a connection now exists. Retrieve it with&getBooleanExtra(String, boolean).常量值:&&connected&public static final&String&EXTRA_SUPPLICANT_ERROR引入自:API 级别1The lookup key for a&SupplicantState&describing the supplicant error code if any Retrieve with&getIntExtra(String, int).参见ERROR_AUTHENTICATING常量值:&&supplicantError&public static final&String&EXTRA_WIFI_STATE引入自:API 级别1The lookup key for an int that indicates whether Wi-Fi is enabled, disabled, enabling, disabling, or unknown. Retrieve it with&getIntExtra(String, int).参见WIFI_STATE_DISABLEDWIFI_STATE_DISABLINGWIFI_STATE_ENABLEDWIFI_STATE_ENABLINGWIFI_STATE_UNKNOWN常量值:&&wifi_state&public static final&String&NETWORK_IDS_CHANGED_ACTION引入自:API 级别1The network IDs of the configured networks could have changed.常量值:&&android.net.wifi.NETWORK_IDS_CHANGED&public static final&String&NETWORK_STATE_CHANGED_ACTION引入自:API 级别1Broadcast intent action indicating that the state of Wi-Fi connectivity has changed. One extra provides the new state in the form of a&NetworkInfo&object. If the new state is CONNECTED, a second extra may provide the BSSID of the access point, as a&String.参见EXTRA_NETWORK_INFOEXTRA_BSSID常量值:&&android.net.wifi.STATE_CHANGE&public static final&String&RSSI_CHANGED_ACTION引入自:API 级别1The RSSI (signal strength) has changed.参见EXTRA_NEW_RSSI常量值:&&android.net.wifi.RSSI_CHANGED&public static final&String&SCAN_RESULTS_AVAILABLE_ACTION引入自:API 级别1An access point scan has completed, and results are available from the supplicant. Call&getScanResults()&to obtain the results.常量值:&&android.net.wifi.SCAN_RESULTS&public static final&String&SUPPLICANT_CONNECTION_CHANGE_ACTION引入自:API 级别1Broadcast intent action indicating that a connection to the supplicant has been established (and it is now possible to perform Wi-Fi operations) or the connection to the supplicant has been lost. One extra provides the connection state as a boolean, where&true&means CONNECTED.参见EXTRA_SUPPLICANT_CONNECTED常量值:&&android.net.wifi.supplicant.CONNECTION_CHANGE&public static final&String&SUPPLICANT_STATE_CHANGED_ACTION引入自:API 级别1Broadcast intent action indicating that the state of establishing a connection to an access point has changed.One extra provides the new&SupplicantState. Note that the supplicant state is Wi-Fi specific, and is not generally the most useful thing to look at if you are just interested in the overall state of connectivity.参见EXTRA_NEW_STATEEXTRA_SUPPLICANT_ERROR常量值:&&android.net.wifi.supplicant.STATE_CHANGE&public static final int&WIFI_MODE_FULL引入自:API 级别3In this Wi-Fi lock mode, Wi-Fi will be kept active, and will behave normally, i.e., it will attempt to automatically establish a connection to a remembered access point that is within range, and will do periodic scans if there are remembered access points but none are in range.常量值:&1 (0x)public static final int&WIFI_MODE_SCAN_ONLY引入自:API 级别3In this Wi-Fi lock mode, Wi-Fi will be kept active, but the only operation that will be supported is initiation of scans, and the subsequent reporting of scan results. No attempts will be made to automatically connect to remembered access points, nor will periodic scans be automatically performed looking for remembered access points. Scans must be explicitly requested by an application in this mode.常量值:&2 (0x)public static final&String&WIFI_STATE_CHANGED_ACTION引入自:API 级别1Broadcast intent action indicating that Wi-Fi has been enabled, disabled, enabling, disabling, or unknown. One extra provides this state as an int. Another extra provides the previous state, if available.参见EXTRA_WIFI_STATEEXTRA_PREVIOUS_WIFI_STATE常量值:&&android.net.wifi.WIFI_STATE_CHANGED&public static final int&WIFI_STATE_DISABLED引入自:API 级别1Wi-Fi is disabled.参见WIFI_STATE_CHANGED_ACTIONgetWifiState()常量值:&1 (0x)public static final int&WIFI_STATE_DISABLING引入自:API 级别1Wi-Fi is currently being disabled. The state will change to&WIFI_STATE_DISABLED&if it finishes successfully.参见WIFI_STATE_CHANGED_ACTIONgetWifiState()常量值:&0 (0x)public static final int&WIFI_STATE_ENABLED引入自:API 级别1Wi-Fi is enabled.参见WIFI_STATE_CHANGED_ACTIONgetWifiState()常量值:&3 (0x)public static final int&WIFI_STATE_ENABLING引入自:API 级别1Wi-Fi is currently being enabled. The state will change to&WIFI_STATE_ENABLED&if it finishes successfully.参见WIFI_STATE_CHANGED_ACTIONgetWifiState()常量值:&2 (0x)public static final int&WIFI_STATE_UNKNOWN引入自:API 级别1Wi-Fi is in an unknown state. This state will occur when an error happens while enabling or disabling.参见WIFI_STATE_CHANGED_ACTIONgetWifiState()常量值:&4 (0x)公有方法public int&addNetwork&(WifiConfiguration&config)引入自:API 级别1Add a new network description to the set of configured networks. The&networkId&field of the supplied configuration object is ignored.The new network will be marked DISABLED by default. To enable it, called&enableNetwork(int, boolean).参数configthe set of variables that describe the configuration, contained in a&WifiConfiguration&object.返回值the ID of the newly created network description. This is used in other operations to specified the network to be acted upon. Returns&-1&on failure.public static int&calculateSignalLevel&(int rssi, int numLevels)引入自:API 级别1Calculates the level of the signal. This should be used any time a signal is being shown.参数rssiThe power of the signal measured in RSSI.numLevelsThe number of levels to consider in the calculated level.返回值A level of the signal, given in the range of 0 to numLevels-1 (both inclusive).public static int&compareSignalLevel&(int rssiA, int rssiB)引入自:API 级别1Compares two signal strengths.参数rssiAThe power of the first signal measured in RSSI.rssiBThe power of the second signal measured in RSSI.返回值Returns &0 if the first signal is weaker than the second signal, 0 if the two signals have the same strength, and &0 if the first signal is stronger than the second signal.public&WifiManager.MulticastLock&createMulticastLock&(String&tag)引入自:API 级别4Create a new MulticastLock参数taga tag for the MulticastLock to identify it in debugging messages. This string is never shown to the user under normal conditions, but should be descriptive enough to identify your application and the specific MulticastLock within it, if it holds multiple MulticastLocks.返回值a new, unacquired MulticastLock with the given tag.参见WifiManager.MulticastLockpublic&WifiManager.WifiLock&createWifiLock&(int lockType,&String&tag)引入自:API 级别3Creates a new WifiLock.参数lockTypethe type of lock to create. See&WIFI_MODE_FULL, and&WIFI_MODE_SCAN_ONLY&for descriptions of the types of Wi-Fi locks.taga tag for the WifiLock to identify it in debugging messages. This string is never shown to the user under normal conditions, but should be descriptive enough to identify your application and the specific WifiLock within it, if it holds multiple WifiLocks.返回值a new, unacquired WifiLock with the given tag.参见WifiManager.WifiLockpublic&WifiManager.WifiLock&createWifiLock&(String&tag)引入自:API 级别1Creates a new WifiLock.参数taga tag for the WifiLock to identify it in debugging messages. This string is never shown to the user under normal conditions, but should be descriptive enough to identify your application and the specific WifiLock within it, if it holds multiple WifiLocks.返回值a new, unacquired WifiLock with the given tag.参见WifiManager.WifiLockpublic boolean&disableNetwork&(int netId)引入自:API 级别1Disable a configured network. The specified network will not be a candidate for associating. This may result in the asynchronous delivery of state change events.参数netIdthe ID of the network as returned by&addNetwork(WifiConfiguration).返回值true&if the operation succeededpublic boolean&disconnect&()引入自:API 级别1Disassociate from the currently active access point. This may result in the asynchronous delivery of state change events.返回值true&if the operation succeededpublic boolean&enableNetwork&(int netId, boolean disableOthers)引入自:API 级别1Allow a previously configured network to be associated with. If&disableOthers&is true, then all other configured networks are disabled, and an attempt to connect to the selected network is initiated. This may result in the asynchronous delivery of state change events.参数netIdthe ID of the network in the list of configured networksdisableOthersif true, disable all other networks. The way to select a particular network to connect to is specify&true&for this parameter.返回值true&if the operation succeededpublic&List&WifiConfiguration&&getConfiguredNetworks&()引入自:API 级别1Return a list of all the networks configured in the supplicant. Not all fields of WifiConfiguration are returned. Only the following fields are filled in:networkIdSSIDBSSIDpriorityallowedProtocolsallowedKeyManagementallowedAuthAlgorithmsallowedPairwiseCiphersallowedGroupCiphers返回值a list of network configurations in the form of a list of&WifiConfiguration&objects.public&WifiInfo&getConnectionInfo&()引入自:API 级别1Return dynamic information about the current Wi-Fi connection, if any is active.返回值the Wi-Fi information, contained in&WifiInfo.public&DhcpInfo&getDhcpInfo&()引入自:API 级别1Return the DHCP-assigned addresses from the last successful DHCP request, if any.返回值the DHCP informationpublic&List&ScanResult&&getScanResults&()引入自:API 级别1Return the results of the latest access point scan.返回值the list of access points found in the most recent scan.public int&getWifiState&()引入自:API 级别1Gets the Wi-Fi enabled state.返回值One of&WIFI_STATE_DISABLED,&WIFI_STATE_DISABLING,&WIFI_STATE_ENABLED,&WIFI_STATE_ENABLING,&WIFI_STATE_UNKNOWN参见isWifiEnabled()public boolean&isWifiEnabled&()引入自:API 级别1Return whether Wi-Fi is enabled or disabled.返回值true&if Wi-Fi is enabled参见getWifiState()public boolean&pingSupplicant&()引入自:API 级别1Check that the supplicant daemon is responding to requests.返回值true&if we were able to communicate with the supplicant and it returned the expected response to the PING message.public boolean&reassociate&()引入自:API 级别1Reconnect to the currently active access point, even if we are already connected. This may result in the asynchronous delivery of state change events.返回值true&if the operation succeededpublic boolean&reconnect&()引入自:API 级别1Reconnect to the currently active access point, if we are currently disconnected. This may result in the asynchronous delivery of state change events.返回值true&if the operation succeededpublic boolean&removeNetwork&(int netId)引入自:API 级别1Remove the specified network from the list of configured networks. This may result in the asynchronous delivery of state change events.参数netIdthe integer that identifies the network configuration to the supplicant返回值true&if the operation succeededpublic boolean&saveConfiguration&()引入自:API 级别1Tell the supplicant to persist the current list of configured networks.Note: It is possible for this method to change the network IDs of existing networks. You should assume the network IDs can be different after calling this method.返回值true&if the operation succeededpublic boolean&setWifiEnabled&(boolean enabled)引入自:API 级别1Enable or disable Wi-Fi.参数enabledtrue&to enable,&false&to disable.返回值true&if the operation succeeds (or if the existing state is the same as the requested state).public boolean&startScan&()引入自:API 级别1Request a scan for access points. Returns immediately. The availability of the results is made known later by means of an asynchronous event sent on completion of the scan.返回值true&if the operation succeeded, i.e., the scan was initiatedpublic int&updateNetwork&(WifiConfiguration&config)引入自:API 级别1Update the network description of an existing configured network.参数configthe set of variables that describe the configuration, contained in a&WifiConfiguration&object. It may be sparse, so that only the items that are being changed are non-null. The&networkId&field must be set to the ID of the existing network being updated.返回值Returns the&networkId&of the supplied&WifiConfiguration&on success.&Returns&-1&on failure, including when the&networkId&field of the&WifiConfiguration&does not refer to an existing network.
无相关信息

我要回帖

更多关于 ipadwifi不稳定 的文章

 

随机推荐