---
title: "Recommends optimal LoRa spreading factor, bandwidth, and TX power based on target range, terrain, and optimization priority. Iterates through all SF (7-12) and BW (125/250/500 kHz) combinations, computing achievable range, airtime, data rate, and battery impact for each. Ranks candidates by priority: 'range' maximizes distance, 'speed' minimizes airtime, 'battery' minimizes power consumption, 'balanced' penalizes extremes. Respects regional TX power limits (FCC/ETSI/ACMA) and duty cycle constraints. Returns the recommended parameters with estimated range, airtime, duty-cycle message limit, battery life, and data rate. Essential for tuning Meshtastic and LoRa deployments to specific requirements."
method: POST
path: "/api/lora_param_optimizer"
tags: ["mesh"]
---

# Recommends optimal LoRa spreading factor, bandwidth, and TX power based on target range, terrain, and optimization priority. Iterates through all SF (7-12) and BW (125/250/500 kHz) combinations, computing achievable range, airtime, data rate, and battery impact for each. Ranks candidates by priority: 'range' maximizes distance, 'speed' minimizes airtime, 'battery' minimizes power consumption, 'balanced' penalizes extremes. Respects regional TX power limits (FCC/ETSI/ACMA) and duty cycle constraints. Returns the recommended parameters with estimated range, airtime, duty-cycle message limit, battery life, and data rate. Essential for tuning Meshtastic and LoRa deployments to specific requirements.

`POST /api/lora_param_optimizer`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/lora_param_optimizer`
- Auth: none declared

## Request body

- object
  - `target_range_km` number, required: Desired communication range in kilometers.
  - `terrain` 'open' | 'suburban' | 'urban' | 'dense_urban' | 'indoor': Terrain type for path loss model. open: line-of-sight, suburban: light buildings, urban: moderate buildings, dense_urban: city center, indoor: inside buildings.
  - `max_payload_bytes` number: Maximum payload size in bytes for airtime calculation.
  - `priority` 'range' | 'speed' | 'battery' | 'balanced': Optimization priority. range: maximize distance (high SF, low BW). speed: minimize airtime (low SF, high BW). battery: minimize power draw. balanced: best trade-off across all factors.
  - `region` 'US915' | 'EU868' | 'AU915' | 'AS923': Regulatory region. Determines max TX power and duty cycle limit.
  - `antenna_gain_dbi` number: Antenna gain in dBi. 2.15 = half-wave dipole reference.

## Response `200`

Computed result for lora_param_optimizer

- object
  - `result` object, required
    - `recommended_sf` number, required: Recommended spreading factor (7-12).
    - `recommended_bw_khz` number, required: Recommended bandwidth in kHz (125, 250, or 500).
    - `recommended_tx_dbm` number, required: Recommended transmit power in dBm.
    - `estimated_range_km` number, required: Estimated achievable range in km with the recommended parameters.
    - `airtime_ms` number, required: Packet airtime in milliseconds for the given payload.
    - `messages_per_hour_limit` number, required: Maximum messages per hour under regional duty cycle constraint.
    - `estimated_battery_hours` number, required: Estimated battery life in hours with a 3000 mAh reference battery.
    - `data_rate_bps` number, required: Effective data rate in bits per second.
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
