Update mqtt_publisher.py for first connection and reconnection