OSError when connecting to LTE



  • 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



  • 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.



  • 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



  • 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


Log in to reply
 

Pycom on Twitter