mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-03-28 17:32:36 +01:00
maxBuffer
test 4 will divide the maxBuffer value and send junk data to test a radio or network
This commit is contained in:
@@ -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` | ✅ |
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user