diff --git a/.gitignore b/.gitignore index c946735..6a77d3e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ __pycache__/* meshview/__pycache__/* packets.db /table_details.py +config.ini +screenshots/* diff --git a/README.md b/README.md index 9d36d55..712b5f7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Meshview - + This project watches a MQTT topic for meshtastic messages, imports them to a database and has a web UI to view them. @@ -31,14 +31,40 @@ You also need to install `graphviz`: ``` bash sudo apt-get install graphviz ``` -Edit `config.ini` to change the MQTT server, username, password, and topic(s) as necessary. +Copy `sample.config.ini` to `config.ini`: +``` bash +cp sample.config.ini config.ini +``` + Edit `config.ini` and change the MQTT server, and Web server settings as necsessary. + ```bash + nano config.ini + ``` +```ini +[server] +bind = * +port = 8081 +tls_cert = +acme_challenge = -You may also change the web server port from the ***default 8081***. -https://github.com/pablorevilla-meshtastic/meshview/blob/20bc89a21feb23b0dde51e10e21638c11f4e4443/config.ini#L1-L15 +[mqtt] +server = mqtt.bayme.sh +topics = ["msh/US/bayarea/#", "msh/US/CA/mrymesh/#"] +port = 1883 +username = meshdev +password = large4cats + +[database] +connection_string = sqlite+aiosqlite:///packets.db +``` ## Running Meshview ``` bash ./env/bin/python main.py ``` -Now you can hit http://localhost:8081/ +Now you can hit http://localhost:8081/ ***(if you did not change the web server port )*** + +You can specify the path to your `config.ini` file with the run command argument `--config` +``` bash +./env/bin/python main.py --config /path/to/config.ini +``` diff --git a/main.py b/main.py index 13d9f80..d5eec17 100644 --- a/main.py +++ b/main.py @@ -57,7 +57,7 @@ def load_config(file_path): if __name__ == '__main__': parser = argparse.ArgumentParser("meshview") - parser.add_argument("--config", help="Path to the configuration file.", default='config.ini') + parser.add_argument("--config", help="Path to the configuration file.", default="config.ini") args = parser.parse_args() config = load_config(args.config) diff --git a/meshview/store.py b/meshview/store.py index 3ff6118..11ac260 100644 --- a/meshview/store.py +++ b/meshview/store.py @@ -308,6 +308,9 @@ async def get_mqtt_neighbors(since): # get_mqtt_neighbors_longfast # # p.r. +# TODO # combine the duplicated funtions back to the original 3 by letting them take a second variable to specify channel name. +# The default value for channel (none) should cause these functioins to operate the same as they did before they were channel specific. +# This change will make adding new channel specific graphs much easier in the future. # # Get Traceroute for LongFast only async def get_traceroutes_longfast(since): diff --git a/meshview/templates/chat.html b/meshview/templates/chat.html index 821f601..09eebd8 100644 --- a/meshview/templates/chat.html +++ b/meshview/templates/chat.html @@ -5,15 +5,16 @@ min-width:10em; } .chat-packet:nth-of-type(odd){ - background-color: #3a3a3a; /* Lighter than #2a2a2a */ + background-color: #272b2f; /* Lighter than #2a2a2a */ } .chat-packet { - border-bottom: 1px solid #555; + border: 1px solid #474b4e; padding: 8px; + margin-bottom: 4px; border-radius: 8px; /* Adjust the value to make the corners more or less rounded */ } .chat-packet:nth-of-type(even){ - background-color: #333333; /* Slightly lighter than the previous #181818 */ + background-color: #212529; /* Slightly lighter than the previous #181818 */ } {% endblock %} diff --git a/meshview/templates/chat_packet.html b/meshview/templates/chat_packet.html index 9a6d833..8352215 100644 --- a/meshview/templates/chat_packet.html +++ b/meshview/templates/chat_packet.html @@ -1,6 +1,6 @@
{{node.long_name}}