Merge remote-tracking branch 'origin/master'

# Conflicts:
#	meshview/store.py
#	meshview/templates/node.html
#	meshview/web.py
This commit is contained in:
Pablo Revilla
2025-03-05 16:12:59 -08:00
9 changed files with 48 additions and 16 deletions

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@ __pycache__/*
meshview/__pycache__/*
packets.db
/table_details.py
config.ini
screenshots/*

View File

@@ -1,5 +1,5 @@
# Meshview
![node](screenshots/nodeinfo.png)
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
```

View File

@@ -46,7 +46,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)

View File

@@ -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 %}

View File

@@ -1,6 +1,6 @@
<div class="row chat-packet">
<span class="col-2 timestamp">{{packet.import_time.strftime('%-I:%M:%S %p - %d-%m-%Y')}} </span>
<span class="col-1 timestamp"><a href="/packet/{{packet.id}}">✉️</a> {{packet.from_node.channel}}</span>
<span class="col-2 username"><a href="/packet_list/{{packet.from_node_id}}">{{packet.from_node.long_name or (packet.from_node_id | node_id_to_hex) }}</a></span>
<span class="col-6 message">{{packet.payload}}</span>
<span class="col-1 timestamp" style="font-size: smaller;"><a href="/packet/{{packet.id}}">✉️</a> {{packet.from_node.channel}}<div>{{packet.import_time.strftime('%-I:%M:%S %p - %d-%m-%Y')}}</div></span>
<!-- <span class="col-1 timestamp"></span> -->
<span class="col-4 username" style="text-align: center;"><a href="/packet_list/{{packet.from_node_id}}">{{packet.from_node.long_name or (packet.from_node_id | node_id_to_hex) }}</a></span>
<span class="col message" style="text-align: right;">{{packet.payload}}</span>
</div>

View File

@@ -21,7 +21,7 @@
<div class="tab-content">
<div class="tab-pane fade show active" id="overview" role="tabpanel">
<dl>
<dt>Power</dt>
<dt>Battery</dt>
<dd>{{ graph("power") }}</dd>
</dl>
<dl>
@@ -30,7 +30,7 @@
</dl>
</div>
<div class="tab-pane fade" id="neighbors" role="tabpanel">
<a role="button" class="btn btn-primary mb-3" href="/graph/network?root={{node_id}}&depth=2">Network Graph</a>
<a role="button" class="btn btn-primary mb-3" href="/graph/{{node.channel.lower()}}?root={{node_id}}&depth=2">Network Graph</a>
<a style="display: block;" href="/graph/neighbors2/{{node_id}}"><img src="/graph/neighbors/{{node_id}}" height="200em" width="200em"/></a>
</div>
<div class="tab-pane fade" id="weather" role="tabpanel">
@@ -60,7 +60,10 @@
</dl>
</div>
<div class="tab-pane fade" id="power" role="tabpanel">
{{ graph("power_metrics") }}
<dl>
<dt>Power Metrics</dt>
<dd>{{ graph("power_metrics") }}</dd>
</dl>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
screenshots/nodeinfo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 KiB