I have an ESP32-Cam board and I am trying to get started...
I tried loading the basic "connect to wifi" project, but my board is unable to connect.
I modified the project to first list the SSID, and I can SEE the SSID I want to connect to, but Wifi.begin(ssid, password) never connects.
My code first lists local networks, and indicate the strength and security type.
The ssid of interest "hpmad3" shows: -88 dB and security type 3 (WPA2 I think)
I then attempt to connect, but the status returns 6 (WL_DISCONNECTED) forever...
What am I missing?
Thanks,
Cyrille
Here is the code:
#include <WiFi.h>
void setup()
{
Serial.begin(115200);
while(!Serial){delay(100);}
Serial.println("******************************************************");
WiFi.setHostname("scope");
int n = WiFi.scanNetworks();
if (n == 0) {
Serial.println("[-] No WiFi networks found");
} else {
Serial.println((String)"[+] " + n + " WiFi networks found\n");
for (int i = 0; i < n; ++i)
{
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(" dB) ");
Serial.println(WiFi.encryptionType(i));
delay(10);
}
}
Serial.println("");
WiFi.begin("hpmad3", "blablabla");
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
Serial.print(WiFi.status());
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop(){
delay(1000);
}
I moved your topic to a more appropriate forum category @brebisson.
The Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.
In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.
After doing the suggested change, things are progressing...
My ESP32 seems to be connecting to wifi : an IP address is assigned...
I do get the following message from the device:
But, then, when I move on to the next step, the camerWebServer application, although it DOES seem to connect to wifi, I can not connect to the ESP from my web brower...
WiFi connected
Camera Ready! Use 'http://192.168.1.165' to connect
But pointing a browser to this address leads to an everlasting wait (but no error messages!)
That seems another kind of problem, that I didn´t face before.
Are you feeding the board with 5V?
What I would do is uploading the example that takes pictures and store them into the SD card, in order to see if the camera is operating properly.
And indeed, it seems to work. On all cpu wakeup, it takes a picture and saves it to flash...
So my probem really seems to be the Wifi part of things...
Any clue why this would not work?
Note: I did try powering directly the board form a USB charger in case it was a power issue...
But this did not change anything. Anyhow, in Wifi mode, the power consumption seems to be in the 250mA range, which is no problem for a USB port directly on the PC (not through a hub).
Well, I don´t remember hearing any kind of noise while wi-fi was active. But all my hypothesis about the problems you´ve described before have gone. So, if you succeed using the new board with the same assembly/sketch, let us know.
no moving parts, hence should be no sound, ever, forget wifi, never ever..
had really good hearing, could hear caps whistling, chips chirping..
did repairs but it was tubes and thru hole..
you know, you only try to connect once and give up..
try this sketch..
more to test the wifi connecting, it keeps trying to connect every 15 seconds..
but yeah, kind of thinking something not right with your board, sorry..
part of something i'm working on using espcams..