-->
Page 1 of 2

Question regarding Wifi.RSSI()

PostPosted: Mon Jan 30, 2017 11:22 am
by tomte76
Hi,

in my sketch I use

long rssi = WiFi.RSSI();

to get the RSSI of the actual connection in STA mode. This seems to work ok from time to time but sometimes I get a positiv value. Please find the attached grafana chart. As far as I understand RSSI this should not happen? I expected the RSSI range to rearch from -100 to 0. Did I get something wrong? Can someboby point me in the right direction to understand the problem? Or fix it, if it is an error.

Thank you.

Re: Question regarding Wifi.RSSI()

PostPosted: Mon Jan 30, 2017 12:38 pm
by torntrousers
I've used Wifi.RSSI() and never seen it return a postive value. (Here's one publishing it the last 24 hours with only negative values).

Maybe a code bug? It returns int32_t not long, maybe thats it?

Re: Question regarding Wifi.RSSI()

PostPosted: Mon Jan 30, 2017 2:35 pm
by piersfinlayson
The SDK (which I assume the Arduino code is calling) documents the wifi_station_get_rssi(void) function thus:

Code: Select allReturn:
31  fail invalid value.
others succeed value of rssi, in general, rssi value < 10


The positive values on your graph looks suspiciously close to 31 to me.

Re: Question regarding Wifi.RSSI()

PostPosted: Tue Jan 31, 2017 8:37 am
by tomte76
Thank you. That is indeed the case. I returns 31, which is the error-code. I promise to RTFM the next time before I ask :D I'll have a look why the call fails. Maybe it is a timing issue. Or I'll just repeate querying the RSSI until I don't get "31".