
Componentes del montaje
- Arduino Uno R4
El código
Este sketch de Arduino C++ está en Code; inicia sesión y pulsa Compile & upload para compilar firmware real para la placa emulada.
/* This example prints the board's MAC address, and scans for available WiFi networks using the NINA module. Every ten seconds, it scans again. It doesn't actually connect to any network, so no encryption scheme is specified. Circuit: * Uno R4 WiFi created 13 July 2010 by dlf (Metodo2 srl) modified 21 Junn 2012 by Tom Igoe and Jaymes Dec Find the full UNO R4 WiFi Network documentation here: https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#scan-networks */ #include <WiFiS3.h> void setup() { //Initialize serial and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only } // check for the WiFi module: if (WiFi.status() == WL_NO_MODULE) { Serial.println("Communication with WiFi module failed!"); // don't continue while (true); } String fv = WiFi.firmwareVersion(); if (fv < WIFI_FIRMWARE_LATEST_VERSION) { Serial.println("Please upgrade the firmware"); } } void loop() { byte mac[6]; // scan for existing networks: Serial.println("Scanning available networks..."); listNetworks(); WiFi.macAddress(mac); Serial.println(); Serial.print("Your MAC Address is: "); printMacAddress(mac); delay(10000); } void listNetworks() { // scan for nearby networks: Serial.println("** Scan Networks **"); int numSsid = WiFi.scanNetworks(); if (numSsid == -1) { Serial.println("Couldn't get a WiFi connection"); while (true); } // print the list of networks seen: Serial.print("number of available networks:"); Serial.println(numSsid); // print the network number and name for each network found: for (int thisNet = 0; thisNet < numSsid; thisNet++) { Serial.print(thisNet); Serial.print(") "); Serial.print(WiFi.SSID(thisNet)); Serial.print(" Signal: "); Serial.print(WiFi.RSSI(thisNet)); Serial.print(" dBm"); Serial.print(" Encryption: "); printEncryptionType(WiFi.encryptionType(thisNet)); } } void printEncryptionType(int thisType) { // read the encryption type and print out the name: switch (thisType) { case ENC_TYPE_WEP: Serial.println("WEP"); break; case ENC_TYPE_WPA: Serial.println("WPA"); break; case ENC_TYPE_WPA2: Serial.println("WPA2"); break; case ENC_TYPE_WPA3: Serial.println("WPA3"); break; case ENC_TYPE_NONE: Serial.println("None"); break; case ENC_TYPE_AUTO: Serial.println("Auto"); break; case ENC_TYPE_UNKNOWN: default: Serial.println("Unknown"); break; } } void printMacAddress(byte mac[]) { for (int i = 0; i < 6; i++) { if (i > 0) { Serial.print(":"); } if (mac[i] < 16) { Serial.print("0"); } Serial.print(mac[i], HEX); } Serial.println(); }
Licencia del firmware (en inglés)
Notice: this firmware uses the LGPL-licensed Arduino core library
arduino-unor4wifi-wifi-scan.bin is statically linked with ArduinoCore-renesas 1.6.0, in Breadboard's port of its UNO R4 WiFi variant to Renesas FSP 5.3.0. Parts of that core are licensed under the GNU Lesser General Public License, version 2.1 or (at your option) any later version ("the Library"). Breadboard distributes this firmware under terms that permit you to modify the work for your own use and to reverse engineer it for debugging such modifications.
- Relink package: arduino-unor4wifi-wifi-scan-relink.zip (385 KB)
- Corresponding source: ArduinoCore-renesas-1.6.0-fsp53-source.zip (3.7 MB)
- Licence texts and relink instructions



