import asyncdispatch, options import types, vars import nmqtt proc initMqtt* () {.async.} = try: var config = server.config.serverConfig.mqtt.get mqttContext = newMqttCtx("smartied") mqttContext.set_host(config.host, config.port) await mqttContext.start() except: echo "Error[initMqtt]:\n", getCurrentExceptionMsg() quit()