FiPy and NB-IoT with new Pycom/Vodafone SIM



  • I have one of the new Sims. I have updated both the main firmware and the sequans firmware to the latest versions (sequans NB-IoT code). I have registered the sim in PyBytes and I think it all looks alive and good. The following code appears to suggest that the basic connectivity is there, but I get the following error .. can anyone help? It does look like that attach and connect are working!

    >>> Running selected lines
    
    >>> 
    >>> 
    Apparently attached
    Apparently connected
    Traceback (most recent call last):
      File "<stdin>", line 18, in <module>
    OSError: [Errno 113] ECONNABORTED
    >
    

    The code is ..

    import socket
    import ssl
    import time
    from network import LTE
    
    lte = LTE()         # instantiate the LTE object
    lte.attach(band=20, apn="pycom.io")        # attach the cellular modem to a base station
    while not lte.isattached():
        time.sleep(0.25)
    print ("Apparently attached")    
    lte.connect()       # start a data session and obtain an IP address
    while not lte.isconnected():
        time.sleep(0.25)
    print("Apparently connected")
    s = socket.socket()
    # s = ssl.wrap_socket(s)
    s.connect(socket.getaddrinfo('www.observat.io', 80)[0][-1])
    s.send(b"GET / HTTP/1.0\r\n\r\n")
    print(s.recv(4096))
    s.close()
    
    lte.disconnect()
    lte.dettach()
    

    The OSError is on line 18 which is the

    s.send(b"GET / HTTP/1.0\r\n\r\n")
    

Log in to reply
 

Pycom on Twitter