ESP8266WiFi.h - Can't Get WiFi to Work

Good morning, I apologize if this is redundant. I did some searching around last night and wasn't able to find anything that worked for me.

I have a ESP8266 NodeMCU (version 1.0?) with a built-in ESP-12E for WiFi. I'm not sure what I'm doing wrong, but I haven't been successful in getting my Sketch to compile.

I got the basics of my application working, and then decided to start working on the WiFi aspect. All of the guides that I looked at indicated that I should do the include "ESP8266WiFi.h" at the beginning of the Sketch. When I verify the code (or attempt an upload) it gives me a generic error that says it can't compile for the 12E board.

The error doesn't seem to be with my Sketch. What I gather is that I probably don't have the correct libraries installed. However, when I go to try and find the ESP8266WiFi package, it doesn't seem to be there for me.

I believe my board is installed in the Board Manager, and I did include that additional item in the Preferences for ESP8266.

With everything I've learned so far, it seems silly that I'm hung up on something so trivial as trying to install the correct library. Any help is appreciated!

Thank you!

if you have the right libraries it will be fine. I am using one right now. Takes a while. I found this and it worked easily. Build an ESP8266 Web Server - Code and Schematics (NodeMCU) | Random Nerd Tutorials

Thanks for your help! Through some more digging around, it looks like I may have had some settings incorrect for my board. I ran some updates, and the compiling and uploading looks different than it did before. Kind of weird.

Then turns out the order that I did the "#include"(s) at the beginning of the sketch mattered too. The ESP8266WiFi library needed to be first.

MCExpy10:
turns out the order that I did the "#include"(s) at the beginning of the sketch mattered too. The ESP8266WiFi library needed to be first.

I dpn't think that's right at all. You did something else to fix the problem.

Yes you have to make a bunch of changes to the board settings too. I think it remembers them. I ALWAYS use 9600 on the serial rate. Good luck.

the thing does wifi pretty well i guess, but now i am having tons of problems controlling a 5v light string with it. Always something i guess.