🛠 Se connecter au Wi-Fi avec le module Murata 1DX (station WPA2)
Objectives
First networking step with the Portenta H7: joining an access point in station mode. The embedded radio module is a Murata 1DX: Wi-Fi 802.11n up to 65 Mbps (dual-band capable, supporting AP, STA, and simultaneous AP+STA modes) + Bluetooth 5.1 (Classic and Low Energy). You will use the WiFi library from the Mbed core, follow best practices by storing credentials in the Secrets tab, and learn about the official reconnection pitfall after losing the AP.
Hardware
- 1 × Arduino Portenta H7 + USB-C data cable
- A WPA2 Wi-Fi access point (the module is 802.11n; ensure your SSID is broadcast on a supported band)
- Arduino IDE 2.x with the "Arduino Mbed OS Portenta Boards" core
- Serial console at 115200 baud
Complete code
// wifi_station.ino — connexion station sur Murata 1DX
#include <WiFi.h>
#include "arduino_secrets.h" // onglet Secrets de l'IDE
char ssid[] = SECRET_SSID; // ne mets JAMAIS le mot de passe en dur
char pass[] = SECRET_PASS;
int status = WL_IDLE_STATUS;
void setup {
Serial.begin(115200);
while (!Serial) {}
if (WiFi.status == WL_NO_MODULE) {
Serial.println("Module Murata 1DX non detecte !");
while (true) {}
}
while (status != WL_CONNECTED) {
Serial.print("Connexion a "); Serial.println(ssid);
status = WiFi.begin(ssid, pass); // WPA2
delay(3000);
}
Serial.print("IP obtenue : ");
Serial.println(WiFi.localIP);
}
void loop {
if (WiFi.status != WL_CONNECTED) {
// Piege documente (ArduinoCore-mbed#382) : apres perte de l'AP,
// WiFi.begin seul ne recolle pas -> il faut WiFi.end avant.
WiFi.end;
delay(1000);
status = WiFi.begin(ssid, pass);
}
delay(2000);
}
Expected verification
The console displays Connexion a <ssid> followed by the IP address obtained via DHCP; you can ping the board from a PC on the same network. The Murata 1DX module also supports access point mode (and even simultaneous AP+STA modes) — the official tutorial wifi-access-point on docs.arduino.cc explores this path.
Common errors
WL_NO_MODULEat startup: the radio module might be "dead" due to a corrupted update — the official recovery method is to run the FlashFormat sketch to restore the Wi-Fi firmware (documented in the Zephyr core FAQ).- Impossible reconnection after an AP outage: a classic bug documented in issue ArduinoCore-mbed#382 — without calling
WiFi.endbefore the newWiFi.begin, the board never rejoins the restored network. - Hardcoded passwords in sketches shared on Git: use the Secrets tab (
arduino_secrets.h), never store secrets in version-controlled code. - Confusing the Murata 1DX (Wi-Fi + BT) with Ethernet: the board also has a 10/100 Ethernet PHY on the 80-pin connectors — two distinct network paths.
- Reconnection loop without delay: you are overwhelming the radio module; keep a
delaybetween two attempts. - >
Other tutorials for this board
- Premier programme : installer le core et faire clignoter la LED (M7 à 480 MHz !)
- Apprivoiser les connecteurs 80 broches : bouton, LED et entrée analogique
- Dual-core M7 ↔ M4 : appels de fonctions distants avec la bibliothèque RPC
- Client HTTPS/TLS : interroger une API sécurisée via le Murata 1DX
- Serveur web sur le port Ethernet 10/100 embarqué
- MicroPython + machine vision : le firmware OpenMV sur un cœur, C++ sur l'autre
Code examples for this board
clignotante.inoArduinobouton-poussoir.inoArduinopwm-respiration.inoArduinoentree-analogique.inoArduinomulti-uart.inoArduinocapteur-i2c-bmp280.inoArduino