lte.isattached() is always false



  • Anyone suggest why lte.isattached() is always false..we are using telstra nework if that helps. Has the latest dev firmware 1.20... using the fipy

    import time
    import machine
    from network import LTE

    wait_time = 1

    def wait():
    print("Waiting {}".format(wait_time))
    time.sleep(wait_time)

    lte = LTE()

    print("Resetting ... ", end='')
    reply = lte.send_at_cmd('AT^RESET')
    print("DONE: {}".format(reply))
    wait()

    carrier = 'Telstra Mobile'

    def status():
    print("")
    print("Status")
    print(lte.send_at_cmd("ATI"))
    print(lte.send_at_cmd('AT!="showphy"'))
    print(lte.send_at_cmd('AT!="fsm"'))
    print("
    ")

    def do(command, sleep_time):
    print("Sending: {}.".format(command))
    response = lte.send_at_cmd(command)
    print("Response: {}".format(response))
    wait()
    return response

    def getLTE():
    if lte.isconnected(): return lte
    if not lte.isattached():
    print('attaching ', end=''); lte.attach()
    while not lte.isattached(): print('.', end=''); time.sleep(1)
    if not lte.isconnected():
    print('connnecting ', end=''); lte.connect()
    while not lte.isconnected(): print('.', end=''); time.sleep(1)
    return lte

    do('AT+CGDCONT=1,"IP","telstra.m2m"', 1)

    do('AT!="addscanfreq band=28 dl-earfcn=9410"', 1) # in place of: lte.attach(band=28)

    do('AT+CFUN=1', 1)

    getLTE()

    do('AT+COPS=?', 1)
    result = do('ATI', 1)

    r=requests.get('http://micropython.org/ks/test.html'); print(r.text)
    lte.disconnect()


Log in to reply
 

Pycom on Twitter