From bcc9c034597f712931c6eaeeab854b3d9d12cc8f Mon Sep 17 00:00:00 2001 From: madeofstown Date: Sun, 23 Feb 2025 14:14:57 -0800 Subject: [PATCH] a few more changes with the readme --- README.md | 18 ++++++++++++++---- main.py | 2 +- sample.config.ini | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 sample.config.ini diff --git a/README.md b/README.md index 9d36d55..d504e89 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,14 @@ 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. - -You may also change the web server port from the ***default 8081***. +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 + ``` https://github.com/pablorevilla-meshtastic/meshview/blob/20bc89a21feb23b0dde51e10e21638c11f4e4443/config.ini#L1-L15 ## Running Meshview @@ -41,4 +46,9 @@ https://github.com/pablorevilla-meshtastic/meshview/blob/20bc89a21feb23b0dde51e1 ``` 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 flag `--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/sample.config.ini b/sample.config.ini new file mode 100644 index 0000000..b1fce3a --- /dev/null +++ b/sample.config.ini @@ -0,0 +1,15 @@ +[server] +bind = * +port = 8081 +tls_cert = +acme_challenge = + +[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 \ No newline at end of file