RIOT-OS / RIOT

RIOT - The friendly OS for IoT
https://riot-os.org
GNU Lesser General Public License v2.1
4.85k stars 1.97k forks source link

Missing Wi-Fi features for ESP32 #18569

Open SrivamsiMalladi opened 1 year ago

SrivamsiMalladi commented 1 year ago

Description

I am looking forward to using RIOT-OS with ESP32 for developing IoT applications for which I will need certain features like

From my understanding of the RIOT-OS's WiFi Network Interface for ESP32, it is

Please let me know if these features are already available or if I am missing something related to these features.

Useful links

gschorcht commented 1 year ago

From my understanding of the RIOT-OS's WiFi Network Interface for ESP32, it is

  • only possible to specify the mode (Station or SoftAP) in the makefile before building the application
  • not possible to scan for available networks
  • only possible to specify the SSID and password of the network to connect to in the makefile or during the make command

You are absolutely right, the WiFi interface is statically configured at compile time. There have been no plans to change this yet.

The reason for this is the design of how RIOT handles network devices. In RIOT, network devices are statically configured at compile time and enabled at system startup. For the protocol stack, the network device is then just available regardless of whether it is an Ethernet or WiFi interface. Thus, there was no need to change the WiFi interface mode or change WiFi parameters at runtime, or search for available WiFi networks.

The correct approach to implement such features would be

You are welcome to contribute your ideas or even better the code :smile:

SrivamsiMalladi commented 1 year ago

Hello @gschorcht. I would like to try implementing these features. I would like to start with adding support for changing the SSID and PASS in STA mode during runtime. So, if I understood correctly, I need to

Then to use the functionality I wanted, I need to set the SSID and PASS in the netdev (esp_wifi_netdev_t) using the netdev.set(), which is currently being initialized by the auto_init_esp_wifi() in the init.c. My question is, when I change the SSID and PASS using .set(), does the ESP32 automatically try to connect to this new Wi-Fi, or some reload()/reinit() kind of function must be called to reinitialize the Wi-Fi driver to consider the new Wi-Fi credentials?

( I have only used drivers/internal files directly till now. Never tried to mess around with the internal driver files. So. sorry if I am asking too many or silly questions.)