Esempio n. 1
0
def stop_ap():
    global isActive, GPIO_LED
    stop_led(GPIO_LED)
    t2 = threading.Thread(target=ap_to_client_mode)
    t2.start()
    t2.join()
    isActive = 0  # measurement shall stop next time
    isMaintenanceActive = setStateToStorage('isMaintenanceActive', False)
Esempio n. 2
0
def stop_ap(boot=0):
    global isActive, GPIO_LED
    isActive = 0  # measurement shall stop next time
    if not boot:
        print("Maintenance Mode: STOP")
    stop_led()
    GPIO.output(GPIO_LED, GPIO.LOW)
    t2 = threading.Thread(target=ap_to_client_mode)  #ap_to_client_mode()
    t2.start()
Esempio n. 3
0
def button_pressed_falling():
    global time_rising, debug
    time_falling = miliseconds()
    time_elapsed = time_falling - time_rising
    time_rising = 0  # reset to prevent multiple fallings from the same rising
    MIN_TIME_TO_ELAPSE = 500  # miliseconds
    MAX_TIME_TO_ELAPSE = 3000
    stop_led()
    if time_elapsed >= MIN_TIME_TO_ELAPSE and time_elapsed <= MAX_TIME_TO_ELAPSE:
        toggle_measurement()
    elif time_elapsed >= 5000 and time_elapsed <= 10000:
        shutdown()
    elif time_elapsed >= 10000 and time_elapsed <= 15000:
        delete_settings()
        shutdown()
    elif debug:
        error_log(
            "Info: Too short Button press, Too long Button press OR inteference occured: "
            + str(time_elapsed) + "ms elapsed.")