8x8 Matrix wake up from deep sleep and all the led's turn ON.

I’am using 2 ESP8266, this is the server, when it gets the Smode=8888 from the client goes to deepsleep and is supose to wake up just when i press RST button but after some time, i think after 4 h. the matrix start glowing full.

/code
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <LedControl.h>
int DIN=D5;
int CS=D6;
int CLK=D7;
bool ok=true;
int steps=0;
byte q1[8]= {0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,};
byte q2[8]= {0x00,0x00,0x3C,0x24,0x24,0x3C,0x00,0x00,};
byte q3[8]= {0x00,0x7E,0x42,0x42,0x42,0x42,0x7E,0x00,};
byte q4[8]= {0xFF,0x81,0x81,0x81,0x81,0x81,0x81,0xFF,};
byte q5[8]= {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01,};
byte q6[8]= {0x81,0x42,0x24,0x18,0x18,0x24,0x42,0x81,};
byte q7[8]= {0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,};
byte smile[8]= {0x00,0x66,0x66,0x00,0x00,0x42,0x3C,0x00,};

//sleep:
byte s1[8]= {0x00,0xE8,0xA8,0x88,0xE8,0x28,0x28,0xEF,};
byte s2[8]= {0x00,0xD0,0x50,0x10,0xD0,0x50,0x50,0xDE,};
byte s3[8]= {0x00,0xA0,0xA1,0x21,0xA1,0xA1,0xA1,0xBC,};
byte s4[8]= {0x00,0x40,0x43,0x42,0x43,0x42,0x43,0x78,};
byte s5[8]= {0x00,0x80,0x86,0x84,0x86,0x84,0x86,0xF0,};
byte s6[8]= {0x00,0x00,0x0D,0x09,0x0D,0x09,0x0D,0xE0,};
byte s7[8]= {0x00,0x00,0x1B,0x12,0x1B,0x12,0x1B,0xC0,};
byte se8[8]= {0x00,0x00,0x36,0x24,0x36,0x24,0x36,0x80,};
byte s9[8]= {0x00,0x01,0x6D,0x49,0x6D,0x49,0x6D,0x01,};
byte s10[8]= {0x00,0x03,0xDA,0x92,0xDB,0x92,0xDA,0x02,};
byte s11[8]= {0x00,0x06,0xB5,0x25,0xB6,0x24,0xB4,0x04,};
byte s12[8]= {0x00,0x0C,0x6A,0x4A,0x6C,0x48,0x68,0x08,};
byte s13[8]= {0x00,0x18,0xD4,0x94,0xD8,0x90,0xD0,0x10,};
byte s14[8]= {0x00,0x18,0x94,0x14,0x98,0x10,0x90,0x10,};
byte s15[8]= {0x81,0x99,0x95,0x95,0x99,0x91,0x91,0x91,};
byte se16[8]= {0x42,0x5A,0x56,0x56,0x5A,0x52,0x52,0x52,};
byte s17[8]= {0x24,0x3C,0x34,0x34,0x3C,0x34,0x34,0x34,};
byte s18[8]= {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,};
// on:
byte ON[8]= {0x60,0x90,0x90,0x90,0x69,0x0D,0x0B,0x09,};

int timp= 180;
int timp1=270;

LedControl lc=LedControl( DIN,CLK,CS,0);
void printByte(byte ch ){
int i=0;
for(i;i<8;i++){
lc.setRow(0,i,ch*);*
}
}
char * ssid_ap = “ADI_SSID”;
char * password_ap = “123qwe123”;
IPAddress ip(192,168,11,4);
IPAddress gateway(192,168,11,1);
IPAddress subnet(255,255,255,0);
ESP8266WebServer server;
float sensor_value = 0.0;
float Sleepmode=0.0;
void setup() {

  • Serial.begin(115200);*

  • lc.shutdown(0,false);*

  • lc.setIntensity(0,15);*

  • lc.clearDisplay(0);*

  • WiFi.mode(WIFI_AP);*

  • WiFi.softAPConfig(ip,gateway,subnet);*

  • WiFi.softAP(ssid_ap,password_ap);*

  • Serial.begin(115200);*

  • Serial.print("IP Address: "); Serial.println(WiFi.localIP());*

  • server.on("/",handleIndex);*

  • server.on("/update",handleUpdate);*

  • server.on("/sleep",handleSleep);*

  • server.begin();*

  • printByte(ON);*

  • delay(1500);*
    }
    void loop() {

  • server.handleClient();*

}
void handleIndex() {

  • server.send(200,“text/plain”,String(sensor_value));*
    }
    void handleSleep(){
    Sleepmode=server.arg(“Smode”).toFloat();
    Serial.print("Smode= ");
    Serial.println(Sleepmode);
    if(Sleepmode>8886){

  • Serial.println(“Going to sleep server here…”);*

  • printByte(s1);*

  • delay(timp1);*

  • printByte(s2);*

  • delay(timp1); *

  • printByte(s3);*

  • delay(timp1); *

  • printByte(s4);*

  • delay(timp1); *

  • printByte(s5);*

  • delay(timp1); *

  • printByte(s6);*

  • delay(timp1); *

  • printByte(s7);*

  • delay(timp1); *

  • printByte(se8);*

  • delay(timp1); *

  • printByte(s9);*

  • delay(timp1); *

  • printByte(s10);*

  • delay(timp1); *

  • printByte(s11);*

  • delay(timp1);*

  • printByte(s12);*

  • delay(timp1); *

  • printByte(s13);*

  • delay(timp1); *

  • printByte(s14);*

  • delay(timp1); *

  • printByte(s15);*

  • delay(timp1); *

  • printByte(se16);*

  • delay(timp1);*

  • printByte(s17);*

  • delay(timp1); *

  • printByte(s18);*

  • delay(timp1); *

  • lc.clearDisplay(0);*

  • WiFi.disconnect();*

  • wifi_set_sleep_type(LIGHT_SLEEP_T);*

  • ESP.deepSleep(0);*

  • delay(1000);*

  • }*
    }
    void handleUpdate() {

  • sensor_value = server.arg(“value”).toFloat();*

  • Serial.print("sensor_value= ");*

  • Serial.println(sensor_value);*

  • if(sensor_value>100){*

  • lc.clearDisplay(0);*

  • }*

  • else {*

  • printByte(q1);*

  • delay(timp);*

  • printByte(q2);*

  • delay(timp);*

  • printByte(q3);*

  • delay(timp);*

  • printByte(q4);*

  • delay(timp);*

  • printByte(q4);*

  • delay(timp);*

  • printByte(q3);*

  • delay(timp);*

  • printByte(q2);*

  • delay(timp);*

  • printByte(q1);*

  • delay(timp);*

  • printByte(q5);*

  • delay(timp+200);*

  • printByte(q6);*

  • delay(timp+200);*

  • lc.clearDisplay(0);*

  • delay(300);*

  • } *

}

Please use the tool to declare codes.

And then go back and edit your post to include those code tags