enhance QRZ

default to training mode, a new mode
This commit is contained in:
SpudGunMan
2025-01-31 22:04:03 -08:00
parent 9e31b7f47e
commit 6f121b7aac
5 changed files with 12 additions and 6 deletions
+1
View File
@@ -321,6 +321,7 @@ This isnt QRZ.com this is Q code for who is calling me, this will track new node
[qrz]
enabled = True # QRZ Hello to new nodes
qrz_hello_string = "send CMD or DM me for more info." # will be sent to all heard nodes once
training = True # Training mode will not send the hello message to new nodes, use this to build up database
```
### Scheduler
+2 -3
View File
@@ -153,9 +153,6 @@ ignoreFEMAtest = True
# find your SAME https://www.weather.gov/nwr/counties
mySAME = 053029,053073
# Use UK Alert Broadcast Data
enableGBalerts = False
# Use DE Alert Broadcast Data
enableDEalerts = False
# comma separated list of regional codes trigger local alert.
@@ -179,6 +176,8 @@ reverse_in_out = False
enabled = False
qrz_db = data/qrz.db
qrz_hello_string = "send CMD or DM me for more info."
# Training mode will not send the hello message to new nodes
training = True
# repeater module
[repeater]
+4 -3
View File
@@ -1262,9 +1262,10 @@ def onReceive(packet, interface):
# add to qrz_hello list
hello(message_from_id, name)
# send a hello message as a DM
time.sleep(responseDelay)
send_message(f"Hello {name} {qrz_hello_string}", channel_number, message_from_id, rxNode)
time.sleep(responseDelay)
if not train_qrz:
time.sleep(responseDelay)
send_message(f"Hello {name} {qrz_hello_string}", channel_number, message_from_id, rxNode)
time.sleep(responseDelay)
else:
# Evaluate non TEXT_MESSAGE_APP packets
consumeMetadata(packet, rxNode)
+4
View File
@@ -23,12 +23,16 @@ def never_seen_before(nodeID):
row = c.fetchone()
conn.close()
if row is None:
# we have not seen this node before
return True
else:
# we have seen this node before
return False
except sqlite3.OperationalError as e:
if "no such table" in str(e):
initalize_qrz_database()
logger.error("QRZ database table not found, created new table")
# we have not seen this node before
return True
else:
raise
+1
View File
@@ -278,6 +278,7 @@ try:
qrz_hello_enabled = config['qrz'].getboolean('enabled', False)
qrz_db = config['qrz'].get('qrz_db', 'data/qrz.db')
qrz_hello_string = config['qrz'].get('qrz_hello_string', 'send CMD or DM me for more info.')
train_qrz = config['qrz'].getboolean('training', True)
# E-Mail Settings
sysopEmails = config['smtp'].get('sysopEmails', '').split(',')