@@ -0,0 +1,500 @@
+#!/usr/bin/python%0A%0Aimport RPi.GPIO as GPIO%0Aimport time%0Aimport atio%0Aimport atftp%0A%0APOWER_PIN = 12%0ACMD_AT = %5B%22AT%22,%22OK%22%5D%0A%0Adef toggle_button(on):%0A    if on != is_power_on():%0A        GPIO.setwarnings(False)%0A        GPIO.setmode(GPIO.BOARD)%0A        GPIO.setup(POWER_PIN, GPIO.OUT)%0A        GPIO.output(POWER_PIN, True)%0A        time.sleep(2)%0A        GPIO.output(POWER_PIN, False)%0A%0Adef is_power_on():%0A    response = atio.send_cmd(CMD_AT, 0.5)%0A    if response is not False:%0A        return True%0A    return False%0A

Create common.py