WiFi.RSSI(); Not updating?

MattS,

Thanks for demo-ing how to find the network enumeration.

I initially started out with your perspective that this was probably some get method and would find an associated set method in the library. However, while investigate the RSSI() function I noticed it calls, and returns the result of "getCurrentRSSI()". This naming convention puzzled me. So, I checked for documentation and comments. The header file describes it as,

    /*
     * Return the current RSSI /Received Signal Strength in dBm)
     * associated with the network
     *
     * return: signed value
     */

... So I believed that I am going to get the current RSSI measurement.

So, to me and I'm assuming the other 5 or so contributors here, it was "automagic" when the old value was not being updated to a "current" measurement by the call to the SPI driver to send the wifi chip a message enumerated as "GET_CURR_RSSI_CMD".

But, like I said, I see your perspective as that is how I started out.

However, I'm not sure how the distinction between an API or OS is salient, because the API is exactly that: an interface. Regardless of valuable resources, the interface should do what it is documented to do, and I'm not sure that I believe it to "return the current RSSI".

Your example is much appreciated. I will play with the function I mentioned using this technique. Thanks again!

n8sbug:
However, I'm not sure how the distinction between an API or OS is salient, because the API is exactly that: an interface. Regardless of valuable resources, the interface should do what it is documented to do, and I'm not sure that I believe it to "return the current RSSI".

I ought to first explain, 'automagical' is a word I use (specifically) to describe code and process which is taken for granted. For example, end users rarely think about all the things which need to happen automatically, before they see a web page in their browser, so it often appears to be somewhat 'magical' to them.

The distinction I was making, is that an O/S is a collection of processes (code which is executing), whereas an API is a collection of functions (code which could be executed).

If you were to dig into how Windows, OSX, iOS etc work with wifi, you would find that between the O/S and the network interface driver, there is a network discovery background service, which periodically polls the wifi hardware in order to maintain the various data structures associated with an access point. End user applications then call API functions to interrogate the structures maintained (automatically) by the O/S. In this way, the O/S provides applications with a layer of abstraction (encapsulation), so application developers don't have to worry about the hardware specific, Layer 2 (data link) stuff.

The costs of abstraction are always, runtime, RAM and power consumption. On a host like a PC or smart phone, which has Ghz of runtime, MB of RAM and potentially Amps of power to draw on, the cost of automating various network services is trivial. On an Arduino with it's Mhz, KB and milli-Amps, the cost of automating just network discovery would be relatively huge, leaving little resource left to do much else.

In the case of the WiFi shield, the distinction between API and O/S is not quite perfect, because the WiFi shield has it's own MCU which is running some code and providing some abstraction. However, the lack of resources can not be escaped and I think it is safe to presume the shield firmware, is mainly concerned with the bare essentials of Layer 2; managing radio transmission and the like.

Your example is much appreciated. I will play with the function I mentioned using this technique. Thanks again!

Happy to help.

I don't know whether this helps but as regards documentation and once again, this is just my view of the World. I always try to remember the English language is quite vague, compared to the programming languages it is used to document.

Has anyone had any luck in sorting this? (after a firmware update)

Wi11,

Read the exchange between me and MattS. For your problem (not the quesiton i posed to the community), his method would be much preferred (no mods to the librarys), though I haven't gotten to playing with it. My method just drops the same call into the library and it will work the same.