Fipy CANNOT connect to Pybytes using Verizon LTE



  • Hi,

    I have tried to activate my Fipy1.0 with ExpansionBoard 3.1 over Verizon LTE using an activation string auto-generated from the Pybytes platform. I got the errors below.

    >>> pybytes_config = PybytesConfig().read_config()
    >>> from _pybytes import Pybytes
    >>> pybytes = Pybytes(pybytes_config)
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'}
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'}
    WMAC: 840D8E120404
    Firmware: 1.20.2.r1
    Pybytes: 1.6.0
    >>> pybytes.activate("eyJjYXJyaWVyIjoidmVyaXpvbiIsImJhbmQiOjEzLCJjaWQiOjMsImFwbiI6ImludGVybmV0IiwidHlwZSI6IklQIiwicmVzZXQiOmZhbHNlLCJhIjoiYmViMWU1NGUtZTQ0My00Y2Y2LWJmY2EtZjljZjc0MDA5OTgxIn0=")
    Disconnecting current connection!
    self.__connection_status=0 | self.__network_type=None
    Already disconnected
    {'reset': False, 'carrier': 'verizon', 'apn': 'internet', 'cid': 3, 'band': 13, 'type': 'IP', 'a': 'beb1e54e-e443-4cf6-bfca-f9cf74009981'}
    performing LTE activation
    LTE init(carrier=verizon, cid=3)
    LTE attach(band=13, apn=internet, type=IP)
    LTE connect()
    LTE is_connected()
    LTE connection established
    Failed to send activation request!
    [Errno 113] ECONNABORTED
    Exception during WiFi cli activation!
    'NoneType' object has no attribute 'status_code'
    Activation failed!
    >>>
    

    I have also tried in REPL. Seems like I can resolve IP of Google, but unable to establish a connection. Please see the errors below.

    >>> import socket
    >>> import ssl
    >>> import time
    >>> from network import LTE
    >>> import pycom
    >>> lte = LTE(carrier="verizon")
    >>> lte.attach()
    >>> lte.connect(cid=3)
    >>> sockaddr = socket.getaddrinfo('www.google.com', 443)
    >>> print("socket address: {}".format(sockaddr))
    socket address: [(2, 1, 0, '', ('142.250.64.132', 443))]
    >>> s = socket.socket()
    >>> s.connect(sockaddr[0][-1])
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: [Errno 113] ECONNABORTED
    >>>
    

    Anyone could help or give some hints? I got stuck on this for days and tried almost everything I could find on this forum. The modem firmware is the last version.



  • @Mao
    Update.

    I found the reason why my Fipy kept disconnect and reconnect to REPL.

    I have used improper LTE antenna (Molex 824-2170MHz). After changing to an ultra-wideband antenna (TAOGLAS FXUB63), my device never disconnected from REPL anymore.

    I still cannot create a socket to connect to google.

    >>> import socket
    >>> from network import LTE
    >>> lte = LTE(carrier="verizon")
    >>> lte.isattached()
    False
    >>> lte.attach()
    >>> lte.isattached()
    True
    >>> lte.connect(cid=3)
    >>> lte.isconnected()
    True
    >>> sockaddr = socket.getaddrinfo('www.google.com', 80)
    >>> s = socket.socket()
    >>> s.connect(sockaddr[0][-1])
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: [Errno 113] ECONNABORTED
    >>>
    


  • Thank you, Gijs.

    I had tried both port 80 without SSL and port 443 using SSL. both returned me the same error. lte.isattached() returns me True.

    Now I'm facing a new problem:
    Every time after I tried to attach or connect the LTE, Fipy disconnected from the REPL and then reconnected and kept doing this for every half minute. I tried to reset the modem but didn't help. I felt I have destroyed something hardwarely... I will try to re-flash the firmware.

    >>> import socket
    >>> from network import LTE
    >>> lte = LTE(carrier="verizon")
    >>> lte.isattached()
    True
    >>> lte.attach()
    >>> lte.isattached()
    True
    >>> lte.connect(cid=3)
    >>> > Failed to connect (Error: Port is not open). Click here to try again.
    Connecting to COM13...
    

  • Global Moderator

    Hi,
    I do not see you checking lte.isattached() in the second flow.. It might take a while before the LTE connection attaches and connects. Other than that, the LTE version you are using (I believe its CAT M1) might not support the SSL (https socket 443), causing the ECONNABORTED

    Best,
    Gijs


Log in to reply
 

Pycom on Twitter