Error while connecting pybytes with LTE



  • Hello, I've been able to send signals to pyBytes using wifi connection. When I try it with LTE and NB-IOT even when the LTE is connected I have the following messages

    LTE is_connected()
    LTE connection established
    connect_lte with start_mqtt is now removed please call communication_protocol or start_mqtt directly
    MQTT Protocol
    Socket create error: [Errno 202] EAI_FAIL
    This is PybytesProtocol.start_MQTT
    Socket send error [Errno 128] ENOTCONN
    Socket create error: [Errno 202] EAI_FAIL
    Regards


  • Global Moderator

    It indeed seems to be related to the DNS server not being set correctly by the Vodafone service. You can manually set the DNS server by using:

    import socket;
    socket.dnsserver() #this should return empty
    socket.dnsserver('primary','secondary')
    

    My colleague @Xykon can tell you more about the DNS server IP address. It has to be specific to the pycom servers (so setting 8.8.8.8 as the dns server should not work)

    Best,
    Gijs



  • @Gijs Hi, the modem firmware is LR6.0.0.0-41019 so I think it is correct.
    I still belive the problem is within vodafone side because the AT command to CGCONTRDP is not returning any DNS address. What do you think?

    +CGCONTRDP: 1,5,"pycom.io.MNC028.MCC901.GPRS","10.200.1.108.255.255.255.255","","","","",""


  • Global Moderator

    Hi,
    Can you check for me the modem firmware using the following:

    import sqnsupgrade; sqnsupgrade.info()
    

    The modem firmware should start with LR6.xx for NB-IoT

    Gijs


  • Global Moderator

    Hi,
    Sorry for the slow reply. I have never actually used a Pycom simcard myself, so details might vary.

    The Pycom simcards are purposed to only connect using pycom services (pybytes mqtt), so the DNS request with google could indeed show as an EAI_FAIL error.

    I checked last week with our services and the DNS to pybytes should work as expected. Next to that we have not received any other complaintes on this part. I still believe it is weird the Pybytes mqtt connection is not resolving correctly. Maybe @Xykon can help us out here?

    Gijs



  • @Gijs Hello, the problem I've found is related to DNS, do you know how to handle it?.
    If I use socket.getaddrinfo("google.com", 80)[0][-1]), I obtain the same OSError: [Errno 202] EAI_FAIL

    The same sofware tested with the wifi connection is working fine, so the problem is in the modem side and in the DNS.
    Any idea?



  • @Osquillar
    Below the modem answer to AT+CGCONTRDP:
    +CGCONTRDP: 1,5,"pycom.io.MNC028.MCC901.GPRS","10.200.1.108.255.255.255.255","","","","",""



  • @Gijs said in Error while connecting pybytes with LTE:

    mqtt.pybytes.pycom.io

    Hello Gijs,
    I've tried to connect with mqtt.pybytes.pycom.io in port 1883 and there is no problem if I use a wifi connection but I obtain the same OSError: [Errno 202] EAI_FAIL when I execute the same code with the LTE attached.
    It seems as if the NB-IOT network is not allowing to connect to the internet.
    Any other idea?.


  • Global Moderator

    Are you able to make a manual connection by using:

    from network import LTE
    lte = LTE()
    lte.attach(band=20, apn="pycom.io")
    ...
    

    And then create a socket connection to mqtt.pybytes.pycom.io
    Let me know!
    Gijs



  • Hi,
    In pybytes_config.json file, with "network_preferences": ["lte","wifi"] and "lte": {"apn": "pycom.io", "cid": 1, "reset": false, "carrier": "standard", "band": 20, "type": "IP"}
    I have the following message at any time I try.

    LTE is_connected()
    LTE connection established
    connect_lte with start_mqtt is now removed please call communication_protocol or start_mqtt directly
    MQTT Protocol
    Socket create error: [Errno 202] EAI_FAIL
    This is PybytesProtocol.start_MQTT
    Socket send error [Errno 128] ENOTCONN
    Socket create error: [Errno 202] EAI_FAIL

    If I swap the network preferences order to "wifi","lte", I'm able to send the signal to pytbytes without any problem.


  • Global Moderator

    The EAI_FAIL error is caused by the DNS not resolving (Error Address Info).. Maybe we had a second of downtime on the Pybytes servers.. Are you able to try it again?


Log in to reply
 

Pycom on Twitter