Skip to content

Antenna tracking#76

Open
haoruizhou wants to merge 2 commits into
mainfrom
antenna-tracking
Open

Antenna tracking#76
haoruizhou wants to merge 2 commits into
mainfrom
antenna-tracking

Conversation

@haoruizhou

Copy link
Copy Markdown
Contributor

No description provided.

Introduce a new dev-utils/rf-tracker tool that visualizes and serves RF antenna data from a Rocket M2 device.

Files added:
- index.html: standalone web UI with a directional display, calibration controls (bias), smoothing, and a normalized strength meter that polls /signal.
- main.py: FastAPI app serving the UI and a /signal endpoint that queries the Rocket device and returns chain0/chain1, error, normalized, and strength values. Host/user/password can be configured via ROCKET_HOST/ROCKET_USER/ROCKET_PASS env vars.
- rocket_reader.py: SSH reader using paramiko to run mca-status, parse chain values, compute error/strength, and normalize error.
- requirements.txt: declares fastapi, uvicorn, and paramiko.

Purpose: provide a lightweight local web tool to point/align an antenna by reading per-chain RSS values from the Rocket device and showing direction, strength, and calibration controls.
@@ -0,0 +1,55 @@
import os
import json
import json
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a637fe2fa0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return self.parse(output)

def parse(self, raw):
match = re.search(r'"chain":\s*\[(-?\d+),\s*(-?\d+)\]', raw)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse mca-status key/value output

Rocket M2/airOS mca-status output is key/value text with fields such as chain0Signal=-77 and chain1Signal=-78 rather than a JSON "chain" array (for example, Ubiquiti community examples show mca-status...chain0Signal=-77chain1Signal=-78). With this regex the parser never matches the hardware output, so /signal always reports {"error":"no data"} and the tracker cannot display antenna direction; parse the chain0Signal/chain1Signal fields or query the JSON status endpoint instead.

Useful? React with 👍 / 👎.

try {
const res = await fetch(API);
const data = await res.json();
if (data.error) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow nonzero errors when setting bias

When the current RF error is any nonzero numeric value, this truthiness check returns early, so the “Set Baseline Here” button only works when the antenna is already perfectly centered (0) and cannot save the intended offset during normal calibration. Check only the sentinel/no-data case instead of treating all nonzero measurements as failures.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant