error uploading to an esp 8266

Hello comunity
I wanted to build an internett test device using an ESP8266.
When the internet works a green LED should light up and when the internet does not work a red one.
For this I have found the script in the internett but I can not install it on the ESP 8266.

I have installed all libraries but I get this error:

Error compiling for the board NodeMCU 0.9 (ESP-12 Module).

Can someone help me

#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include <WiFiNINA.h>

#define greenLED 8
#define redLED 9

#define OLED_WIDTH 128
#define OLED_HEIGHT 64
#define OLED_ADDR 0x3C

Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT);

char ssid[] = "test";
char pass[] = "";

int status = WL_IDLE_STATUS;

String google = "www.google.com";
String salesforce = "www.salesforce.com";
IPAddress localServer(172, 16, 42, 5);

int googleResult;
int salesforceResult;
int serverResult;
int gatewayResult;

void setup() {
pinMode(greenLED, OUTPUT);
pinMode(redLED, OUTPUT);

Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);

while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to Network named: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
delay(10000);
}

String ssid = WiFi.SSID();
IPAddress ip = WiFi.localIP();
IPAddress gateway = WiFi.gatewayIP();
IPAddress subnet = WiFi.subnetMask();

display.clearDisplay();

display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("Net Tester");

display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 17);
display.print("SSID: ");
display.println(ssid);
display.print("IP: ");
display.println(ip);
display.print("Subnet: ");
display.println(subnet);
display.print("Gateway:");
display.println(gateway);

display.display();

delay(5000);
}

void loop() {

IPAddress gateway = WiFi.gatewayIP();
googleResult = WiFi.ping(google);
salesforceResult = WiFi.ping(salesforce);
serverResult = WiFi.ping(localServer);
gatewayResult = WiFi.ping(gateway);
long counter = millis();

display.clearDisplay();

display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("Net Tester");

display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 17);
display.print("Gateway: ");
display.println(gatewayResult);
display.print("Local Server: ");
display.println(serverResult);
display.print("Google: ");
display.println(googleResult);
display.print("Salesforce: ");
display.println(salesforceResult);
display.println(counter);

display.display();

if (gatewayResult < 0 || serverResult < 0 || googleResult < 0 || salesforceResult < 0) {
digitalWrite(greenLED, LOW);
digitalWrite(redLED, HIGH);
} else {
digitalWrite(greenLED, HIGH);
digitalWrite(redLED, LOW);
}

delay(5000);Prüfungsvorbere
}

  • Maybe check if there is enough space in your esp 12because some took a lot of space in it

  • or the library might not be compatible

  • the pin choose might not be compatible with you model of esp8266

There is almost certainly more to it than that.

I'm going to ask you to post some additional information that might help us to identify the problem.

Please do this:

  1. If you don't still have the IDE or web editor open with the error present, repeat the process that generated it.
  2. You now need to copy the full and exact text of the output.
    The procedure for doing this is different depending on which Arduino development software you are using:
    • Arduino IDE 1.x: Click the Copy error messages button on the right side of the orange bar in the IDE.
    • Arduino IDE 2.x: Right click on the black "Output" panel at the bottom of the IDE window and then select "Copy All" from the context menu.
    • Arduino Web Editor: Click the icon that looks like two pieces of paper at the top right corner of the black console window Web Editor.
  3. Open a forum reply here by clicking the Reply button.
  4. Click the </> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  5. Press Ctrl+V.
    This will paste the compilation output into the code block.
  6. Move the cursor outside of the code block markup before you add any additional text to your reply.
  7. Click the Reply button to post the output.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.