Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By alex_g
#66572 Hi

Although up to now I have mainly been a Lua/NodeMCU user, I have also taken up the Arduino IDE for my current project as it's the only one with proper support for 433MHz radio.

Basically, I will be using MQTT to report on 433MHz signals from various physical locations. To do this, I need to be able to detect which WiFi networks are available, so that I can select the strongest.

I tried using WiFi.scanNetworksAsync(callbackfn), as given in this example:
https://arduino-esp8266.readthedocs.io/ ... class.html
but I get the following back
Code: Select all/home/moi/Code/Arduino/sketch_may30a/sketch_may30a.ino: In function 'void setup()':
sketch_may30a:35: error: 'class ESP8266WiFiClass' has no member named 'scanNetworksAsync'
   WiFi.scanNetworksAsync(prinScanResult);
        ^
exit status 1
'class ESP8266WiFiClass' has no member named 'scanNetworksAsync'

Seems like the function is not included in the library! Huh?

Any advice? I have not been able to find anything that makes sense on the Web so far.
My Arduino installation is recent (a month old, or less) and the read-the-docs-page doen't seem that old either. Has there been some update I missed?
User avatar
By schufti
#66576 hmmm, looking at ESP8266WiFiScan.h I see
Code: Select allclass ESP8266WiFiScanClass {

        // ----------------------------------------------------------------------------------------------
        // ----------------------------------------- scan function --------------------------------------
        // ----------------------------------------------------------------------------------------------

    public:

        int8_t scanNetworks(bool async = false, bool show_hidden = false);
        void scanNetworksAsync(std::function<void(int)> onComplete, bool show_hidden = false);

        int8_t scanComplete();
        void scanDelete();

        // scan result
        bool getNetworkInfo(uint8_t networkItem, String &ssid, uint8_t &encryptionType, int32_t &RSSI, uint8_t* &BSSID, int32_t &channel, bool &isHidden);

        String SSID(uint8_t networkItem);
        uint8_t encryptionType(uint8_t networkItem);
        int32_t RSSI(uint8_t networkItem);
        uint8_t * BSSID(uint8_t networkItem);
        String BSSIDstr(uint8_t networkItem);
        int32_t channel(uint8_t networkItem);
        bool isHidden(uint8_t networkItem);


so it should be accessible ...