This reverts commit 23c726f740. It's better to make mqttclient part of the background loop and use signals/slots
23c726f740