WiFi - Scan the surrounding WiFi networks
In this example, we use Ameba to scan available WiFi hotspots in the surroundings, and prints the SSID, encryption type, signal strength information of each detected hotspot.
First, make sure the correct Ameba development board is selected in Arduino IDE: “Tools” -> “Board” ->
Open the “ScanNetworks” example in “File” -> “Examples” -> “WiFi” -> “ScanNetworks”:
Then upload the sample code and press the reset button on Ameba. Afterwards, you can see “**Scan Networks**” message appears, with the detected WiFi hotspots and the information of each hotspot.
Then we use WiFi.scanNetworks() to detect WiFi hotspots:
To get information of detected WiFi hotspot:
We use WiFi.SSID(thisNet) to retrieve SSID of a network:
We use WiFi.RSSI(thisNet) to get the signal strength of the connection to the router:
We use WiFi.encryptionType(thisNet) to get the encryption type of the network:
Comparison with Arduino