예제 #1
0
파일: net.py 프로젝트: rskew/autofarm
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()
예제 #2
0
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()