Skip to content

Commit

Permalink
Merge pull request #84 from SpudGunMan/lab
Browse files Browse the repository at this point in the history
LotsaBugs
  • Loading branch information
SpudGunMan authored Oct 18, 2024
2 parents 8b62d70 + eb9f1eb commit 8433b3c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ schedule.every().day.at("08:00").do(lambda: send_message(handle_wxc(0, 1, 'wx'),
schedule.every().wednesday.at("19:00").do(lambda: send_message("Net Starting Now", 2, 0, 1))
```

### MQTT Notes
There is no direct support for MQTT in the code, however, reports from Discord are that using [meshtasticd](https://meshtastic.org/docs/hardware/devices/linux-native-hardware/) with no radio and attaching the bot to the software node, which is MQTT-linked, allows routing. There also seems to be a quicker way to enable MQTT by having your bot node with the enabled [serial](https://meshtastic.org/docs/configuration/module/serial/) module with echo enabled and MQTT uplink and downlink. These two methods have been mentioned as allowing MQTT routing for the project.

### Requirements
Python 3.8? or later is needed (dev on latest). The following can be installed with `pip install -r requirements.txt` or using the [install.sh](install.sh) script for venv and automation:

Expand Down
2 changes: 1 addition & 1 deletion etc/report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
if config.sections() == []:
print(f"web_reporter.cfg is empty or does not exist, generating default config")
shameWordList = shameWordList_str = ', '.join(shameWordList)
config['reporting'] = {'log_path': script_dir, 'w3_path': www_dir, 'multi_log_reader': 'True', 'shame_word_list': shameWordList}
config['reporting'] = {'log_path': script_dir, 'w3_path': www_dir, 'multi_log_reader': 'False', 'shame_word_list': shameWordList}
with open(config_file, 'w') as configfile:
config.write(configfile)

Expand Down
2 changes: 1 addition & 1 deletion etc/report_generator5.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if config.sections() == []:
print(f"web_reporter.cfg is empty or does not exist, generating default config")
shameWordList = shameWordList_str = ', '.join(shameWordList)
config['reporting'] = {'log_path': script_dir, 'w3_path': www_dir, 'multi_log_reader': 'True', 'shame_word_list': shameWordList}
config['reporting'] = {'log_path': script_dir, 'w3_path': www_dir, 'multi_log_reader': 'False', 'shame_word_list': shameWordList}
with open(config_file, 'w') as configfile:
config.write(configfile)

Expand Down
15 changes: 7 additions & 8 deletions mesh_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_n
"moon": lambda: handle_moon(message_from_id, deviceID, channel_number),
"motd": lambda: handle_motd(message, message_from_id, isDM),
"ping": lambda: handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM),
"pinging": lambda: handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM),
"playuno": lambda: handleUno(message, message_from_id, deviceID),
"pong": lambda: "🏓PING!!🛜",
"rlist": lambda: handle_repeaterQuery(message_from_id, deviceID, channel_number),
Expand Down Expand Up @@ -212,7 +213,8 @@ def handle_wxalert(message_from_id, deviceID, message):
weatherAlert = getActiveWeatherAlertsDetail(str(location[0]), str(location[1]))
else:
weatherAlert = getWeatherAlerts(str(location[0]), str(location[1]))


weatherAlert = weatherAlert[0]
return weatherAlert

def handle_wiki(message, isDM):
Expand Down Expand Up @@ -847,12 +849,13 @@ def onReceive(packet, interface):
elif interface2_enabled and interface2_type == 'ble':
rxNode = 2

# check if the packet has a channel flag use it
if packet.get('channel'):
channel_number = packet.get('channel', 0)

# BBS DM MAIL CHECKER
if bbs_enabled and 'decoded' in packet:
message_from_id = packet['from']

if packet.get('channel'):
channel_number = packet['channel']

msg = bbs_check_dm(message_from_id)
if msg:
Expand All @@ -875,10 +878,6 @@ def onReceive(packet, interface):
snr = packet.get('rxSnr', 0)
rssi = packet.get('rxRssi', 0)

# check if the packet has a channel flag use it
if packet.get('channel'):
channel_number = packet.get('channel', 0)

# check if the packet has a publicKey flag use it
if packet.get('publicKey'):
pkiStatus = (packet.get('pkiEncrypted', False), packet.get('publicKey', 'ABC'))
Expand Down
1 change: 0 additions & 1 deletion modules/games/golfsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ def playGolf(nodeID, message, finishedHole=False):

# Scorecard reset
hole_to_par = 0
total_to_par = 0
hole_strokes = 0
hole_shots = 0

Expand Down
2 changes: 1 addition & 1 deletion modules/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ def llm_query(input, nodeID=0, location_name=None):
# logger.debug(f"System: Ollama process with CPU, query time will be slower")
# except Exception as e:
# logger.debug(f"System: Ollama process not found, {e}")
# return False
# return False

0 comments on commit 8433b3c

Please sign in to comment.