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

Python Snake tutorial Step 4 does not show MQTT "Connected" #96

Open
esmith-oss opened this issue Nov 17, 2021 · 0 comments
Open

Python Snake tutorial Step 4 does not show MQTT "Connected" #96

esmith-oss opened this issue Nov 17, 2021 · 0 comments

Comments

@esmith-oss
Copy link

Step 4 of the Python Snake MQTT tutorial says to run python code to connect to 'mqtt.ably.io' mqtt broker.

The code

client.loop_start()
   client.connect('mqtt.ably.io', port=8883, keepalive=15)

should trigger the stdout message 'Connected' because the on connect callback prints 'Connected':

def on_connect(client, userdata, flags, rc):
  print('Connected')

But on my system, no 'Connected' message is printed before the python script terminates. I added a time.sleep(5) after client.connect(...) to delay script termination, and 'Connected' now prints, as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant