lora param optimizer
lora_param_optimizerRecommends 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | Regulatory region. Determines max TX power and duty cycle limit. | US915 |
| terrain | No | Terrain type for path loss model. open: line-of-sight, suburban: light buildings, urban: moderate buildings, dense_urban: city center, indoor: inside buildings. | suburban |
| priority | No | 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. | balanced |
| target_range_km | Yes | Desired communication range in kilometers. | |
| antenna_gain_dbi | No | Antenna gain in dBi. 2.15 = half-wave dipole reference. | |
| max_payload_bytes | No | Maximum payload size in bytes for airtime calculation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| airtime_ms | Yes | Packet airtime in milliseconds for the given payload. | |
| data_rate_bps | Yes | Effective data rate in bits per second. | |
| recommended_sf | Yes | Recommended spreading factor (7-12). | |
| estimated_range_km | Yes | Estimated achievable range in km with the recommended parameters. | |
| recommended_bw_khz | Yes | Recommended bandwidth in kHz (125, 250, or 500). | |
| recommended_tx_dbm | Yes | Recommended transmit power in dBm. | |
| estimated_battery_hours | Yes | Estimated battery life in hours with a 3000 mAh reference battery. | |
| messages_per_hour_limit | Yes | Maximum messages per hour under regional duty cycle constraint. |