Added MQTT, more tweaks and debugging.