-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Question: Is there a way to get the Wifi signal strength ? #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes you can. You can do almost anything with this chip if you dive into their closed source libs. :-) (Its doing almost everything entirely in software.) I don't think you'd even need to go that far though. There appears to be some way that passive mode and the wifi scan are able to grab the RSSI. (You could probably even just use passive mode and only look at AP packets.) |
Does anyone know the method for this? I'm intending to have a 'connected' LED and it would be very useful to have On 29 April 2015 at 16:15, linagee [email protected] wrote:
|
As far as I know, there is currently no way in the Espressif SDK to retrieve the RSSI to the current connected AP. But as @linagee pointed out, it is possible looking at the sources to get the RSSI after a wifi scan, here is a working example: #include <Arduino.h>
#include <ESP8266WiFi.h>
const char* SSID = "YOUR_SSID";
// Return RSSI or 0 if target SSID not found
int32_t getRSSI(const char* target_ssid) {
byte available_networks = WiFi.scanNetworks();
for (int network = 0; network < available_networks; network++) {
if (strcmp(WiFi.SSID(network), target_ssid) == 0) {
return WiFi.RSSI(network);
}
}
return 0;
}
void setup() {
Serial.begin(115200);
}
void loop() {
unsigned long before = millis();
int32_t rssi = getRSSI(SSID);
unsigned long after = millis();
Serial.print("Signal strength: ");
Serial.print(rssi);
Serial.println("dBm");
Serial.print("Took ");
Serial.print(after - before);
Serial.println("ms");
delay(1000);
} Outputting
This is far from clean and ideal, as:
But hey, it works! |
Marvin: On 1 May 2015 at 00:59, Marvin Roger [email protected] wrote:
|
thx to latests SDK ist possible now. |
Can somebody explain to those of us who are less 'techie' how to update the Simple 'step by step' approach appreciated!!! On 25 May 2015 at 12:33, Markus [email protected] wrote:
|
@duncan-a Clarification: updated package with the new SDK is not released yet. Still troubleshooting some bugs. |
OK thanks - even I should be able to manage that!!! Any idea when the update is likely to be released? On 25 May 2015 at 12:51, Ivan Grokhotkov [email protected] wrote:
|
Heyyyy thanks |
you can use
|
ooo my thanks |
its part of the ESP8266 project, you already have it. #include <EPS8266WiFi.h> and then use the functions |
Yes, needed to update my old library I thought this command just uas possible whit at command |
at commands have noting to do with this project :) |
Maybe I get it wrong, but I'd have to pass about 8 arguments ot WiFi.getNetworkInfo(), so I'd have to scan the Network previously anyway? |
you can take a look here: Arduino/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp Line 74 in d108a6e
the arguments are pointer where the information will be stored. basic: |
For those looking for RSSI on the ESP8266's active WifI connection, This is one of the first topics that come up. But the explanations are about RSSI after a (rather time consuming) scan, after the remark "As far as I know, there is currently no way in the Espressif SDK to retrieve the RSSI to the current connected AP". Well, that is no longer true. One can get the RSSI of the active WiFi connection: WiFi.RSSI(). That's all that is needed. |
Are you implying that this is available with a new version of the Expressif If so, for those of us who are not super techie, how does one update the On 30 January 2016 at 16:11, hb020 [email protected] wrote:
|
The SDK is embedded, you don't have to download it yourself... Just download the latest 2.1.0 (not sure it was implemented before), and when connected in STA do |
It is also in 2.0 (stable/master) |
@ marvinroger commented on 1 May 2015: I used the code for a ESP-07(without any antenna) , (onboard antenna only), (external antenna only) and (both antenna's) but I do not see much difference in signal strength, all range between -76dBm and -87dBm, 2129ms. |
Hello everybody Thank you |
Like @Messaoudi0 I am also interested in getting the signal to noise ratio. I need it to get the geolocation with the mozilla location service api. |
Anyone even find if noise or SNR are available ? |
This depends on if running in AP or station mode, but WiFi.RSSI() might be
what you look for.
Check here:
https://github.com/tzapu/WiFiManager/blob/master/WiFiManager.cpp
2016-12-23 20:00 GMT+02:00 Shawn A <[email protected]>:
… Anyone even find if noise or SNR are available ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#132 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALTjCbts_NGJZ_747xbCcfo9S4rkyxFZks5rLAxVgaJpZM4EJwnV>
.
|
if (strcmp(WiFi.SSID(network), target_ssid) == 0) <-- cannot convert 'String' to 'const char*' for argument '1' to 'int strcmp(const char*, const char*)' Can I ask something? I've just try the code, but there is a problem with the datatype. |
Actually, you don't need that anymore. Just call |
I now going to carry out a project with esp8266 module 1 and arduino Uno to measure rssi received by the smartphone. I am confuse about the wiring between esp 8266 and arduino. Wish someone can give me some guidance. |
This is not the place to ask such questions. This is an issue tracker,
meant for tracking issues in the core libs. Please research, there are many
diagrams online.
If you still have questions, please ask at stackoverflow or esp8266.com.
…On Aug 24, 2017 2:21 AM, "byingtan" ***@***.***> wrote:
I now going to carry out a project with esp8266 module 1 and arduino Uno
to measure rssi received by the smartphone. I am confuse about the wiring
between esp 8266 and arduino. Wish someone can give me some guidance.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#132 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQC6BsrC2M3irHkfQDNwzTq4X8ILpWP9ks5sbQh2gaJpZM4EJwnV>
.
|
In order to be able to diagnose connection problem I was wondering if it was possible to get the signal strength via the WiFi API.
I realise this is not available as part of the standard arduino lib, but GSM has something equivalent
The text was updated successfully, but these errors were encountered: