Esp8266 connection after update

Hi i have an ESP8266 with a small program to drive 2 servo motors to feed my fish. Then it use to connect to Iftt.com which would send me an email. All was working fine until i did an update im connected to the wifi but it will not connect to iftt.com any more. i have missed something but not sure what it is. Is there anyone out there that can help me or just steere me in the right direction ? please see below

#include <TimeLib.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <WiFiClientSecure.h>
#include <Servo.h>

Servo myservo;

int pos = 1; // variable to store the servo position
unsigned long timer; // the timer
unsigned long INTERVAL = 600000; // 10mins = 600000 1hour = 3600000 12hr = 43200000
const char* ssid = “Network”;
const char* password = "*****";
const char
host = “maker.ifttt.com”;
const int httpsPort = 443;

void setup() {
Serial.begin(9600);
Serial.println();
Serial.print(“connecting to “);
Serial.println(ssid);
WiFi.begin(ssid, password);
// WiFi.mode(WIFI_STA);
while (WiFi.status() != WL_CONNECTED) {
delay(5000);
Serial.print(”.”);
}
Serial.println("");
Serial.println(“WiFi connected”);
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

WiFiClientSecure client;
Serial.print("connecting to ");
Serial.println(host);
delay(10000); this is when the problem starts??? :o
if (!client.connect(host, httpsPort)) {
Serial.println(“connection failed”);
return;
}
String url = “/trigger/Fish Feeder Reset/with/key/************”;
Serial.print("requesting URL: ");
Serial.println(url);
client.print(String("GET “) + url + " HTTP/1.1\r\n” +
"Host: " + host + “\r\n” +
“User-Agent: BuildFailureDetectorESP8266\r\n” +
“Connection: close\r\n\r\n”);
Serial.println(“request sent”);
while (client.connected()) {
String line = client.readStringUntil(’\n’);
if (line == “\r”) {
Serial.println(“headers received”);
break;
}
}
String line = client.readStringUntil(’\n’);

Serial.println(“reply was:”);
Serial.println("==========");
Serial.println(line);
Serial.println("==========");
Serial.println(“closing connection”);

myservo.attach(2); // attaches the servo on pin GIO2 to the servo
Serial.begin(9600);
while (!Serial);

for (pos = 1; pos <= 45; pos += 1) { // goes from 0 degrees to 45 degrees in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 10ms for the servo to reach the position
}
for (pos = 45; pos >= 1; pos -= 1) { // goes from 45 degrees to 0 degrees in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 10ms for the servo to reach the position
}
setTime(3, 56, 30, 29, 12, 2018); // set the current time to 18:00:00, September 3rd, 2018
Serial.println(“Fish Feeder Reset”);
timer = millis(); // start timer
}

void loop()
{
if ((millis()-timer) > INTERVAL) {// timed out
timer += INTERVAL; // reset timer by moving it along to the next interval
for (pos = 1; pos <= 45; pos += 1) { // goes from 0 degrees to 45 degrees in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 10ms for the servo to reach the position
}
for (pos = 45; pos >= 1; pos -= 1) { // goes from 45 degrees to 0 degrees in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 10ms for the servo to reach the position
}
{
Serial.println(“Fish Have Been Feed”);
delay(5000);
Serial.println();
Serial.print(“connecting to “);
Serial.println(ssid);
WiFi.begin(ssid, password);
//WiFi.mode(WIFI_STA);
while (WiFi.status() != WL_CONNECTED) {
delay(5000);
Serial.print(”.”);
}
Serial.println("");
Serial.println(“WiFi connected”);
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
WiFiClientSecure client;
Serial.print("connecting to ");
Serial.println(host);
delay(10000)
if (!client.connect(host, httpsPort)) {
Serial.println(“connection failed”);
return;
}
String url = “/trigger/Fish Feed/with/key/*********”;
Serial.print(“requesting URL: “);
Serial.println(url);
client.print(String(“GET “) + url + " HTTP/1.1\r\n” +
“Host: " + host + “\r\n” +
“User-Agent: BuildFailureDetectorESP8266\r\n” +
“Connection: close\r\n\r\n”);
Serial.println(“request sent”);
while (client.connected()) {
String line = client.readStringUntil(’\n’);
if (line == “\r”) {
Serial.println(“headers received”);
break;
}
}
String line = client.readStringUntil(’\n’);
Serial.println(“reply was:”);
Serial.println(”==========”);
Serial.println(line);
Serial.println(”==========”);
Serial.println(“closing connection”);
}
Serial.print("Ok, Time = “);
print2digits(hour());
Serial.write(’:’);
print2digits(minute());
Serial.write(’:’);
print2digits(second());
Serial.print(”, Date (D/M/Y) = ");
Serial.print(day());
Serial.write(’/’);
Serial.print(month());
Serial.write(’/’);
Serial.print(year());
Serial.println();
delay(1000);
}
}
void print2digits(int number) {
if (number >= 0 && number < 10) {
Serial.write(‘0’);
}
Serial.print(number);
}

Try using WiFi.status() to make sure that you are not already connected before running the WiFi.begin(...) instruction. That seems to periodically become a problem.

Also - Check the forum instructions to find out how to properly post code.

Don