Hi all

I'm trying to test this tutorial on Oak-1 PoE camera
depthai-experiments/gen2-poe-mqtt at master · luxonis/depthai-experiments · GitHub

I keep getting this error:

Connected to OAK

[14442C10E113D5D600] [172.16.95.11] [7.054] [Script(2)] [warning] Connecting to MQTT broker...

[14442C10E113D5D600] [172.16.95.11] [55.764] [Script(2)] [critical] gaierror: (8, 'getaddrinfo failed')

At:

/usr/lib/python3.9/socket.py(953): getaddrinfo

/usr/lib/python3.9/socket.py(822): create_connection

<script>(4825): _create_socket_connection

<script>(2053): reconnect

<script>(1904): connect

<script>(5148): <module>

What is the cause of the error and how can fix it ?

Thank you

  • erik replied to this.

    martin181818 Seems like MQTT / connectivity error, likely device can't find specified mqtt broker.

    From GPT4:

    The error gaierror: (8, 'getaddrinfo failed') in Python's socket programming usually means that the system is unable to resolve a host name to an IP address or translate an IPv4 or IPv6 address to a host name. The 'getaddrinfo' function is used for this purpose.

    Here are a few possible causes and solutions:

    • Invalid Hostname: This error may occur if you're trying to connect to an invalid hostname or a hostname that does not exist. Make sure you've entered the correct hostname.
    • Network Connectivity: The error can also happen if your system has no internet connectivity or if it cannot reach the DNS server. Check your internet connection and DNS settings.
    • Firewall or Security Settings: If the firewall or security settings on your computer are blocking the request, you may also get this error. Check your firewall or security settings to ensure they are not preventing your program from running as expected.
    • DNS Server Issues: The error can happen if the DNS server itself is having issues. You might want to try switching to another DNS server such as Google's Public DNS (8.8.8.8 and 8.8.4.4) or Cloudflare's DNS (1.1.1.1).
    • Temporary Glitch: Sometimes, this error can occur due to a temporary glitch in the system. Try restarting your system to see if the error persists.

      erik

      Thank you for the reply.
      I tried all the above solutions but they did not help.
      It is not related to network, firewall or DNS issues because the paho-mqtt library works fine in the normal mode.
      I am using this tutorial since I need to exchange information in standalone mode.
      I also tried to use 127.0.0.1 as a broker and I get a similar error:
      [14442C10E113D5D600] [172.16.95.11] [6.813] [Script(2)] [warning] Connecting to MQTT broker...

      [14442C10E113D5D600] [172.16.95.11] [6.845] [Script(2)] [critical] ConnectionRefusedError: [Errno 111] C

      At:

      /usr/lib/python3.9/socket.py(846): create_connection

      <script>(4828): _create_socket_connection

      <script>(2056): reconnect

      <script>(1907): connect

      <script>(5152): <module>

      Could the issue be related to the script node or the paho-mqtt.py file used ?

      Thank you very much and waiting to hear from you

      • erik replied to this.

        erik

        Thank you for the reply.
        The IP/port are correct since I can do normal MQTT connection using the paho mqtt library. For the brokers I tested the same broker of the tutorial and the localhost but still not working.
        Thank you for the support

          Hi martin181818
          Since the example works in standard mode and not in standalone, perhaps there is something different when flashing the application that would change how the host and port are read. Could you add the minimal code of the application you are trying to flash (one that is already prepared for standalone mode)?

          Thanks.
          Jaka

            I also found these functions not called in paho-mqtt.py and fixed the importation but still getting the same errors.

            jakaskerl

            Thank you for your reply.
            I am just trying to test the same code of the tutorial without any changes.
            I made a simple test using the same port and same broker and they work using the paho-mqtt library and the PoE camera just to make sure that the problem is not related to ports, firewall or IP address I am using.