Problem
Current code throws an error on line 82:
# enable TLS for secure connection
client.tls_set(tls_version=mqtt.client.ssl.PROTOCOL_TLS)
Solution
Change imports:
- remove
from paho import mqtt
- add
import ssl
Change line 82:
# enable TLS for secure connection
client.tls_set(tls_version=ssl.PROTOCOL_TLS_CLIENT)