diff --git a/modules/locationdata.py b/modules/locationdata.py index f7a7639..3a91ff3 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -1,4 +1,4 @@ -# helper functions to use location data +# helper functions to use location data like NOAA weather # K7MHI Kelly Keeton 2024 import json # pip install json diff --git a/modules/log.py b/modules/log.py index c30d307..990c713 100644 --- a/modules/log.py +++ b/modules/log.py @@ -1,3 +1,7 @@ +# Custom logger for MeshBot and PongBot +# you can change the sdtout_handler level to logging.INFO to only show INFO level logs +# stdout_handler.setLevel(logging.INFO)vs stdout_handler.setLevel(logging.DEBUG) +# 2024 Kelly Keeton K7MHI import logging from datetime import datetime from modules.settings import * @@ -53,7 +57,7 @@ stdout_handler.setFormatter(CustomFormatter(logFormat)) # Create file handler for logging to a file today = datetime.now() file_handler = logging.FileHandler('messages{}.log'.format(today.strftime('%Y_%m_%d'))) -file_handler.setLevel(logging.INFO) +file_handler.setLevel(logging.INFO) # INFO used for messages file_handler.setFormatter(logging.Formatter(msgLogFormat)) # Add handlers to the logger diff --git a/modules/settings.py b/modules/settings.py index a611f4f..4db0a52 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -1,3 +1,5 @@ +# Settings for MeshBot and PongBot +# 2024 Kelly Keeton K7MHI import configparser # messages diff --git a/modules/solarconditions.py b/modules/solarconditions.py index ec62909..85c0f7b 100644 --- a/modules/solarconditions.py +++ b/modules/solarconditions.py @@ -1,5 +1,5 @@ # helper functions to get HF band conditions, DRAP X-ray flux, and sunrise/sunset times -# some code from https://github.com/Murturtle/MeshLink +# HF code from https://github.com/Murturtle/MeshLink # K7MHI Kelly Keeton 2024 import requests # pip install requests diff --git a/modules/system.py b/modules/system.py index 1557bf7..647e340 100644 --- a/modules/system.py +++ b/modules/system.py @@ -1,4 +1,4 @@ -# helper functions for system related tasks +# helper functions and init for system related tasks # K7MHI Kelly Keeton 2024 import meshtastic.serial_interface #pip install meshtastic @@ -370,7 +370,7 @@ def get_closest_nodes(nodeInt=1,returnCount=3): except Exception as e: pass - #sort by distance closest to lattitudeValue, longitudeValue + # sort by distance closest to lattitudeValue, longitudeValue node_list.sort(key=lambda x: (x['latitude']-latitudeValue)**2 + (x['longitude']-longitudeValue)**2) # return the first 3 closest nodes by default @@ -409,7 +409,7 @@ def send_message(message, ch, nodeid=0, nodeInt=1): for m in message_list: if nodeid == 0: - #Send to channel + # Send to channel logger.info(f"Device:{nodeInt} Channel:{ch} " + CustomFormatter.red + "Sending Multi-Chunk Message: " + CustomFormatter.white + m.replace('\n', ' ')) if nodeInt == 1: interface1.sendText(text=m, channelIndex=ch)