Exemple #1
0
 def initial_display(self):
     print("Initial display process")
     try:
         self.TFT.initLCD(self.config.getint("GPIO", "DC"), self.config.getint("GPIO", "RST"),
                          self.config.getint("GPIO", "LED"), ce=1)
         self.TFT.clear((255, 255, 255))
     except Exception, e:
         Log.new(Log.ERROR, "Initial display process error : " + str(e))
Exemple #2
0
 def initial_display(self):
     print("Initial display process")
     try:
         self.TFT.initLCD(self.config.getint("GPIO", "DC"),
                          self.config.getint("GPIO", "RST"),
                          self.config.getint("GPIO", "LED"),
                          ce=1)
         self.TFT.clear((255, 255, 255))
     except Exception, e:
         Log.new(Log.ERROR, "Initial display process error : " + str(e))
Exemple #3
0
 def init_ip(self):
     try:
         s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
         s.connect(("gmail.com", 80))
         self.ip = s.getsockname()[0]
         s.close()
     except Exception, e:
         self.ip = "No Internet connection"
         Log.new(Log.ERROR, "failed to find ip address")
         print(e)
Exemple #4
0
 def init_ip(self):
     try:
         s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
         s.connect(("gmail.com", 80))
         self.ip = s.getsockname()[0]
         s.close()
     except Exception, e:
         self.ip = "No Internet connection"
         Log.new(Log.ERROR, "failed to find ip address")
         print(e)
    def exit_application():
        database.set_app_running(False)
        Log.new(Log.DEBUG, "###  Exit application! ###")
        Relay.clear_relay()

        print("Exiting....")
        print("Current App Status = " + str(database.get_app_running()))
        print("##########################")
        print("####### Clear relay ######")
        print("##########################")
        print("#######  Goodbye !!#######")
        print("##########################")
Exemple #6
0
    def exit_application():
        database.set_app_running(False)
        Log.new(Log.DEBUG, "###  Exit application! ###")
        Relay.clear_relay()

        print("Exiting....")
        print("Current App Status = " + str(database.get_app_running()))
        print("##########################")
        print("####### Clear relay ######")
        print("##########################")
        print("#######  Goodbye !!#######")
        print("##########################")
Exemple #7
0
 def clear_relay():
     Log.new(Log.DEBUG, "Clear relay!")
     for relay in Relay.get_relay_object_list():
         Relay.set_force_on(relay.get_object_id(), Relay.FORCE_DISABLE)
         relay.turn_off()
     GPIO.cleanup()
Exemple #8
0
 def turn_off(self):
     if self.gpio is None:
         print("Error can't not found GPIO")
     else:
         GPIO.output(self.gpio, GPIO.LOW)
         Log.new(Log.DEBUG, "Turn Off! > " + self.name + " <   at gpio = " + str(self.gpio))