From fb12c11a7e18718640e5718910f2d293346edd92 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 9 Oct 2025 15:39:32 -0700 Subject: [PATCH] Update mesh_bot.py --- mesh_bot.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 7552166..bc10c0d 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1613,14 +1613,17 @@ def onReceive(packet, interface): if repeater_enabled and multiple_interface: # wait a responseDelay to avoid message collision from lora-ack. time.sleep(responseDelay) - rMsg = (f"{message_string} From:{get_name_from_number(message_from_id, 'short', rxNode)}") - # if channel found in the repeater list repeat the message - if str(channel_number) in repeater_channels: - for i in range(1, 10): - if globals().get(f'interface{i}_enabled', False) and i != rxNode: - logger.debug(f"Repeating message on Device{i} Channel:{channel_number}") - send_message(rMsg, channel_number, 0, i) - time.sleep(responseDelay) + if len(message_string) > (3 * MESSAGE_CHUNK_SIZE): + logger.warning(f"System: Not repeating message, exceeds size limit ({len(message_string)} > {3 * MESSAGE_CHUNK_SIZE})") + else: + rMsg = (f"{message_string} From:{get_name_from_number(message_from_id, 'short', rxNode)}") + # if channel found in the repeater list repeat the message + if str(channel_number) in repeater_channels: + for i in range(1, 10): + if globals().get(f'interface{i}_enabled', False) and i != rxNode: + logger.debug(f"Repeating message on Device{i} Channel:{channel_number}") + send_message(rMsg, channel_number, 0, i) + time.sleep(responseDelay) # if QRZ enabled check if we have said hello if qrz_hello_enabled: