Hi,
i'm using an ESP32 with the Arduino IDE and use the Wifi.h library actually.
Now i've seen, that there is also an esp_wifi.h library.
Does this library:
- provide additional functions, means can be used in parallel OR
- is an alternative library you can use instead of wifi.h? If yes: Is it better to use esp_wifi.h instead of wifi.h and why?
I hope to get an answer this time... last two posts are unanswerd ;-(
Best regards
Daniel
Difference between wifi.h and esp_wifi.h
-
- Posts: 828
- Joined: Mon Jul 22, 2019 3:20 pm
Re: Difference between wifi.h and esp_wifi.h
TL;DR: WiFi.h uses the Arduino API and is much easier for noobs.
esp_wifi.h is part of the esp-idf. That is the primary framework for writing esp32 apps in C (it includes methods to compile on the command line). It does have additional functionality that is not exposed in arduino. WiFi.h is the arduino library. arduino-esp32 is a wrapper (HAL) around the esp-idf that provides the arduino API for use in C++/Arduino environments (Arduino IDE, platformio, eclipse, etc). WiFi.h is a much simpler interface, and has hundreds of examples out there in the public domain. WiFi.h is making calls to the underlying esp_wifi.h.
You can compare the examples for each library. Making a STA connection in arduino is essentially a single line of code.
https://github.com/espressif/esp-idf/bl ... ple_main.c
https://github.com/espressif/arduino-es ... Client.ino
esp_wifi.h is part of the esp-idf. That is the primary framework for writing esp32 apps in C (it includes methods to compile on the command line). It does have additional functionality that is not exposed in arduino. WiFi.h is the arduino library. arduino-esp32 is a wrapper (HAL) around the esp-idf that provides the arduino API for use in C++/Arduino environments (Arduino IDE, platformio, eclipse, etc). WiFi.h is a much simpler interface, and has hundreds of examples out there in the public domain. WiFi.h is making calls to the underlying esp_wifi.h.
You can compare the examples for each library. Making a STA connection in arduino is essentially a single line of code.
https://github.com/espressif/esp-idf/bl ... ple_main.c
https://github.com/espressif/arduino-es ... Client.ino
Who is online
Users browsing this forum: Google [Bot] and 67 guests