diff --git a/examples/native_networking/minimqtt_adafruitio_native_networking.py b/examples/native_networking/minimqtt_adafruitio_native_networking.py index 512b83e6..3fcd8179 100644 --- a/examples/native_networking/minimqtt_adafruitio_native_networking.py +++ b/examples/native_networking/minimqtt_adafruitio_native_networking.py @@ -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}...") diff --git a/examples/native_networking/minimqtt_pub_sub_blocking_native_networking.py b/examples/native_networking/minimqtt_pub_sub_blocking_native_networking.py index 0ba76dfb..57b71f9e 100644 --- a/examples/native_networking/minimqtt_pub_sub_blocking_native_networking.py +++ b/examples/native_networking/minimqtt_pub_sub_blocking_native_networking.py @@ -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() diff --git a/examples/native_networking/minimqtt_pub_sub_blocking_topic_callbacks_native_networking.py b/examples/native_networking/minimqtt_pub_sub_blocking_topic_callbacks_native_networking.py index 82b9ce18..55a77693 100644 --- a/examples/native_networking/minimqtt_pub_sub_blocking_topic_callbacks_native_networking.py +++ b/examples/native_networking/minimqtt_pub_sub_blocking_topic_callbacks_native_networking.py @@ -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()