Im having trouble compiling code for esp32 board. I have chose sample code from examples but that too is giving error I suspect some problem with esp32 board Library. Also want to mention that I have installed latest library and tried various old Arduino ide but same problem is coming. Any suggestions will be helpful. Thank you.
Operating system : windows 10, 64bit
Arduino ide version : 1.8.15
Esp32 library : 1.0.6
We don't read photos. There is a "copy errors" button on the IDE. Click on that and your errors will be copied to your clipboard. Then post the error text here.
Im having trouble compiling code for esp32 board. I have chose sample code from examples but that too is giving error I suspect some problem with esp32 board Library. Also want to mention that I have installed latest library and tried various old Arduino ide but same problem is coming. Any suggestions will be helpful. Thank you.
Operating system : windows 10, 64bit
Arduino ide version : 1.8.15
Esp32 library : 1.0.6
code:
/*
This sketch demonstrates how to scan WiFi networks.
The API is almost the same as with the WiFi Shield library,
the most obvious difference being the different file you need to include:
*/ #include "WiFi.h"
void setup()
{
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
}
void loop()
{
Serial.println("scan start");
// WiFi.scanNetworks will return the number of networks found
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n == 0) {
Serial.println("no networks found");
} else {
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i) {
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
delay(10);
}
}
Serial.println("");
// Wait a bit before scanning again
delay(5000);
This sketch demonstrates how to scan WiFi networks.
The API is almost the same as with the WiFi Shield library,
the most obvious difference being the different file you need to include:
*/ #include "WiFi.h"
void setup()
{
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
}
void loop()
{
Serial.println("scan start");
// WiFi.scanNetworks will return the number of networks found
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n == 0) {
Serial.println("no networks found");
} else {
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i) {
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
delay(10);
}
}
Serial.println("");
// Wait a bit before scanning again
delay(5000);
first of all
You should post code by using code-tags
The following method can be used with the Arduino-IDE NOT with some kind of Arduino Web-editor.
Your code should be a single code-section
otherwise it is a lot of work to get the code copied.
And even worse the small thing that causes the error could vanish by these mutliple code-sections
There is an automatic function for doing this in the Arduino-IDE
just three steps
press Ctrl-T for autoformatting your code
do a rightclick with the mouse and choose "copy for forum"
paste clipboard into write-window of a posting
Then you should activate ALL compilerwarnings in the preferences of the Arduino-IDE
@jenishthumar
I have found yet another duplicate post from you in another section. I have given you a break from the forum to give you time to read and understand How to get the best out of this forum