AWS IoT socket.gaierror: [Errno -3] Temporary failure in name resolution

时间:2018-06-04 17:29:41

标签: aws-iot

My project needs to use MQTT client (AWS IoT) between Beaglebone and PC as middleware. I used AWS IoT in my Flask framework in my pc's platform.

I use the same endpoint's MQTT client in my Beaglebone and my PC. And I use AWSIOTPythonSDK to connect my MQTT client. The thing is when I connect with my BBB(I also use Flask framework), it works and has no latency. But when I connect with my PC (with I use Flask framework), in the beginning, it works. But when I wait about 10 minutes, it shows the bug and cannot connect successfully. here is all the error message:

"/home/ran/MutantRobotics/src/rovers/Django/django_auth/django_auth/views.py", line 50, in <module>
    myMQTTClient.connect()
  File "/usr/local/lib/python3.5/dist-packages/AWSIoTPythonSDK/MQTTLib.py", line 481, in connect
    return self._mqtt_core.connect(keepAliveIntervalSecond)
  File "/usr/local/lib/python3.5/dist-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 183, in connect
    self.connect_async(keep_alive_sec, self._create_blocking_ack_callback(event))
  File "/usr/local/lib/python3.5/dist-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 196, in connect_async
    rc = self._internal_async_client.connect(keep_alive_sec, ack_callback)
  File "/usr/local/lib/python3.5/dist-packages/AWSIoTPythonSDK/core/protocol/internal/clients.py", line 116, in connect
    rc = self._paho_client.connect(host, port, keep_alive_sec)
  File "/usr/local/lib/python3.5/dist-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 654, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.5/dist-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 776, in reconnect
    sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
  File "/usr/lib/python3.5/socket.py", line 693, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

So does this means each endpoint just has one client??? I wanna have multiple clients in one endpoint MQTT client

Thanks

0 个答案:

没有答案