Skip to content

Instantly share code, notes, and snippets.

@sticilface
Last active November 21, 2015 22:13
Show Gist options
  • Save sticilface/95eb559b8f4f7bff066e to your computer and use it in GitHub Desktop.
Save sticilface/95eb559b8f4f7bff066e to your computer and use it in GitHub Desktop.
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
const char* ssid = "...";
const char* password = "...";
WiFiClientSecure * pclient;
void setup() {
Serial.begin(115200);
Serial.setDebugOutput(true);
WiFi.mode(WIFI_STA);
delay(5000);
Serial.println();
Serial.print("connecting to ");
Serial.println(ssid);
if (WiFi.SSID() != ssid) {
WiFi.begin(ssid, password);
}
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
// configure time
configTime(3 * 3600, 0, "pool.ntp.org");
delay(5000);
Serial.printf("HEAP = %u\n",ESP.getFreeHeap());
delay(5000);
pclient = new WiFiClientSecure;
Serial.println("WifiClient Loaded");
Serial.printf("HEAP = %u\n",ESP.getFreeHeap());
}
void loop() {
// put your main code here, to run repeatedly:
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment