Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mqttbridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The MqttBridge cog connects your Discord server to a Meshtastic MQTT broker, ena
- SNR (Signal-to-Noise Ratio) data
- Network topology insights
- **MeshView Integration**: Direct links to visualize routes on MeshView
- **Graphs Service Integration**: Multiple graph views for route analysis (full, outbound, reply)

### Node Ownership System
- **Node Claiming**: Users can claim ownership of their nodes through a secure verification process
Expand Down Expand Up @@ -86,6 +87,7 @@ The MqttBridge cog connects your Discord server to a Meshtastic MQTT broker, ena
- **`!mqtt meshviewdomain <domain>`**: Set MeshView instance URL for packet links
- **`!mqtt mapdomain <domain>`**: Set map service URL for location links
- **`!mqtt metricsdomain <domain>`**: Set metrics dashboard URL
- **`!mqtt graphsdomain <domain>`**: Set graphs service URL for traceroute visualizations

#### Node Administration (`!nodeadmin` commands)
- **`!nodeadmin unclaim <node_id>`**: Remove ownership from a node
Expand Down
20 changes: 18 additions & 2 deletions mqttbridge/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, bot):
"meshview_domain": None,
"map_domain": None,
"metrics_domain": None,
"graphs_domain": None,
"enabled": False
}

Expand Down Expand Up @@ -1208,7 +1209,13 @@ async def process_traceroute(self, mp, se):
name="Links",
value=(
f"[View Packet on MeshView]({settings['meshview_domain']}/packet/{mp.id})\n"
f"[View Graph on MeshView]({settings['meshview_domain']}/graph/traceroute/{mp.id})\n"
+ ( "View graphs: "
f"[Full Graph]({settings['graphs_domain']}/graph/trace/{mp.id}) | "
f"[Outbound]({settings['graphs_domain']}/graph/trace/{mp.id}?direction=out) | "
f"[Reply]({settings['graphs_domain']}/graph/trace/{mp.id}?direction=in)"
if settings.get('graphs_domain')
else f"[View Graph on MeshView]({settings['meshview_domain']}/graph/traceroute/{mp.id})"
)
),
inline=False
)
Expand Down Expand Up @@ -1741,6 +1748,12 @@ async def set_metrics_domain(self, ctx: commands.Context, domain: str):
await self.config.metrics_domain.set(domain)
await ctx.send(f"Links will use metrics domain: {domain}")

@mqtt.command(name="graphsdomain")
async def set_graphs_domain(self, ctx: commands.Context, domain: str):
"""Set the graphs domain for traceroute links"""
await self.config.graphs_domain.set(domain)
await ctx.send(f"Graphs links will use domain: {domain}")

@mqtt.command(name="enable")
async def enable_bridge(self, ctx: commands.Context):
"""Enable the MQTT bridge"""
Expand Down Expand Up @@ -1795,6 +1808,9 @@ async def bridge_status(self, ctx: commands.Context):

if settings["metrics_domain"]:
embed.add_field(name="Metrics Domain", value=settings["metrics_domain"])

if settings["graphs_domain"]:
embed.add_field(name="Graphs Domain", value=settings["graphs_domain"])


await ctx.send(embed=embed)
Expand Down Expand Up @@ -3016,4 +3032,4 @@ async def on_timeout(self):
for item in self.children:
item.disabled = True
if hasattr(item, 'label'):
item.label = "Expired"
item.label = "Expired"
Loading