Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more useful error message for hivemq fail #246

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/public_mqtt_sdl_demo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,13 @@ def callback(topic, msg, retain=None, dup=None):
print(get_traceback(e))
print("Retrying client.connect() in 2 seconds...")
sleep(2.0)
client.connect()
try:
client.connect()
except OSError as e:
print(get_traceback(e))
print(
"Failed to connect on second attempt. Ensure you have the correct 'hivemq-com-chain.der' file *specific* to your HiveMQ Cloud broker instance (now required as of June 2024). The default file works for the self-driving-lab-demo, but for your own instance, generate and upload the correct CA file to your microcontroller. Your certificate can be generated via https://colab.research.google.com/github/sparks-baird/self-driving-lab-demo/blob/main/notebooks/7.2.1-hivemq-openssl-certificate.ipynb. See also https://github.com/sparks-baird/self-driving-lab-demo/issues/245"
) # noqa: E501

client.set_callback(callback)
client.subscribe(prefix + "GPIO/#")
Expand Down
Loading