nodeMCU problem compiling

Hi all -

I'm new to Ardunio and hoping that I'm posting in the right place for this. I am having a problem connecting WiFi on an AMICA nodeMCU board.

I used the below link to a Youtube tutorial as the source for configuring the hardware and code:

I typed it in manually at first but when it didn't work I copied his code from GitHub

Both resulted in the same error and I'm unsure of what to do next to correct this.

When I try to compile - I get the following Error message - I also included the verbose version in a text attachment:

#include <ESP8266WiFi.h>

const char* ssid="ATT_WiFi";
const char* password="12345678";

int ledPin = 13;
void setup() {
  pinMode(ledPin,OUTPUT);
  digitalWrite(ledPin,LOW);

  Serial.begin(115200);
  Serial.println();
  Serial.print("Wifi connecting to ");
  Serial.println( ssid );
  
  WiFi.begin(ssid,password);

  Serial.println();
  Serial.print("Connecting");

  while( WiFi.status() != WL_CONNECTED ){
    delay(500);
    Serial.print(".");

  }
  digitalWrite( ledPin , HIGH);
  Serial.println();

  Serial.println("Wifi Connected Success!");
  Serial.print("NodeMCU IP Address: ");
  Serial.println(WiFi.localIP() );
  
}

void loop() {
  //loop segment
  
}

Thanks in advance for taking a look at this - any help one can offer to correct this is be greatly appreciated.

Mike

NodeMCU Error Log.txt (47.4 KB)

Here's the useful part of the output:

C:\Users\mdsne\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\cores\esp8266/core_esp8266_main.cpp:175: undefined reference to `loop'

Every Arduino sketch must have a setup and a loop function. Even if you don't want to put any code in the functions, you still need to define them. Your sketch doesn't have a loop function, thus the error.

See:

Hi Pert -

Thanks for your response.

I updated the sketch with the loop segment and now have this error message when I try to compile.

C:\Users\mdsne\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar: unable to rename 'C:\Users\mdsne\AppData\Local\Temp\arduino_build_455618\libraries\ESP8266WiFi\ESP8266WiFi.a'; reason: File exists

Multiple libraries were found for "ESP8266WiFi.h"
 Used: C:\Users\mdsne\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries\ESP8266WiFi
Using library ESP8266WiFi at version 1.0 in folder: C:\Users\mdsne\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries\ESP8266WiFi 
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This sort of error could be caused by your antivirus software. Try TEMPORARILY disabling your antivirus for a single compilation to see if the problem goes away, then turn the antivirus back on. If the problem doesn't occur with the antivirus off you will need to adjust the settings of your antivirus to whitelist the appropriate file, folder, or process so it doesn't interfere with compilation.