Skip to content
Open
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
15 changes: 13 additions & 2 deletions meshtastic/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,12 @@ def get_ringtone(self):
self._sendAdmin(
p1, wantResponse=True, onResponse=self.onResponseRequestRingtone
)
while self.gotResponse is False:
start_time = time.time()
timeout = 2
while not self.gotResponse:
if time.time() - start_time > timeout:
logging.warning("Timeout waiting for ringtone plugin response")
return None
time.sleep(0.1)

logging.debug(f"self.ringtone:{self.ringtone}")
Expand Down Expand Up @@ -521,7 +526,13 @@ def get_canned_message(self):
wantResponse=True,
onResponse=self.onResponseRequestCannedMessagePluginMessageMessages,
)
while self.gotResponse is False:

start_time = time.time()
timeout = 2
while not self.gotResponse:
if time.time() - start_time > timeout:
logging.warning("Timeout waiting for canned message plugin response")
return None
time.sleep(0.1)

logging.debug(
Expand Down
Loading