diff --git a/README.md b/README.md index bb9ad08..b4041d2 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ Welcome to the Mesh Bot project! This feature-rich bot is designed to enhance yo - **Automated Responses**: The bot traps keywords like "ping" and responds with "pong" in direct messages (DMs) or group channels. - **Customizable Triggers**: Monitor group channels for specific keywords and set custom responses. +### Network building tools +- **Enhance and build local mesh**: Tools like Ping allow for message delivery testing + ### Dual Radio/Node Support - **Simultaneous Monitoring**: Monitor two networks at the same time. - **Flexible Messaging**: send mail and messages, between networks. @@ -314,7 +317,8 @@ sudo apt-get install fonts-noto-color-emoji ### Networking | Command | Description | ✅ Works Off-Grid | |---------|-------------|- -| `ping`, `ack`, `test` | Return data for signal. Example: `ping 15 #DrivingI5` (activates auto-ping every 20 seconds for count 15) | ✅ | +| `ping`, `ack` | Return data for signal. Example: `ping 15 #DrivingI5` (activates auto-ping every 20 seconds for count 15) | ✅ | +| `test` | Returns like ping but also can be used to test the limits of data buffers `test 5` returns 32 to the maxBuffer set | ✅ | | `whereami` | Returns the address of the sender's location if known | | `whoami` | Returns details of the node asking, also returned when position exchanged 📍 | ✅ | | `motd` | Displays the message of the day or sets it. Example: `motd $New Message Of the day` | ✅ | diff --git a/config.template b/config.template index 2f15303..3a16f09 100644 --- a/config.template +++ b/config.template @@ -152,4 +152,7 @@ splitDelay = 0.0 MESSAGE_CHUNK_SIZE = 160 # Request Acknowledgement of message OTA wantAck = False +# Max lilmit Buffer for radio testing +maxBuffer = 220 + diff --git a/mesh_bot.py b/mesh_bot.py index c2b8c8c..888ccd8 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -173,7 +173,7 @@ def handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM, chann if pingCount > 1: multiPingList.append({'message_from_id': message_from_id, 'count': pingCount + 1, 'type': type, 'deviceID': deviceID, 'channel_number': channel_number}) if type == "🎙TEST": - msg = f"🎙Initalizing buffer Test range {MESSAGE_CHUNK_SIZE / pingCount} to {MESSAGE_CHUNK_SIZE}" + msg = f"🎙Initalizing buffer Test range {int(maxBuffer / pingCount)} to {maxBuffer} in {pingCount} messages" else: msg = f"🚦Initalizing {pingCount} auto-ping" diff --git a/modules/settings.py b/modules/settings.py index b7bb570..abeb9b8 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -186,6 +186,7 @@ try: splitDelay = config['messagingSettings'].getfloat('splitDelay', 0) # default 0 MESSAGE_CHUNK_SIZE = config['messagingSettings'].getint('MESSAGE_CHUNK_SIZE', 160) # default 160 wantAck = config['messagingSettings'].getboolean('wantAck', False) # default False + maxBuffer = config['messagingSettings'].getint('maxBuffer', 220) # default 220 except KeyError as e: print(f"System: Error reading config file: {e}") diff --git a/modules/system.py b/modules/system.py index fa5caf5..7ac561e 100644 --- a/modules/system.py +++ b/modules/system.py @@ -610,8 +610,11 @@ def handleMultiPing(nodeID=0, deviceID=1): if type == '🎙TEST': # use the type for a string of random data divided by MAXBUFFER and count for the length of the string - type = ''.join(random.choice(['0', '1']) for i in range(int(MESSAGE_CHUNK_SIZE / count))) - count = len(type) + type = ''.join(random.choice(['0', '1']) for i in range(int(maxBuffer / count))) + count = len(type + f"🔂 ") + if count < 99: + # why? because the count likes to count + count = count - 1 send_message(f"🔂{count} {type}", channel_number, message_id_from, deviceID, bypassChuncking=True)