feat: add POST /api/trace endpoint for multi-hop trace diagnostics#91
Open
dmduran12 wants to merge 1 commit intorightup:devfrom
Open
feat: add POST /api/trace endpoint for multi-hop trace diagnostics#91dmduran12 wants to merge 1 commit intorightup:devfrom
dmduran12 wants to merge 1 commit intorightup:devfrom
Conversation
Adds a dedicated /api/trace endpoint that sends a MeshCore TRACE packet
along a specified multi-hop path and returns per-hop signal quality data.
- New endpoint accepts {path: ["AA","BB","CC"], timeout: 30}
- Each hop in the path records its receive-SNR as the packet traverses
- Response includes hop_snrs array with raw register + dB values
- Existing /api/ping_neighbor is untouched (single-hop stays separate)
Co-Authored-By: Warp <agent@warp.dev>
c7ee331 to
15e1ab4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a dedicated
POST /api/traceendpoint for multi-hop MeshCore TRACE diagnostics, separate from the existing single-hopping_neighbor.Changes
repeater/web/api_endpoints.py— newtrace()method{"path": ["AA", "BB", "CC"], "timeout": 30}PacketBuilder.create_trace(path=trace_path)TraceHelper.register_ping()/router.inject_packet()/ event-loop pattern asping_neighborrepeater/handler_helpers/trace.py— per-hop SNR extractionprocess_trace_packet()now extracts SNR values frompacket.path[:packet.path_len]usingsnr_register_to_db()hop_snrsin the ping result — available to both/api/traceand/api/ping_neighborResponse shape
{ "success": true, "data": { "path": ["0xaa", "0xbb", "0xcc"], "hop_snrs": [{"raw": 58, "db": 14.5}, {"raw": 33, "db": 8.2}], "rtt_ms": 3247.12, "snr_db": 12.1, "rssi": -87, "tag": 12345 } }What's NOT changed
/api/ping_neighboris untouched — single-hop ping stays semantically separate.Co-Authored-By: Warp agent@warp.dev