can’t use create_from_edge_environment with proxy options – client doesn’t connect to azure iot hub
Hello,
I am trying to configure a client connection towards azure iot hub from a module. I’ve tried creating the client with create_from_edge_environment method and I get the following error:
Traceback (most recent call last): File “/usr/local/lib/python3.10/site-packages/azure/iot/device/common/mqtt_transport.py”, line 391, in connect rc = self._mqtt_client.connect( File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 914, in connect return self.reconnect() File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 1044, in reconnect sock = self._create_socket_connection() File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 3683, in _create_socket_connection return socks.create_connection(addr, timeout=self._connect_timeout, source_address=source, **proxy) File “/usr/local/lib/python3.10/site-packages/socks.py”, line 209, in create_connection raise err File “/usr/local/lib/python3.10/site-packages/socks.py”, line 199, in create_connection sock.connect((remote_host, remote_port)) File “/usr/local/lib/python3.10/site-packages/socks.py”, line 47, in wrapper return function(*args, **kwargs) File “/usr/local/lib/python3.10/site-packages/socks.py”, line 814, in connect raise GeneralProxyError(“Socket error”, error) socks.GeneralProxyError: Socket error: 407: Proxy Authentication Required
This problem doesn’t appear if I create the client using create_from_connection_string method. This adds complexity to my script and I would like to use create_from_edge_environment method.
Does anybody have any insights on why one method works and the other doesn’t?
Thanks!
Hello, I am trying to configure a client connection towards azure iot hub from a module. I’ve tried creating the client with create_from_edge_environment method and I get the following error: Traceback (most recent call last): File “/usr/local/lib/python3.10/site-packages/azure/iot/device/common/mqtt_transport.py”, line 391, in connect rc = self._mqtt_client.connect( File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 914, in connect return self.reconnect() File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 1044, in reconnect sock = self._create_socket_connection() File “/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py”, line 3683, in _create_socket_connection return socks.create_connection(addr, timeout=self._connect_timeout, source_address=source, **proxy) File “/usr/local/lib/python3.10/site-packages/socks.py”, line 209, in create_connection raise err File “/usr/local/lib/python3.10/site-packages/socks.py”, line 199, in create_connection sock.connect((remote_host, remote_port)) File “/usr/local/lib/python3.10/site-packages/socks.py”, line 47, in wrapper return function(*args, **kwargs) File “/usr/local/lib/python3.10/site-packages/socks.py”, line 814, in connect raise GeneralProxyError(“Socket error”, error) socks.GeneralProxyError: Socket error: 407: Proxy Authentication Required This problem doesn’t appear if I create the client using create_from_connection_string method. This adds complexity to my script and I would like to use create_from_edge_environment method. Does anybody have any insights on why one method works and the other doesn’t? Thanks! Read More