Page 1 of 1

Brownout when turning on wifi

Posted: Thu Oct 05, 2017 5:44 am
by triberraar
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?

Re: Brownout when turning on wifi

Posted: Thu Oct 05, 2017 5:51 am
by triberraar
Hmm switching usb cable helped.
I read somewhere that a high resistance usb cable can have this effect. So i switched to one of my fast charge usb cables, they tend to be a bit better, was using a random usb cable and that one must have been of the very cheap kind.
Sorry for the false alarm.

Re: Brownout when turning on wifi

Posted: Thu Oct 26, 2017 7:56 pm
by stanley
Good to know.

Re: Brownout when turning on wifi

Posted: Thu Apr 12, 2018 6:40 am
by daniel3514
Greetings, I have a Freematics + with the original cable that came in the package and I have exactly the same problem, and probe with a PC and a Mac, with different USB cables, even with a Thunderbolt to USB 3 adapter, and I can not do it function

Re: Brownout when turning on wifi

Posted: Wed Jul 11, 2018 10:33 pm
by stanley
Either connect the unit to OBD port (so powered by DC 12V) or connect USB to a USB hub with power supply, to solve this issue.