ArduinoIDE v1.8.5 ~ v2.0 & VSCode/PlatformIO #COMPILE ERROR #(dhcpSoftAP was not declared)

Hey Community, i have an error while compiling.

Declaration, that fails:

        dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
        dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));

It says that dhcpSoftAP, included by:

  #include <lwip/napt.h>
  #include <lwip/dns.h>
  #include <LwipDhcpServer.h>

was not declared, the ouput-log, says, that :

dhcpSoftAP was not declared in this scope.

what can i do to declare it right?
i tried many types from the lwip-libary "ip_addr_t &&&more dhcpSoftAP;" but that didnt work.

i got a workaround , which dosent seems to use properly for using it as nat-router by using

auto& server = WiFi.softAPDhcpServer();
server.setDns(WiFi.dnsIP(0));

but i would be grateful for another solution by declaring, or including an additional path.

greetz blackleakz

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the IDE 1.x category.

Create an instance? E.g. what you tried below makes dhcpSoftAP an instance of the String class. So you have to find out what class it has to be.

Post the complete error message.

I doubt that dhcpSoftAP should be a String (capital S). String objects don't have a member called dhcps_set_dns so I'm not surprised that it "didn't work".

Please post your code (using code tags) and the complete error message (also using code tags).
Tell us which board you're using (sounds like some form of ESP).

I'm not familiar with the ESP family so can't quite help.

Thanks, im using the NodeMCUv3 - ESP8266 with arduino/platformio and want to compile following code:


#if LWIP_FEATURES && !LWIP_IPV6
 
  #define HAVE_NETDUMP 0
  #include <Arduino.h>
  #include <ESP8266WiFi.h>
  #include <ESP8266WebServer.h>
  #include <lwip/napt.h>
  #include <lwip/dns.h>
  #include <LwipDhcpServer.h>
  #include <SPI.h>
  #include <Wire.h>
  #include <Adafruit_GFX.h>
  #include <ESP8266mDNS.h>
  #include <WiFiUdp.h>
  #include <ArduinoOTA.h>
  #include <Adafruit_SSD1306.h>




  #define SCREEN_WIDTH 128 
  #define SCREEN_HEIGHT 64
  #define OLED_RESET     -1 
  Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

 

  #define NAPT 1000
  #define NAPT_PORT 10

  const char* espHostname = "blackzspot";

  #if HAVE_NETDUMP
 
  #include <NetDump.h>
 
  void dump(int netif_idx, const char* data, size_t len, int out, int success) {
  (void)success;
    Serial.print(out ? F("out ") : F(" in "));
    Serial.printf("%d ", netif_idx);
 
    // optional filter example: if (netDump_is_ARP(data))
  {
      netDump(Serial, data, len);
      //netDumpHex(Serial, data, len);
  }
  }
  #endif
 


  // MY FUNCTIONS
  bool testwifi() {

    Serial.printf("\nConsole<>> Testing connection with '%s'\n", WiFi.SSID().c_str());
    
    int count = 0;
    digitalWrite(LED_BUILTIN,LOW);
    while (count < 20) {
      if (WiFi.status() == WL_CONNECTED) {
        Serial.printf("\nConsole<>> WiFi Connected! \nSTA: %s (dns: %s / %s)\n\n",
                      WiFi.localIP().toString().c_str(),
                      WiFi.dnsIP(0).toString().c_str(),
                      WiFi.dnsIP(1).toString().c_str());
        
     
      //  ip4_addr_t dhcps_set_dns;
     //   IPAddress DNS servers to AP side
        dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
        dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));
        //auto& server = WiFi.softAPDhcpServer();
      //  server.setDns(WiFi.dnsIP(0));
        digitalWrite(LED_BUILTIN,HIGH);
        return true;
    }

      Serial.print(".");
      delay(1000);
      count++;

  }

    return false;

  }
 

  // SERVER
  ESP8266WebServer server(80);

  String content;
  String networks[40];


 
 const char index_html[] PROGMEM = R"rawliteral(
  <!DOCTYPE HTML><html>
  <head>

  <title>BlackLeakz-Repeater</title>

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta charset="UTF-8">
  <meta name="description" content="BlackLeakz-SOFTAP_STA">
  <link rel="icon" href="data:,">

  <style>

  head{
    background-color: #8F8F8F; 
    color: #FF0000;
  }
  body{
    background-color: #8F8F8F;
    color: #00ECFF;
  }
  html {font-family: Arial; display: inline-block; text-align: center;}
  p {font-size: 3.0rem;}
  body {max-width: 600px; margin:0px auto; padding-bottom: 25px;}
  .switch {position: relative; display: inline-block; width: 120px; height: 68px} 
  .switch input {display: none}
  .slider {position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius: 6px}
  .slider:before {position: absolute; content: ""; height: 52px; width: 52px; left: 8px; bottom: 8px; background-color: #fff; -webkit-transition: .4s; transition: .4s; border-radius: 3px}
  input:checked+.slider {background-color: #b30000}
  input:checked+.slider:before {-webkit-transform: translateX(52px); -ms-transform: translateX(52px); transform: translateX(52px)}

  </style>


</head>


<body>

  <center><form action=\"/login\" method=\"POST\"><input type=\"text\" name=\"username\" placeholder=\"Username\"></center></br>
  <center><input type=\"password\" name=\"password\" placeholder=\"Password\"></center></br>
  <center><input type=\"submit\" value=\"Login\"></form></center>
  <center><p>Try 'John Doe' and 'password123' ...</p></center>
  <center><h2>BlackLeakz-Repeater</h2></center>

  <center><p1>Repeater-Configuration </p1></center><center><a class=\"button button-on\" href="/repeater">Settings</a></center>

  <center><p2>OTA-Update</p2></center><center><a class=\"button button-on\" href="/update">Update</a></center>

  <center><p3>Scan for WiFi</p3></center><center><a class=\"button button-on\" href="/scan">Scan</a></center>

  
  
</body>

</html>
)rawliteral";



  const char style[] PROGMEM = R"rawliteral(
  <!DOCTYPE HTML>
  <html>
  <style>
  head{
    background-color: #8F8F8F; 
    color: #FF0000;
  }
  body{
    background-color: #8F8F8F;
    color: #00ECFF;
  }
  </style>
  </html>
  )rawliteral";
  
  void handleLogin() {                         // If a POST request is made to URI /login
  if( ! server.hasArg("username") || ! server.hasArg("password") 
      || server.arg("username") == NULL || server.arg("password") == NULL) { // If the POST request doesn't have username and password data
    server.send(400, "text/plain", "400: Invalid Request");         // The request is invalid, so send HTTP status 400
    return;
  }
  if(server.arg("username") == "blackleakz" && server.arg("password") == "x3pc09") { // If both the username and the password are correct
    server.send(200, "text/html", "<h1>Welcome, " + server.arg("username") + "!</h1><p>Login successful</p>");
  } else {                                                                              // Username and password don't match
    server.send(401, "text/plain", "401: Unauthorized");
  }
}
  
  void serverconfig() {


   
    
   

    server.begin();

    

    int n = WiFi.scanNetworks();
 
    content = "<!DOCTYPE html><html lang='en'><meta name='viewport' content='width=device-width, initial-scale=1.0'>";
    content += "<style>head{ background-color: #8F8F8F; color: #FF0000; } body{ background-color: #8F8F8F; color: #00ECFF; }</style>";
    content += "<head><title>ESP8266 Configuration Page</title></head>";
    content += "<body>";  
 
    if (WiFi.status() != WL_CONNECTED) {
      content += "<center><div>currently not connected</div></center>";
  }
    else {
      content += "<center><div>connected to: ";
      content += WiFi.SSID();
      content += " IP: ";
      content += WiFi.localIP().toString();
      content += "</div></center>";
  }
 
    content += "<center><div>";
   
    if (n == 0) {
      content += "<center><h1>No wireless networks found</h1></center>";
  }
     
    else {
      content += "<center><h1>Wireless Station Settings</h1></center>";
      content += "<center><form method='post'>";
      for (int i = 0; i < n; ++i) {
        networks[i] = WiFi.SSID(i);
        content += "<center><div>";
        content += "<center><input type=\"radio\" id=\"";
        content += String(i);
        content += "\" ";
        content += "name=\"SSIDs\" value=\"";
        content += String(i);
        content += "\"></center>";
        content += "<center><label for=\"";
        content += String(i);
        content += "\"";
        content += ">";
        content += String(i + 1);
        content += ": ";
        content += WiFi.SSID(i);
        content += " (";
        content += String(WiFi.RSSI(i));
        content += ")";
        content += (WiFi.encryptionType(i) == ENC_TYPE_NONE) ? " " : "*";
        content += "</label></center>";
        content += "</div></center>";
        delay(10);
    }
      content += "<center><label>Password:</label></center><br><center><input type='password' placeholder='********' name='stapsk' minlength=8 maxlength=63></center><br><center><small>Must be at least 8 characters or blank!</small></center><br><br>";
      content += "<center><button type='submit' formaction='stasettings'>Save Permanently</button></center><center><button type='submit' formaction='tempstasettings'>Save Temporarily (Until Reboot)</button></center>";
      content += "</form></center>";  
      content += "<center><h1>Wireless Access Point Settings</h1></center>";
      content += "<center><form method='post'>";
      content += "<center><label>SSID:</label></center><br><input name='apssid' placeholder='";
      content += WiFi.softAPSSID();
      content += "' length=32><br>";
      content += "<center><label>Password:</label></center><br><center><input type='password' placeholder='";
      content += WiFi.softAPPSK();
      content += "' name='appsk' minlength=8 maxlength=63></center><br><center><small>Must be at least 8 characters or blank!</small></center><br><br>";
      content += "<center><button type='submit' formaction='apsettings'>Save Permanently</button></center><center><button type='submit' formaction='tempapsettings'>Save Temporarily (Until Reboot)</button></center>";
      content += "</form></center>";
  }
 
    content += "<center><h1>Miscellaneous</h1></center>";
    content += "<center><form method='get' action='reboot'><input type='submit' value='Reboot'></form></center>";
    content += "<div>";

    
    server.on("/", []() {
      server.send(200, "text/html", index_html);
  });

      
  server.on("/login", HTTP_POST, handleLogin); 

  server.on("/repeater", []() {
      server.send(200, "text/html", content);
  });
 
    server.onNotFound([]() {
      server.send(404, "text/plain", "How the heck did you get here?");
  });
 
       server.on("/scan", []() {
        int n = WiFi.scanNetworks();
        String msg;
        for (int i = 0; i < n; ++i) {
        networks[i] = WiFi.SSID(i);
        msg += "<center><div>";
        msg += "<input type=\"radio\" id=\"";
        msg += String(i);
        msg += "\" ";
        msg += "name=\"SSIDs\" value=\"";
        msg += String(i);
        msg += "\">";
        msg += "<label for=\"";
        msg += String(i);
        msg += "\"";
        msg += ">";
        msg += String(i + 1);
        msg += ": ";
        msg += WiFi.SSID(i);
        msg += " (";
        msg += String(WiFi.RSSI(i));
        msg += ")";
        msg += (WiFi.encryptionType(i) == ENC_TYPE_NONE) ? " " : "*";
        msg += "</label>";
        msg += "</div>";
        delay(10);
    }
      server.send(200, "text/html", msg);
  });


    server.on("/stasettings", []() {
      String temp = server.arg("SSIDs");
      int number = temp.toInt();
      String stassid = networks[number];
      String stapsk = server.arg("stapsk");
      if (stassid.length() > 0) {
        server.send(200, "text/plain", "Settings Recieved");

        Serial.printf("\n\nConsole<>> Attempting to connect to '%s' using password '%s' \n", stassid.c_str(), stapsk.c_str());

        display.clearDisplay();
        display.setCursor(0,0);
        display.println("Trying to connect to: ");
        display.display();
        display.setCursor(0,10);
        display.display();
        display.setCursor(0,20);
        display.display();

        WiFi.persistent(true);
        WiFi.begin(stassid, stapsk);
        testwifi();
    }
  });
 
    server.on("/tempstasettings", []() {
      String temp = server.arg("SSIDs");
      int number = temp.toInt();
      String stassid = networks[number];
      String stapsk = server.arg("stapsk");
      if (stassid.length() > 0) {
        server.send(200, "text/plain", "Settings Recieved");

        Serial.printf("\n\nConsole<>> Attempting to connect to '%s' using password '%s' \n", stassid.c_str(), stapsk.c_str());

        display.clearDisplay();
        display.setCursor(0,0);
        display.println("Connecting to: ");
        display.display();
        display.setCursor(0,10);
        display.println(stassid);
        display.display();
        display.setCursor(0,20);
        display.println(stapsk);
        display.display();
     

        WiFi.persistent(false);
        WiFi.begin(stassid, stapsk);
        testwifi();
    }
  });
 
    server.on("/apsettings", []() {
      String apssid = server.arg("apssid");
      String appsk = server.arg("appsk");
      if (apssid.length() > 0) {
        server.send(200, "text/plain", "Settings Recieved");

        Serial.printf("\n\nConsole<>> Setting AP Credentials \nSSID: %s \nPassword: %s \n", apssid.c_str(), appsk.c_str());

        display.clearDisplay();
        display.setCursor(0,0);
        display.println("Settings recived.");
        display.display();
        display.setCursor(0,10);
        display.println("Permanent AP:");
        display.display();
        display.setCursor(0,20);
        display.display();
        display.setCursor(0,30);
        display.display();

        WiFi.persistent(true);
        WiFi.softAP(apssid, appsk);
    }
  });
 
    server.on("/tempapsettings", []() {
      String apssid = server.arg("apssid");
      String appsk = server.arg("appsk");
      if (apssid.length() > 0) {
        server.send(200, "text/plain", "Settings Recieved");

        Serial.printf("\n\nConsole<>> Setting Temporary AP Credentials \nSSID: %s \nPassword: %s \n", apssid.c_str(), appsk.c_str());

        display.clearDisplay();
        display.setCursor(0,0);
        display.println("Settings recived.");
        display.display();
        display.setCursor(0,10);
        display.println("Temporary AP:");
        display.display();
        display.setCursor(0,20);
        display.println(apssid.c_str());
        display.display();
        display.setCursor(0,30);
        display.println(appsk.c_str());
        display.display();

        WiFi.persistent(false);
        WiFi.softAP(apssid, appsk);
    }
  });
 
    server.on("/reboot", []() {
      server.send(200, "text/plain", "Rebooting now...");
      delay(5000);
      ESP.reset();
  });
  }
 
  void setup() {
    
    Serial.begin(115200);
    Serial.println("Console<>> Console started.");

    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, LOW);
    delay(1000);
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1500);
    digitalWrite(LED_BUILTIN, LOW);

    Serial.println("Console<>> Initialize display.");

    if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
      Serial.println(F("SSD1306 allocation failed"));
      for(;;);
    }

    
    display.display();
    display.setTextColor(WHITE);
    display.setTextSize(1);
    display.setCursor(0,0);
    display.println("Console<>>");
    display.display();
    display.setCursor(0,10);
    display.println("Started.");
    display.display();
    delay(3000);
    display.clearDisplay();
    

    
   
    delay(1000);
    Serial.printf("\n\nConsole<>> NAPT Range extender\n");
    Serial.printf("Console<>> Heap on start: %d\n", ESP.getFreeHeap());
 


  #if HAVE_NETDUMP
    phy_capture = dump;
  #endif
 


    WiFi.setPhyMode(WIFI_PHY_MODE_11N); // Set radio type to N
    WiFi.mode(WIFI_AP_STA);
    WiFi.persistent(false);
    WiFi.begin(); // Use stored credentials to connect to network
    testwifi();
    WiFi.softAPConfig(  // Set IP Address, Gateway and Subnet
      IPAddress(192, 168, 4, 1),
      IPAddress(192, 168, 4, 1),
      IPAddress(255, 255, 255, 0));
    WiFi.softAP(WiFi.softAPSSID(), WiFi.softAPPSK()); // Use stored credentials to create AP



    Serial.println("Console<>> SSID: " + WiFi.softAPSSID() + "\n\nPASSPHRASE: " + WiFi.softAPPSK());


    display.setCursor(0,0);
    display.println("SSID:");
    display.display();
    display.setCursor(0,10);
    display.println(WiFi.softAPSSID());
    display.display();
    display.setCursor(0,20);
    display.println("KEY:");
    display.display();
    display.setCursor(0,30);
    display.println(WiFi.softAPPSK());
    display.display();
    delay(4000);
    display.clearDisplay();
    display.setCursor(0,0);
    display.println("IP:");
    display.display();
    display.setCursor(0,10);
    display.println(WiFi.localIP());
    display.display();



    ArduinoOTA.onStart([]() {
    Serial.println("Start");
    });
    ArduinoOTA.onEnd([]() {
      Serial.println("\nEnd");
    });
    ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
     Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
    });
    ArduinoOTA.onError([](ota_error_t error) {
      Serial.printf("Error[%u]: ", error);
      if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
      else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
      else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
      else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
      else if (error == OTA_END_ERROR) Serial.println("End Failed");
    });
    ArduinoOTA.begin();




    Serial.printf("Console<>> Heap before: %d\n", ESP.getFreeHeap());
    err_t ret = ip_napt_init(NAPT, NAPT_PORT);
    Serial.printf("Console<>> ip_napt_init(%d,%d): ret=%d (OK=%d)\n", NAPT, NAPT_PORT, (int)ret, (int)ERR_OK);

    if (ret == ERR_OK) {
      ret = ip_napt_enable_no(SOFTAP_IF, 1);
      Serial.printf("ip_napt_enable_no(SOFTAP_IF): ret=%d (OK=%d)\n", (int)ret, (int)ERR_OK);
      if (ret == ERR_OK) {
    }
  }

    Serial.printf("Console<>> Heap after napt init: %d\n", ESP.getFreeHeap());

    if (ret != ERR_OK) {

      Serial.printf("Console<>> NAPT initialization failed\n");

    }
 
    serverconfig();
  }
 
  #else
 
  void setup() {
    Serial.begin(115200);
    Serial.printf("\n\nConsole<>> NAPT not supported in this configuration\n");
  }
 
  #endif
 
  void loop() {

    MDNS.update();

    server.handleClient();
    

    if (WiFi.status() != WL_CONNECTED) {

      digitalWrite(LED_BUILTIN, LOW);
      delay(1000);
      digitalWrite(LED_BUILTIN, HIGH);
      delay(1000);

  }
    else {

      digitalWrite(LED_BUILTIN, HIGH);

  }
 }

The Output is:

Compiling .pio\build\nodemcuv2\lib283\ESP8266WiFi\BearSSLHelpers.cpp.o
src\main.cpp: In function 'bool testwifi()':
src\main.cpp:70:9: error: 'dhcpSoftAP' was not declared in this scope
   70 |         dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
      |         ^~~~~~~~~~
Archiving .pio\build\nodemcuv2\lib1bc\libAdafruit GFX Library.a
Compiling .pio\build\nodemcuv2\lib283\ESP8266WiFi\CertStoreBearSSL.cpp.o
*** [.pio\build\nodemcuv2\src\main.cpp.o] Error 1
=================================================================== [FAILED] Took 9.09 seconds ===================================================================
[{
	"resource": "/c:/Users/bluel/OneDrive/.backup/unsorted/Dokumente/PlatformIO/Projects/NodeMCUv3-esp8266-WiFi-Repeater.v0.3a/src/main.cpp",
	"owner": "cpp",
	"severity": 8,
	"message": "'dhcpSoftAP' was not declared in this scope",
	"startLineNumber": 70,
	"startColumn": 9,
	"endLineNumber": 70,
	"endColumn": 9
}]

I dont know why but on my Desktop-PC it works without any error by using the same ide. Could the c++/gcc compiler plays a role?

This code needs to be declared:

dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));

on my Laptop-fresh installed Arduino-IDE 1.8.5 & 2.0, PlatformIO and Web IDE by arduino.cc, i get always in all ways the same declaration-error of this fucin declaration of the Soft_AP's dhcps, dns setting. Only my old Desktop-PC, which really uses the same Arduino IDE, compiles the code without an error by this declaration.

Thanks in advance for possible solutions near the reality, kiddin myself always rofl.

PlatformIO is not at all popular on the Arduino forum, and there are few, if any, "regulars" who know anything about it. Or if any do, they don't seem to be willing to chime in.

Perhaps there is a more appropriate forum to post questions about PlatformIO.

Bro, i explained that it dosent work on both IDE's. All in all it dosent work with the cloud ide either.
I think that the include of the <LwipDhcpServer.h> or <lwip/dns.h> needs a additional declaring of the variables dhcpSoftAP & dhcps_set_dns by using the same declaring of data-type used in the header files. It seems to be a bit of work to find the correct data-type declaring in the header-files cuz there are really much of them. Cant imagine why a "better"/ newer version of c++ compiler or ide needs a more difficult declaring.

As I said, on my Desktop-PC, the Arduino IDE and PlatformIO-extension from vscode, works properly in sight of compiling the code. So i started by installing all old & new c++ redist-packages and searching for another compiler i can set for compiling the code with the arduino-framework, cuz platformio defaultly uses the arduino-framework for compiling, there are other frameworks for esp8266 u could use, but thats not the goal for this type of code, so the compiling should be the same on both IDE's.

If someone have an idea for helpin me searching for the issue, i really would be more as gratefull.

Thx in advance,
BlackLeakz

Post the code and error messages that result when using the Arduino IDE, on your desktop (not cloud). Then you can expect some help.

As you wished, the same error, but in Arduino IDE- form.

C:\Users\bluel\OneDrive\.backup\unsorted\Dokumente\Arduino\sketch\sketch.ino: In function 'bool testwifi()':
sketch:71:7: error: 'dhcpSoftAP' was not declared in this scope
   71 |       dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
      |       ^~~~~~~~~~
Bibliothek ESP8266WiFi in Version 1.0 im Ordner: C:\Users\bluel\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1\libraries\ESP8266WiFi  wird verwendet
Bibliothek ESP8266WebServer in Version 1.0 im Ordner: C:\Users\bluel\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1\libraries\ESP8266WebServer  wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: C:\Users\bluel\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1\libraries\SPI  wird verwendet
Bibliothek Wire in Version 1.0 im Ordner: C:\Users\bluel\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1\libraries\Wire  wird verwendet
Bibliothek Adafruit_GFX_Library in Version 1.11.5 im Ordner: C:\Users\bluel\OneDrive\.backup\unsorted\Dokumente\Arduino\libraries\Adafruit_GFX_Library  wird verwendet
Bibliothek Adafruit_BusIO in Version 1.14.1 im Ordner: C:\Users\bluel\OneDrive\.backup\unsorted\Dokumente\Arduino\libraries\Adafruit_BusIO  wird verwendet
Bibliothek ArduinoOTA in Version 1.0 im Ordner: C:\Users\bluel\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1\libraries\ArduinoOTA  wird verwendet
Bibliothek Adafruit_SSD1306 in Version 2.5.7 im Ordner: C:\Users\bluel\OneDrive\.backup\unsorted\Dokumente\Arduino\libraries\Adafruit_SSD1306  wird verwendet
Bibliothek ESP8266mDNS in Version 1.2 im Ordner: C:\Users\bluel\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1\libraries\ESP8266mDNS  wird verwendet
exit status 1
'dhcpSoftAP' was not declared in this scope

You forgot to properly declare that object, or you forgot to include a library that does so.

Post the code that generated the error.

Edit: I see that the code posted in #3 has that problem. These function calls are the only place where that symbol appears. My conclusion stands.

        dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
        dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));

The plz tell me why the code, works always before & on my desktop-pc using the same include - settings. Bro. read my contributions and try 2 understand.

i included the needed libarys for:

dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1))

by:

#include <lwip/napt.h>
#include <lwip/dns.h>
#include <LwipDhcpServer.h>

or what do u think, what needs to be included too?

You need to declare and define the dhcpSoftAP object, probably as global (outside of any function).

If that code ever worked, then "dhcpSoftAP" was properly declared, so dig up that original source.

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