Can I only use the Arduino standard library, without touching any esp8266 related header files?

I tried to connect to WiFi , succeeded with ESP8266WiFi.h header, but failed with Arduino library WiFi.h.

I follow this https://www.arduino.cc/en/Tutorial/ConnectWithWPA WiFi connecting tutorial but the board seems to reboot repeatly (I don't understand the error of course. I know nothing about hardware).

My board is ESP8266 V3 ESP-12N F NodeMcu Lua CP2102

  • the ESP8266WiFi library is based on the Arduino WiFi library so there are very similar functions so code can be ported between different WiFi libraries for Arduino.
    – Juraj
    Jan 2 '20 at 15:59
  • the ESP8266WiFi library has examples in IDE Examples menu
    – Juraj
    Jan 3 '20 at 9:00

The WiFi shield and an ESP8266 with any of several popular WiFi services firmwares are different pieces of hardware, each of which can provide WiFi services to another device connected to it, such as an Arduino Uno. Their interfaces are different, despite that they could be used to do similar jobs - offloading the WiFi communications from the Arduino - and the two libraries are written to drive each of them, respectively.

  • Ah I see. That official WiFi.h library is merely for the Arduino WiFi shield "extension" board.
    – Rick
    Jan 2 '20 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.