ESP8266 freeze over time

So when it hangs, what is the point it hangs? You got quite some Serial.print statements there.

Also I notice this odd construction, coming back a few times:

  pubString = String(floodState);
  pubString.toCharArray(message_buff, pubString.length()+1);

Why not using sprintf or ftoa for a direct coversion? The String class may be causing the hanging