feat!: orac on donglora 1.0 async Dongle API

Upgrade the MeshCore bot to talk the DongLoRa Protocol v2 via donglora 1.0.0.

* BotRuntime now holds a donglora.Dongle instead of a raw serial conn. All transmit / receive / ADVERT plumbing goes through the async Dongle surface.

* Drop the direct pyserial imports; SerialException handling is now dongle-level (reconnect is handled by donglora.connect()).

* Update constants and dispatch to match the Dongle accessors (info, set_config, transmit, start_rx) exposed by the 1.0 client.
This commit is contained in:
swaits committed 2026-04-22 09:57:01 -06:00
1 parent 54228a6f92
commit a0a26a32f1
4 files changed
+75 -68

No files matched your search

+17 -8
View File
@@ -4,6 +4,8 @@ from __future__ import annotations
from pathlib import Path
import donglora as dl
# ── Bot identity ─────────────────────────────────────────────────
BOT_NAME: str = "Orac"
@@ -45,14 +47,21 @@ STATE_FILE: Path = DATA_DIR / "orac_state.json"
# ── Radio ────────────────────────────────────────────────────────
RADIO_CONFIG: dict[str, int] = {
"freq_hz": 910_525_000,
"bw": 6, # 62.5 kHz
"sf": 7,
"cr": 5, # CR 4/5
"sync_word": 0x3444,
"tx_power_dbm": -128, # TX_POWER_MAX
}
RADIO_CONFIG: dl.LoRaConfig = dl.LoRaConfig(
freq_hz=910_525_000,
bw=dl.LoRaBandwidth.KHZ_62_5,
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).
preamble_len=16,
header_mode=dl.LoRaHeaderMode.EXPLICIT,
payload_crc=True,
iq_invert=False,
)
# ── AI system prompt ─────────────────────────────────────────────