#!/usr/bin/python import time import serial ser = serial.Serial('/dev/ttyS1', 2400) cycle = 0 while(1): print "Cycle %i" % (cycle) ser.write("KOD\r\n") time.sleep(2) ser.write("KOE\r\n") time.sleep(2 * 60) cycle += 1