dear Shane,
thanks for the very comprehensive piece of code, which is very clear. However if I try I always get
2022-06-15 06:44:19.618960 | Listening for messages
Traceback (most recent call last):
File "E:\RPI\software\prog\MQTT\new test\AZURESDK_send.py", line 84, in <module>
client.connect(MQTTBrokerIP, 1883, 60) # Connect to (broker, port, keepalive-time)
File "C:\Users\annunal\.conda\envs\pyTAD\lib\site-packages\paho\mqtt\client.py", line 914, in connect
return self.reconnect()
File "C:\Users\annunal\.conda\envs\pyTAD\lib\site-packages\paho\mqtt\client.py", line 1044, in reconnect
sock = self._create_socket_connection()
File "C:\Users\annunal\.conda\envs\pyTAD\lib\site-packages\paho\mqtt\client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
File "C:\Users\annunal\.conda\envs\pyTAD\lib\socket.py", line 844, in create_connection
raise err
File "C:\Users\annunal\.conda\envs\pyTAD\lib\socket.py", line 832, in create_connection
sock.connect(sa)
socket.timeout: timed out
About the MQTTBrokerIP I have included "JRC-Telemetry.azure-devices.net" that is our IOT Hub identification URL. I also have tried with the IP value (in your article it is not clear if you have to use exacly the IP you indicated 10.0.0.200 or the IP that one obtain by nslookup of the URL. However the example should wor also with the URL.
About the connection string I copied it from the IoTHub. Nevertheless it does not connect.
Any idea ?
Thanks