Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    FiPy and NB-IoT with new Pycom/Vodafone SIM

    Scheduled Pinned Locked Moved FiPy
    1 Posts 1 Posters 66 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      patmolloy
      last edited by

      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")
      
      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom