Im trying to use my esp32 to send some data into the database (I was previously using esp8266 for this but it has some issues with my i2c sensor so Im trying to switch to esp32). Im stuck at very first step, it cannot connect to my wifi network! Ive serched but there is no typo and it finds the network without problem with WiFiScan but once I try to connect to it, it doesent work. I can connect to same network with my esp8266 without any problems so Im wondering whats the issue here?
Code: Select all
#include <Arduino.h>
#include <WiFi.h>
void setup() {
Serial.begin(115200);
WiFi.begin("xxxxxxxxx", xxxxxxxx");
// Wait for wifi to be connected
uint32_t notConnectedCounter = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(100);
Serial.println("Wifi connecting...");
notConnectedCounter++;
if(notConnectedCounter > 150) { // Reset board if not connected after 5s
Serial.println("Resetting due to Wifi not connecting...");
ESP.restart();
}
}
Serial.print("Wifi connected, IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
}