   matrix.writeDisplay();
   delay(200);
 
-  // can't connect wifi in here
-  //wifi_connect();
+  int Attempt = 0;
+  while (WiFi.status() != 3) {
+    delay(100);
+    Attempt++;
+    if (Attempt == 150) {
+      goingToSleepWithFail();
+    }
+  }
+  
+  matrix.fillRect(2, 2, 4, 4, LED_ON);
+  matrix.writeDisplay();
+  delay(200);
 
   clientName += "esp8266-";
   uint8_t mac[6];

// ****************
const char* ssid = WIFI_SSID;
const char* password = WIFI_PASSWORD;
int32_t channel = WIFI_CHANNEL;
byte mqtt_server[] = MQTT_SERVER;
//
byte ip_static[] = IPSET_STATIC;
byte ip_gateway[] = IPSET_GATEWAY;
byte ip_subnet[] = IPSET_SUBNET;
byte ip_dns[] = IPSET_DNS;
// ****************

char* topic = "esp8266/cmd/light";

unsigned long subMills = 0;

long lastReconnectAttempt = 0;

WiFiClient wifiClient;
PubSubClient client(mqtt_server, 1883, callback, wifiClient);
