Brownout when turning on wifi
Posted: Thu Oct 05, 2017 5:44 am
I am trying to write my own control version but i am running into a problem when turning on the wifi. My code mostly looks like this:
[code]
void setupWIFI() {
#ifdef USE_WIFI
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to Wifi");
for(int attempt = 0; attempt < 5 && WiFi.status() != WL_CONNECTED; attempt ++) {
delay(1000);
Serial.print(".");
}
if(WiFi.status() == WL_CONNECTED) {
Serial.println("OK");
} else {
Serial.println("NOK");
reconnect();
}
#else
Serial.println("WIFI disabled");
#endif
}
[/code]
And then in the setup i am calling this function. I use these libraries:
#include <WiFi.h>
#include <HTTPClient.h>
However when i run the code on the unit i get the message:
Brownout detector was triggered
And it just restarts. Is there something i missed?
[code]
void setupWIFI() {
#ifdef USE_WIFI
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to Wifi");
for(int attempt = 0; attempt < 5 && WiFi.status() != WL_CONNECTED; attempt ++) {
delay(1000);
Serial.print(".");
}
if(WiFi.status() == WL_CONNECTED) {
Serial.println("OK");
} else {
Serial.println("NOK");
reconnect();
}
#else
Serial.println("WIFI disabled");
#endif
}
[/code]
And then in the setup i am calling this function. I use these libraries:
#include <WiFi.h>
#include <HTTPClient.h>
However when i run the code on the unit i get the message:
Brownout detector was triggered
And it just restarts. Is there something i missed?