Arduino MQTT lots of bugs

have a look at this code by @adam Battery Powered ESP8266 Temperature/Humidity Monitor with DHT11