#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
const char* ssid = "ssid name";
const char* password = "ssid password";
// Socket Server
const char* host = "esp8266.hoyo.idv.tw";
const int port = 3003;
// Use web browser to view and copy SHA1 fingerprint of the certificate
const char fingerprint[] PROGMEM = "24 42 DB E8 31 4E 1E C4 EB 4D 78 B4 EB 74 D0 D1 F0 2D 96 44";
// Use WiFiClientSecure class to create TLS connection
WiFiClientSecure client;
void(* resetFunc) (void) = 0;
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println(".");
}
delay(500);
Serial.printf("Using fingerprint '%s'\n", fingerprint);
client.setFingerprint(fingerprint);
}
//
void loop() {
//
if (!client.connected()) {
client.connect(host, port);
Serial.println("connected");
}
}