def initialise(): # event.add_timer_handler(net_led_handler, 100) # 10 Hz Thread(target=net_thread).start() parameter = configuration.main.parameter if parameter("services_enabled"): import aiko.services as services services.initialise() else: import aiko.mqtt aiko.mqtt.initialise()
def net_manager(): global led_color parameter = configuration.main.parameter while not wifi_connect(): sleep(0.5) led_color = led.blue if parameter("services_enabled"): import aiko.services as services services.initialise() else: mqtt.initialise() led_color = led.green while True: mqtt.client.wait_msg()