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

    Vodafone SIM in Spain not working [solved, wrong DNS sever]

    Scheduled Pinned Locked Moved Discussion
    13 Posts 3 Posters 146 Views 3 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.
    • C Offline
      claus @Gijs
      last edited by

      GREAT!! Thanks a lot, it is working!

      1 Reply Last reply Reply Quote 0
      • G Offline
        Guillermo del Campo @Gijs
        last edited by

        @Gijs Hello Gijs! I'm having a similar issue and I don't know what else to try.

        I have a Vodafone SIM bought from pycom, but I am not able at all to connect to Pybytes using LTE. If I do it via WiFi, everything works as expected.

        This is mi pybytes_config.json file:

        {"wifi": {"ssid": "", "password": ""}, "wlan_antenna": 0, "dump_ca": false, "server": "mqtt.pybytes.pycom.io", "ssl": false, "lte": {"apn": "pycom.io", "cid": 1, "reset": false, "carrier": "standard", "band": 20, "type": "IP"}, "device_id": "xxxx", "network_preferences": ["lte"], "ota_server": {"port": 443, "domain": "software.pycom.io"}, "pybytes_autostart": false, "username": "xxxx"}
        
        

        When I try to connect, it certainly says:

        >>> pybytes.connect()
        Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms
        LTE connection established
        connect_lte with start_mqtt is now removed please call communication_protocol or start_mqtt directly
        Connected to MQTT mqtt.pybytes.pycom.io
        Pybytes connected successfully (using the built-in pybytes library)
        

        But when I try:

        >>> pybytes.send_ping_message()
        

        it stalls forever... same if I try to send a signal. Moreover, if I try:

        >>> socket.getaddrinfo('www.pycom.io', 80)
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        OSError: [Errno 202] EAI_FAIL
        

        Please, can you, or anyone else, provide any help? I'm going crazy...

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

          Did you try the suggestion above? Let me know what the result is of socket.dnsserver() . As mentioned above, the EAI_FAIL error is related to an issue with the DNS server

          G 1 Reply Last reply Reply Quote 0
          • G Offline
            Guillermo del Campo @Gijs
            last edited by

            @Gijs Yes... I tried with no success. This is the output:

            >>> socket.dnsserver()
            ('0.0.0.0', '0.0.0.0')
            
            1 Reply Last reply Reply Quote 0
            • G Offline
              Gijs
              last edited by

              Please try setting the dns servers manually before starting pybytes, as mentioned in the other ticket. This is an issue with Vodafone where the DNS servers do not get set correctly. We talk about it in the other thread: https://forum.pycom.io/topic/6350/error-while-connecting-pybytes-with-lte
              Like this:

              from network import LTE
              import socket
              lte = LTE()
              lte.attach()
              ...
              lte.connect()
              ...
              socket.dnsserver(0, '172.31.32.100')
              socket.dnsserver(1, '172.31.32.100')
              # check if get addr info works
              print(socket.getaddrinfo('www.pycom.io', 80))
              #make sure to have pybytes loaded, but not autoconnect at boot, if pybytes is not loaded, use this: https://docs.pycom.io/pybytes/api/
              pybytes.start()
              

              Sorry I did not get around to testing the script completely, but you should be able to make it work using a procedure like this
              Best,
              Gijs

              G 1 Reply Last reply Reply Quote 0
              • G Offline
                Guillermo del Campo @Gijs
                last edited by

                @Gijs I also tried that, as I saw it on other post but it does not work... Here is the output:

                Not starting Pybytes as auto-start is disabled
                Pycom MicroPython 1.20.2.r4 [v1.11-ffb0e1c] on 2021-01-12; FiPy with ESP32
                Pybytes Version: 1.6.1
                Type "help()" for more information.
                >>> from network import LTE
                >>> import socket
                >>> lte=LTE()
                >>> lte.attach(band=20, apn="pycom.io")
                >>> lte.isattached()
                True
                >>> lte.connect()
                >>> lte.isconnected()
                True
                >>> socket.dnsserver(0, '172.31.16.100')
                >>> socket.dnsserver(1, '172.31.32.100')
                >>> socket.dnsserver()
                ('172.31.16.100', '172.31.32.100')
                >>> print(socket.getaddrinfo('www.pycom.io', 80))
                Traceback (most recent call last):
                  File "<stdin>", line 1, in <module>
                OSError: [Errno 202] EAI_FAIL
                
                1 Reply Last reply Reply Quote 0
                • G Offline
                  Gijs
                  last edited by

                  Sorry, my mistake. The vodafone simcards do not resolve pycom.io, but should be able to resolve pybytes.pycom.io!
                  Let me know if that works for you

                  G 1 Reply Last reply Reply Quote 0
                  • G Offline
                    Guillermo del Campo @Gijs
                    last edited by

                    @Gijs Oh yes!! Thank you so much :) Now it works and I can send messages!

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

                      Im looking to add this to the documentation, as it seems an intermittent issue, could you recommend the place where you first looked for this?

                      Let me know

                      G 1 Reply Last reply Reply Quote 0
                      • G Offline
                        Guillermo del Campo @Gijs
                        last edited by

                        @Gijs I think it should be here: https://pycom.io/webshop-2/services/cellular-services/faq-for-vodafone-pycoms-nb-iot-services/ or maybe somewhere around here: https://docs.pycom.io/tutorials/networks/lte/
                        I believe it's also important to highlight that the modem firmware may need to be updated and modified to the NB-IoT version, since I took some to realise that as well... my FiPys come with the LTE-M version installed.

                        1 Reply Last reply Reply Quote 2

                        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