コード例 #1
0
    time.sleep(10)
    exit()

myPID = str(os.getpid())
U.killOldPgm(myPID, G.program +
             ".py")  # kill old instances of myself if they are still running

NSleep = int(sensorRefreshSecs)
if G.networkType in G.useNetwork and U.getNetwork() == 1:
    if U.getIPNumber() > 0:
        print datetime.datetime.now().strftime(
            "%Y%m%d-%H:%M:%S"
        ) + " " + G.program + " no ip number working, giving up"
        time.sleep(10)
        exit()
eth0IP, wifi0IP, G.eth0Enabled, G.wifiEnabled = U.getIPCONFIG()

tt = time.time()
badSensors = {}
lastData = {}
lastMsg = 0
G.tStart = tt
lastregularCycle = tt
lastRead = tt
regularCycle = True
lastData = {}

while True:
    try:
        tt = time.time()
        data = {}
コード例 #2
0
ファイル: myprogram.py プロジェクト: kw123/piBeacon
if U.getIPNumber() > 0:
    U.toLog(-1," myprogram no ip number  exiting ", doPrint =True)
    time.sleep(10)
    exit()


myPID       = str(os.getpid())
U.killOldPgm(myPID,G.program+".py")# kill old instances of myself if they are still running

NSleep= int(sensorRefreshSecs)
if G.networkType  in G.useNetwork and U.getNetwork() == 1: 
    if U.getIPNumber() > 0:
        print datetime.datetime.now().strftime("%Y%m%d-%H:%M:%S")+" "+G.program+" no ip number working, giving up"
        time.sleep(10)
        exit()
eth0IP, wifi0IP, G.eth0Enabled,G.wifiEnabled = U.getIPCONFIG()


tt                  = time.time()
badSensors          = {}
lastData            = {}
lastMsg             = 0
lastAliveSend       = tt
G.tStart            = tt
lastregularCycle    = tt
lastRead            = tt
regularCycle        = True
lastData={}

while True:
    try: