示例#1
0
a = SER.send('\r\n- wait for connection to network ----------------\r\n')
r = FUNC.openGPRS(conf['PIN_SIM'],conf['APN'],conf['GPRS_USER'],conf['GPRS_PASS']) #openGPRS(P,A,GU,GP)
a = FUNC.setGPIO(CONFIG.statLED,1)
a = SER.send('\r\n\r\n- wait for data input ----------------\r\n')

# start Schleife --------------------------------------------------------
while 1:
    a = FUNC.setGPIO(CONFIG.statLED,0)
    MOD.sleep(10)
    a = FUNC.setGPIO(CONFIG.statLED,1)
    MOD.sleep(10)
    b = SER.send('\r\nYou have 10 seconds to put something in.\r\n')
    MOD.sleep(10)

    res = SER.receive(100)
    MOD.sleep(10)

    if ( res != '' ):
        data = conf['PREF'] + '=' + str(res)
        MOD.sleep(10)
        lang = len(data)
        r = FUNC.sendData(conf['PIN_SIM'],conf['POST'],conf['HOST'],conf['APN'],conf['GPRS_USER'],conf['GPRS_PASS'],data,lang)
        


a = SER.send('\r\n\r\n***************************************************************************')
a = SER.send('\r\n*                             END of script                                   *')
a = SER.send('\r\n***************************************************************************\r\n')