Skip to content

Instantly share code, notes, and snippets.

@kentaylor
kentaylor / ConnectionTestLoop.ino
Created November 24, 2016 19:11
Arduino code to test how long ESP8266 takes to connect to WiFi at power up.
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
#include <WiFiManager.h> //https://github.com/kentaylor/WiFiManager
const unsigned long ONE_SECOND = 1000 * 1000;
int start;
int now;
int codeTime;
IPAddress ip= IPAddress(192,168,1,27);
IPAddress gw= IPAddress(192,168,1,1);
IPAddress subnet= IPAddress(255,255,255,0);
@kentaylor
kentaylor / ConnectionTest.ino
Last active November 22, 2016 23:04
Arduino code to test how long ESP8266 takes to connect to WiFi
IPAddress ip= IPAddress(192,168,1,27);
IPAddress gw= IPAddress(192,168,1,1);
IPAddress subnet= IPAddress(255,255,255,0);
IPAddress dns= IPAddress(192,168,1,1);
static struct station_config conf;
char mac[18] = { 0 };
void setup() {
start = millis();
WiFi.config(ip,gw,subnet, dns);
if (WiFi.SSID()=="") WiFi.begin("SSID","password");