Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def message(client, topic, message):
photocell_val = 0
while True:
# Poll the message queue
mqtt_client.loop()
mqtt_client.loop(timeout=1)

# Send a new message
print(f"Sending photocell value: {photocell_val}...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def message(client, topic, message):
# NOTE: Network reconnection is handled within this loop
while True:
try:
mqtt_client.loop()
mqtt_client.loop(timeout=1)
except (ValueError, RuntimeError) as e:
print("Failed to get data, retrying\n", e)
wifi.reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def on_message(client, topic, message):
# NOTE: NO code below this loop will execute
while True:
try:
client.loop()
client.loop(timeout=1)
except (ValueError, RuntimeError) as e:
print("Failed to get data, retrying\n", e)
wifi.reset()
Expand Down