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

    OSError when connecting to LTE

    Scheduled Pinned Locked Moved GPy
    4 Posts 2 Posters 78 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
      Patrick Joy
      last edited by

      Hi all,

      I am having trouble connecting to LTE with my GPy. I have updated the firmware of the GPy and also the firmware of the modem.

      GPy
      Firmware: 1.20.2.r4
      Pybytes: 1.6.1
      
      Modem
      UE5.2.0.3
      LR5.2.1.0-48829
      

      I am based in Australia and have a sim card for Telstra's LTE CAT M1 network.

      When I try to connect to LTE manually or using Pybytes I get an OSError

      Manual

      >>> from network import LTE
      >>> lte = LTE()
      >>> lte.attach(band=28, apn="telstra.extranet")
      >>> lte.connect()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      OSError: the requested operation failed
      >>>
      

      Pybytes

      Config

      {"wifi": {"ssid": "", "password": ""}, "wlan_antenna": 0, "dump_ca": false, "server": "mqtt.pybytes.pycom.io", "ssl": false, "lte": {"apn": "telstra.extranet", "cid": 0, "reset": false, "carrier": "telstra", "band": 28, "type": ""}, "device_id": "", "network_preferences": ["lte"], "ota_server": {"port": 443, "domain": "software.pycom.io"}, "pybytes_autostart": true, "username": ""}
      
      Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms
      Please review Wifi SSID and password inside config
      Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms
      Exception connect_lte: the requested operation failed
      Traceback (most recent call last):
        File "_pybytes_connection.py", line 210, in connect_lte
      OSError: the requested operation failed
      ERROR! Could not connect to Pybytes!
      

      Any ideas? Do I need a "type" in the LTE config section?

      Thanks

      1 Reply Last reply Reply Quote 0
      • G Offline
        Gijs
        last edited by

        In your manual operation, please first wait for the modem to attach by checking lte.isattached(). This should equal True before calling lte.connect()

        Next, in the pybytes connection, could you enable the debugging as following:

        import pycom
        pycom.nvs_set('pybytes_debug', True)
        

        Best,
        Gijs

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          Patrick Joy @Gijs
          last edited by

          Hi @Gijs

          Thanks for your reply.

          I discovered that if I turn off pybytes_on_boot I can then manually connect LTE and manually connect pybytes and everything works ok from that point on. I'm not sure why this is the case but I have a solution!

          Patrick

          1 Reply Last reply Reply Quote 1
          • G Offline
            Gijs
            last edited by

            To be honest, I couldn't tell you either why that works, but Im happy for you it does! In the end it should just be the same code.

            1 Reply Last reply Reply Quote 1

            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