A web-based tool to visualize OpenThread network topology in real-time. It communicates with an OpenThread Border Router (OTBR) to crawl the network, map connections between routers and end devices, and display link quality using a physics-based graph layout.
- Iterative Crawl: Starts from the Border Router and discovers neighbors hop-by-hop using the OTBR REST API (JSON:API).
- Physics Logic: Link lengths are calculated using an Inverse Square Law based on signal strength (Link Margin or RSSI), providing a realistic spatial representation of the mesh.
- Link Filtering: Toggle visibility of weak/medium links. Hidden links stop affecting the physics simulation, allowing the graph to relax.
- CLI Import: Can parsing the output of
ot-ctl meshdiag topologyfor instant visualization without using the REST API. - Device Naming: Map hex addresses to friendly names via a JSON configuration file.
- Detailed Inspection: Click nodes to see RLOC16, ExtAddress, Role, IPv6 addresses, and raw diagnostic data.
- Export: Save the current topology architecture to JSON.
- OpenThread Border Router (OTBR): You need an active OTBR with the Web GUI/REST API enabled (usually on port 80 or 8081).
- Network Access: The machine running this visualizer must be able to reach the OTBR's IP address.
You can run this as a static web page. No build process is required (Vanilla JS + CSS).
- Clone this repository.
- Start a simple HTTP server in the folder:
python3 -m http.server 8000
- Open
http://localhost:8000in your browser. - Enter your OTBR URL (e.g.,
http://192.168.1.50:8081) and click Start Crawl.
CORS Warning: If your OTBR is on a different domain/port than your viewer, you might hit CORS restrictions.
- Workaround: Host these files on the OTBR web server directly (see Option 2).
- Or: Use a browser extension to disable CORS for testing.
To avoid CORS issues and CORS configuration:
- Copy
index.html,app.js,style.css, anddevice_names.jsonto the OTBR web server directory (often/usr/share/otbr-web/or similar, depending on installation). - Access the visualizer via the OTBR's IP address (e.g.,
http://<OTBR_IP>/index.html). - Leave the URL field blank; it will default to the current origin.
- Enter the URL of your Border Router (e.g.,
http://10.0.0.1). - Click "Start Crawl".
- The tool will:
- Find the Border Router.
- Find the Leader.
- Issue Diagnostic commands to every router iteratively.
- Draw the graph.
If the REST API is unavailable or failing:
- SSH into your Border Router.
- Run the diagnostic command:
sudo ot-ctl meshdiag topology children ip6-addrs
- Copy the entire output.
- In the Visualizer, click the purple "Import CLI" button.
- Paste the text and click Visualize!.
- Link Filter: Use the dropdown to hide weak links. This also disables their physics forces, which helps declutter dense meshes.
- Export JSON: Downloads the current
vis.DataSetcontent for backup.
Rename device_names.json (or create it) to map Extended MAC Addresses to readable names:
{
"b2c9a2836317bc63": "Border Router (Pi)",
"f4ce368a0s......": "Living Room Sensor"
}- "Failed to get data": Check the browser console (F12). If you see CORS errors, see "Installation Option 2".
- Nodes bunching up: Try filtering out weak links using the dropdown.
Developed with the assistance of Gemini 3 Pro, an AI programming assistant.
