PA Power Sweep (Closed-Loop)
pa_sweepSweeps LoRa TX power settings, measures PA output on a power meter, and returns a configured-versus-measured table with compression and saturation analysis for calibration.
Instructions
Closed-loop PA calibration: step lora.tx_power through powers, measure the PA
on the ImmersionRC meter, and return a configured-vs-measured table with a
compression/saturation analysis.
Destructive: writes lora.tx_power, keys real ~200 B broadcasts onto the mesh, and
reboots between steps with reboot_between_steps. Requires confirm=True, or the
user's answer when the client can ask. A failed restore is listed in restore_errors,
or named in the error when the sweep itself fails. A step in silent_steps_dbm may be
a dead PA or a late TX, so rerun it spaced out. An uncalibrated bench check (about
±0.5 dB). See docs/power-meter.md.
Returns {band, region, requested_center_mhz, meter_cal_mhz, attenuator_db, tx_linger_s, floor_dbm, floor_margin_db, table: [{configured_dbm, measured_avg_dbm, measured_peak_dbm, delta_db, active_samples, total_samples, rf_observed}], curve: {points, saturation_dbm, max_measured_dbm, max_measured_at_configured_dbm, offset_at_min_db, monotonic}, silent_steps_dbm, config_restored, restore_errors, caveat}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"powers": "<powers>"
},
"name": "pa_sweep"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| band | No | A region name or MHz, as in `pa_measure`; defaults to the node's region. | |
| port | No | The node's serial port or `tcp://host[:port]`; omit to auto-select the one likely Meshtastic device. | |
| powers | Yes | The `lora.tx_power` steps to measure, in dBm. | |
| confirm | No | `True` once the user agreed; omitted, a client that can ask prompts the human. | |
| settle_s | No | Seconds to wait after each power change, and for the bursts to drain. | |
| meter_port | No | The meter's serial port; omit to find it by USB VID/PID. | |
| tx_linger_s | No | Seconds each burst holds the port open; `tx_linger_s=None` derives the per-burst linger from the live preset's airtime. | |
| burst_repeat | No | Broadcasts keyed per step. | |
| attenuator_db | No | The pad before the meter. Pick it so the top power minus the pad stays under the meter's +31 dBm maximum; the sweep refuses otherwise. | |
| channel_index | No | The channel the bursts go out on. | |
| restore_config | No | Put `tx_power` and the override back afterwards; pass `restore_config=False` to keep the last step. | |
| override_duty_cycle | No | `override_duty_cycle=True` (default) lifts the duty-cycle limit in every region for the sweep. | |
| reboot_between_steps | No | Reboot after each `tx_power` write, for firmware before 2.8.0. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| band | Yes | ||
| curve | Yes | The gain-curve analysis over the measured steps. | |
| table | Yes | ||
| caveat | Yes | ||
| region | Yes | ||
| floor_dbm | Yes | ||
| tx_linger_s | Yes | the per-burst linger used | |
| attenuator_db | Yes | ||
| meter_cal_mhz | Yes | ||
| restore_errors | Yes | ||
| config_restored | Yes | ||
| floor_margin_db | Yes | ||
| silent_steps_dbm | Yes | a dead PA or a late TX; rerun spaced out | |
| requested_center_mhz | Yes |