diff --git a/orac/bot.py b/orac/bot.py index 87dafde..84e3b2d 100644 --- a/orac/bot.py +++ b/orac/bot.py @@ -178,8 +178,9 @@ def connect_and_run(port: str | None) -> None: boot("Connecting...") # `dl.connect()` auto-discovers the port, sends GET_INFO, applies - # RADIO_CONFIG via SET_CONFIG, and starts the keepalive daemon — - # no manual Ping/SetConfig/StartRx dance required. + # RADIO_CONFIG via SET_CONFIG (with `tx_power_dbm` auto-clamped to + # the device's PA ceiling — SX1262 caps at 22 dBm, SX1276 PA_BOOST + # at 20), and starts the keepalive daemon. dongle = dl.connect(port=port, timeout=2, config=RADIO_CONFIG) boot("Connected") diff --git a/orac/constants.py b/orac/constants.py index caf0c9f..7dbbc93 100644 --- a/orac/constants.py +++ b/orac/constants.py @@ -53,10 +53,10 @@ RADIO_CONFIG: dl.LoRaConfig = dl.LoRaConfig( sf=7, cr=dl.LoRaCodingRate.CR_4_5, sync_word=0x3444, - tx_power_dbm=22, # DongLoRa Protocol v2 removed the "max power" sentinel; 22 dBm - # is the SX1262 chip ceiling and the practical upper bound on every - # current DongLoRa board. If you operate a board with a lower cap, - # lower this (or read `d.info.tx_power_max_dbm` and rebuild the config). + tx_power_dbm=22, # Requested max. `connect_and_run` clamps this down to + # `dongle.info.tx_power_max_dbm` at connect time, so each board + # transmits at its own PA ceiling (SX1262: 22 dBm, SX1276 PA_BOOST: + # 20 dBm, …) without needing a per-board config table here. preamble_len=16, header_mode=dl.LoRaHeaderMode.EXPLICIT, payload_crc=True, diff --git a/pyproject.toml b/pyproject.toml index aa9df98..8ae8580 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ license = "MIT" requires-python = ">=3.10" authors = [{ name = "Stephen Waits" }] dependencies = [ - "donglora>=1.0.0,<2.0.0", + "donglora>=1.1.0,<2.0.0", "anthropic", "cobs", "pyserial", diff --git a/uv.lock b/uv.lock index 9a031c3..3824d28 100644 --- a/uv.lock +++ b/uv.lock @@ -178,7 +178,7 @@ wheels = [ [[package]] name = "donglora" -version = "1.0.0" +version = "1.1.0" source = { editable = "../client-py" } dependencies = [ { name = "cobs" },