🛠 Scanner les réseaux WiFi avec le module 1DX

Arduino GIGA R1 WiFi · debutant · Schéma : IMG-giga-r1-wifi-debutant-3-scan-reseau-wifi.svg — GIGA R1 WiFi avec son module radio Murata 1DX et l'antenne u.FL vissée, ondes WiFi vers un routeur, liste de réseaux affichée dans le moniteur série

Objectives

First network step with the GIGA R1 WiFi: use the embedded Murata 1DX (LBEE5KL1DX-883) radio module — WiFi 802.11b/g/n 2.4 GHz up to 65 Mbps + Bluetooth LE — to list nearby networks. You will understand the role of the u.FL antenna, the difference between the two available Arduino cores (mbed and Zephyr), and the FlashFormat reflex if the scan returns nothing.

Hardware

Complete code

// GIGA R1 WiFi — scan des reseaux (core Zephyr, condense de ScanNetworksAdvanced)
#include <WiFi.h>

void setup {
  Serial.begin(9600);
  while (!Serial) {}                      // attend le moniteur (USB0 = USB-C)
  if (WiFi.status == WL_NO_MODULE) {
    Serial.println("Communication avec le module WiFi impossible !");
    Serial.println("Verifiez l'antenne u.FL, puis lancez le sketch FlashFormat du core.");
    while (true);
  }
  Serial.println("Scan en cours...");
}

void loop {
  int n = WiFi.scanNetworks;            // scan seul, sans connexion
  if (n <= 0) { Serial.println("Aucun reseau, nouvelle tentative..."); delay(1000); return; }
  Serial.print(n); Serial.println(" reseaux trouves :");
  for (int i = 0; i < n; i++) {
    Serial.print(WiFi.RSSI(i));           // signal en dBm
    Serial.print("\tCh "); Serial.print(WiFi.channel(i));
    Serial.print("\t"); Serial.print(WiFi.encryptionType(i));
    Serial.print("\t"); Serial.println(WiFi.SSID(i));
  }
  delay(10000);                           // un scan toutes les 10 s
}

Expected verification

The serial monitor displays the list of SSIDs in range, along with the signal level in dBm, the channel, and the encryption type for each. Your router (2.4 GHz only — the 1DX does not support 5 GHz) should appear with an RSSI between approximately -30 dBm (very strong) and -80 dBm (limit).

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials