🛠 Connecter le Nicla Vision au Wi-Fi (module ESP32)
Objectives
Connect the Nicla Vision to a 2.4 GHz Wi-Fi network via its onboard radio module, and verify the connection by displaying the IP address obtained via DHCP.
Hardware
- Arduino Nicla Vision (the radio module, widely reported as an ESP32-N4, is soldered onto the board)
- 2.4 GHz ONLY Wi-Fi router (no 5 GHz)
- >
- >
Complete Code
// >
#include <WiFi.h>
const char SSID[] = "MON_RESEAU";
const char PASS[] = "MON_MOT_DE_PASSE";
void setup {
Serial.begin(115200);
WiFi.begin(SSID, PASS); // 2.4 GHz only
Serial.print(F("connexion"));
uint32_t t0 = millis;
while (WiFi.status != WL_CONNECTED) {
delay(500); Serial.print('.');
if (millis - t0 > 20000) { Serial.println(F("\n echec, reset")); resetMCU; }
}
Serial.println(F(" connecte"));
Serial.print(F("IP : ")); Serial.println(WiFi.localIP);
Serial.print(F("RSSI : ")); Serial.println(WiFi.RSSI);
}
void loop {
if (WiFi.status != WL_CONNECTED) { // reconnexion simple
WiFi.disconnect; delay(1000); WiFi.begin(SSID, PASS);
}
delay(2000);
}
Expected Verification
The console displays the IP assigned by the router's DHCP and a consistent RSSI (e.g., −60 dBm near the router). In MicroPython (firmware ARDUINO_NICLA_VISION-*.dfu), the equivalent network.WLAN(network.STA_IF).connect(ssid, pass) is confirmed by the official port.
Common Errors
- 5 GHz Network: The module only sees 2.4 GHz; separate the SSIDs or disable band steering.
- API Not Found in the IDE: If WiFi.h is not provided by the installed Nicla core, switch to MicroPython (official port stm32/ARDUINO_NICLA_VISION) where SDIO Wi-Fi is validated.
- Choked Antenna: A metal case or placing the module flat on a ground plane = collapsed RSSI; the module's antenna is located at the edge of the board.
- Missing Radio Firmware: The Wi-Fi/BT firmware resides in the QSPI flash (1 MiB reserved); a full flash erase destroys it — reflash the complete bundle via DFU.
Other tutorials for this board
Code examples for this board
led_rgb.inoArduinoimu_lsm6dsox.inoArduinotof_distance.inoArduinomicro_pdm.inoArduinocamera_capture.inoArduinowifi_scan.inoArduino