Wifi network scanner using esp

Hello, im new to RIOT :smile:. Still trying to figured out how the gnrc works!

For one of my projects i would like to add the following functionality:

  • First my esp32 will scan and detect the available networks,
  • Then it will prompted me to select one and fill the password so i can connect to it.

However i have two main issues. The first is that i couldn’t find what packet to send through ipv6 in order to get the available SSID’s. Then while working with esp32, i noticed that the esp-wifi module with the way it is structured does not support connection at runtime. That is cause the initialization structure is locked in the .c file and the only way of accessing it is at compile time throw CFLAGS which override the definitions of SSID & PASS.

So i will be very great-full if somebody can give me a general guideline or some kind of steps that i should follow in order to accomplish the first task. As for the second, is there some reason for that missing functionality, that i am no aware of. Would you like me to alter it in order for the esp module to be able to connect on the wifi at runtime provided the right credentials;

Thank you in advance!

1 Like

Hi, I don’t know necessarily about gRNC on the ESP32. However I was able to get RIOT/examples/paho-mqtt going on the NodeMCU ESP32. But that uses lwip as networking stack.

1 Like

Hi, unfortunately the APIs to control WIFI aren’t very good. I will just note that none of the 802.11 packets are IPv6 packets, but exist in an entirely different layer. I don’t know what your device looks like that you can type in a password; most people are focused on various kinds of zero-touch onboarding. Making it zero-touch requires support from the network, which is far itself a challenge. I am working on RFC8995 (BRSKI) libraries for RIOT-OS, and ESP32 is our initial target platform.
In the home, the CHIP/MATTER spec will soon be public. I imagine we’ll want to support it, but they sure re-invented a lot of things, including TLS and TCP :frowning:

I’m afraid that your first task is not presently doable.

A RIOT-agnostic remark I’d like to make is that you don’t use IPv6 to find SSID’s. I mean… using IPv6 implies that you already have an IP, which you would have gotten from a gateway. But you’re trying to find a gateway to connect to, so that makes it a paradox, doesn’t it? :slight_smile:

SSIDs are discovered by either listening to the beacon frames in the air, or by sending out probe requests and checking the responses you get.