跳到主要內容Skip to content
09 — 技術細節Technical Deep Dive

想看細節的,
從這裡往下。

For readers who want
to go deeper.

韌體架構與封包格式收在摺疊區,不打斷一般訪客的閱讀節奏。

Firmware architecture and packet format — folded away so they don’t interrupt the main reading flow.

系統以 LoRa ESP32-S3+LoRa 無線模組為核心,預設 L4 Profile: SF9、125 kHz、Coding Rate 4/6。LoRa ESP32-S3 負責感測、資料封裝、 顯示與任務排程,LoRa 模組負責長距離短封包通訊;三種程式角色分別對應 受困者節點、搜救節點與 HQ 指揮鏈。

The system is built around LoRa ESP32-S3 + a LoRa radio module. Its default L4 profile uses SF9, 125 kHz bandwidth and coding rate 4/6. LoRa ESP32-S3 handles sensing, packet construction, display and task scheduling, while LoRa carries long-range short packets. Three program roles cover victim, rescue and HQ command-chain nodes.

韌體用途工作頻率
victim.ino受困者心跳、心率與 SOS910.1 MHz
rescue.ino搜救節點、BLE Gateway 與隊員命令910.x/911.x、913 MHz
hq.inoHQ 指揮鏈節點433 MHz
FirmwareRoleFrequency
victim.inoVictim heartbeat, heart rate and SOS910.1 MHz
rescue.inoRescue node, BLE gateway and team commands910.x / 911.x, 913 MHz
hq.inoHQ command-chain node433 MHz

三種韌體各自處理 LoRa、BLE 與本機警示,讓指揮命令、受困者狀態及緊急求救能在不同角色間傳遞。

Three firmware roles coordinate LoRa, BLE and local alerts to carry commands, victim status and emergency calls.

HQ 指揮中心端

hq.ino
  • 初始化 OLED、電池、LoRa 與 BLE,等待 Mac/iPad HQ App 連線。
  • 將 App 的指揮命令轉為 CMD 封包,透過 433 MHz 廣播。
  • 收到其他節點的 CMD 後解析內容,透過 BLE Notify 回傳 App。
  • 定期回報電量、LoRa 檔位、命令數量與節點狀態。

搜救/隊長端

rescue.ino
  • 由 iPhone Field App 設定人員、配對碼、頻率、模式與功率。
  • 長按 PRG 3 秒切換本機 SOS;啟動後每 10 秒廣播 MAYDAY。
  • 接收 ACK/SOS 後更新電量、心率、RSSI、SNR 與估算距離。
  • 收到 SOS 或 CMD 時啟動 OLED、蜂鳴器與震動提醒,並同步至 App。

受困者端

victim.ino
  • 透過 BLE 與手機同步 SOS、心率、電量、模式及配對狀態。
  • 可連接 Garmin 心率裝置;未連線時使用測試心率模式。
  • 短按 PRG 切換 SOS,長按 2 秒切換心率模式。
  • 一般狀態定期送出 ACK;SOS 時切換頻率並提高發送頻率。

HQ node

hq.ino
  • Initializes OLED, battery, LoRa and BLE, then awaits the Mac/iPad HQ App.
  • Converts app commands into CMD packets and broadcasts them over 433 MHz.
  • Relays received CMD packets and periodic node status to the app via BLE Notify.

Rescue / leader node

rescue.ino
  • The iPhone Field App configures identity, pairing, frequency, mode and power.
  • A three-second PRG hold toggles local SOS and sends MAYDAY every 10 seconds.
  • ACK, SOS and CMD packets update status, activate alerts and sync to the app.

Victim node

victim.ino
  • BLE synchronizes SOS, heart rate, battery, mode and pairing with a phone.
  • Uses Garmin heart rate when available, otherwise a test heart-rate mode.
  • Sends regular ACK packets, or faster SOS packets after SOS is activated.
指揮命令 HQ App BLE 433 MHz CMD 搜救節點 聲音/震動 iPhone App
受困者 SOS Victim SOS LoRa 搜救節點 OLED 資訊 聲音/震動 iPhone App
搜救員求救 長按 PRG 3 秒 本機 SOS 每 10 秒 MAYDAY 其他節點
Command HQ App BLE 433 MHz CMD Rescue node Alert iPhone App
Victim SOS Victim SOS LoRa Rescue node OLED / alert iPhone App
MAYDAY Hold PRG 3 sec Local SOS MAYDAY / 10 sec Other nodes

主迴圈採高速輪詢,以 millis() 獨立排程各項任務。Victim 一般模式每 15 秒回報, SOS 時縮短為 3 秒;Rescue 一般模式每 3 秒回報,並提供 Mountain、Power Save、 Ultra Save、Quake 與 Silent 模式;HQ 每 5 秒發送 HQPING。

The high-speed polling loop schedules independent tasks with millis(). Victim reports every 15 seconds, or every 3 seconds in SOS mode. Rescue reports every 3 seconds in Normal mode and also provides Mountain, Power Save, Ultra Save, Quake and Silent modes. HQ sends HQPING every 5 seconds.

Victim 會在 30 秒無互動後關閉 OLED,完成發送後讓無線電進入休眠,並依 RSSI 在 14/18/22 dBm 間動態調整功率;發送前再自動喚醒。

Victim turns off its OLED after 30 seconds of inactivity, sleeps the radio after transmission, wakes it before the next send, and adjusts output power among 14, 18 and 22 dBm according to RSSI.

發送前先執行 LoRa 頻道活動偵測,並搭配 Binary Exponential Backoff: BE 2–4、5 ms Slot、最多 3 次嘗試。系統使用 18 個搜尋頻道分流,另以 433 MHz 承載 HQ 指揮鏈、913 MHz 承載隊伍命令。

Before transmission, LoRa channel activity detection is combined with binary exponential backoff: BE 2–4, 5 ms slots and up to three attempts. Eighteen search channels distribute traffic, while 433 MHz carries the HQ chain and 913 MHz carries team commands.

Rescue 保存最近 10 個封包 ID、HQ 保存最近 20 個,避免重複套用;SOS 與 MAYDAY 採週期重播,緊急封包同時使用搜尋頻率與 913 MHz 雙頻送出,提升抵達率。

Rescue retains the latest 10 packet IDs and HQ retains 20 for deduplication. SOS and MAYDAY use periodic rebroadcasting, while emergency packets are sent on both the search frequency and 913 MHz to improve delivery.

線路資料使用 UTF-8 字串,以 | 分隔;共用 Header 依序為 pktId、pairCode、senderID、type、payload。接收端以 pktId 去重, pairCode 則用於區分不同隊伍。

On-air data uses UTF-8 strings separated by |. The shared header is pktId, pairCode, senderID, type and payload. Receivers deduplicate by pktId, while pairCode separates teams.

// Victim SOS · 典型 27–32 bytes
pktId|pair|sender|SOS|B{bat}|BPM{hr}

// Rescue Team · 典型 30–40 bytes
pktId|pair|sender|TEAM|B{bat}|V{count}|D{dept}

// Mayday · 約 80–150 bytes(含 GPS)
pktId|pair|sender|MAYDAY|B{bat}|N{name}|T{title}|LAT{lat}|LON{lon}|ACC{accuracy}

預設 L4 Profile 下,30-byte 封包空中時間約 0.25 秒、100-byte 約 0.65 秒、 200-byte 約 1.19 秒;系統依 255-byte payload 上限管理可變長度內容。

Under the default L4 profile, estimated time-on-air is approximately 0.25 seconds for 30 bytes, 0.65 seconds for 100 bytes and 1.19 seconds for 200 bytes. Variable-length content is managed within the 255-byte payload limit.

封包大小Packet size約 30–150 bytes(依類型;Mayday 含 GPS)~30–150 bytes (by type; Mayday w/ GPS)
傳送/看門狗TX / watchdog環境 5 分鐘;Watchdog 30 秒Env 5 min; watchdog 30 s
遺失率目標Loss target開闊地 < 5%;邊緣 < 15%Open < 5%; edge < 15%
安全與部署Safety & Deployment

不只要傳得到,
也要能在現場撐得住。

Built not only to connect,
but to endure the field.

從裝置保護、斷線容錯到命令權限,系統以災區持續運作與可控部署為設計前提。

From enclosure protection and link-loss tolerance to command authority, the system is designed for controlled, continuous disaster-field operation.

環境防護FIELD PROTECTION 故障容錯FAULT TOLERANCE 權限控管ACCESS CONTROL

外殼採封閉式結構、接縫防潑水處理與連接埠防護蓋,降低雨水與粉塵進入風險;四角緩衝與內部固定結構可吸收跌落及運輸震動。操作按鍵保留戴手套時的辨識度,方便救援現場快速使用。

The enclosure uses a closed structure, splash-resistant seams and protected ports to reduce water and dust ingress. Corner buffers and internal mounting absorb drops and transport vibration, while controls remain identifiable when wearing gloves.

電源模組具備過充、過放、過流與短路保護。節點持續回報電量,低於警戒值時會在 OLED 與 App 顯示警報;電量進一步下降後,自動降低非必要更新頻率,優先保留 SOS、定位與基本通訊能力。

The power module protects against overcharge, over-discharge, overcurrent and short circuits. Nodes continuously report battery level; OLED and app warnings appear below the alert threshold, followed by reduced non-essential updates to preserve SOS, location and basic communications.

通訊中斷不會停止節點本地工作:感測、SOS 按鍵與警報判斷仍持續運作。系統會重試可用頻道並保留最新狀態;指揮端在逾時後標示節點離線,重新連線時再更新狀態,避免舊資料被誤認為即時資訊。

A lost link does not stop local sensing, the SOS button or alert decisions. The node retries available channels and retains its latest status. Command interfaces mark timed-out nodes offline and refresh their state after reconnection so stale data is not mistaken for live information.

系統不依賴單一中心節點維持前線通訊;個別節點失聯時,其餘節點仍可繼續交換資料。指揮端依心跳逾時標示失聯節點與最後狀態,替換節點則可透過相同隊伍配對流程重新加入,不需要重建整套網路。

Front-line communications do not depend on one central node. Other nodes continue exchanging data when an individual unit is lost. The command interface shows its last state and heartbeat timeout, while a replacement can rejoin through the same team-pairing process.

節點僅接受相同隊伍配對碼的資料,避免不同搜救隊伍互相套用命令。一般隊員、隊長與 HQ 依角色分級:狀態回報可由前線節點送出,隊伍命令由隊長發布,跨隊或 HQ 級指令則限指揮端操作。

Nodes accept data only from the matching team code, preventing commands from one rescue team being applied by another. Authority is role-based: field nodes report status, team leaders issue team commands, and cross-team or HQ-level instructions are restricted to command operators.

配對碼負責隊伍隔離與基本存取控制,不等同端對端加密;正式部署可依任務風險加入金鑰與訊息驗證機制。Pair codes provide team isolation and basic access control; they are not equivalent to end-to-end encryption. Deployment profiles can add keys and message authentication according to mission risk.

SOS、MAYDAY、ALERT 與高優先級 CMD 會優先於一般心跳與狀態回報。緊急訊息採較短重播週期,並透過搜索頻率與 913 MHz 雙頻送出;接收端以封包 ID 去重,降低重播造成的重複警報。

SOS, MAYDAY, ALERT and high-priority CMD traffic takes precedence over routine heartbeats and status reports. Emergency messages use shorter rebroadcast intervals and transmit on both the search frequency and 913 MHz; packet-ID deduplication prevents repeated alerts at the receiver.

網站所列頻率與 14/18/22 dBm 功率為系統測試 Profile。正式部署時,會依使用地區的頻譜規範、允許頻段、等效輻射功率、占空比與設備認證條件選用設定,並使用符合當地要求的無線模組、天線及電源配置。

The listed frequencies and 14 / 18 / 22 dBm levels are system test profiles. Operational deployment selects settings according to local spectrum rules, permitted bands, effective radiated power, duty-cycle limits and equipment certification, using compliant radio modules, antennas and power configurations.

測試 Profile 不代表在所有地區均可直接使用;每次跨地區或正式部署前,均須重新完成法規與設備條件檢核。A test profile is not automatically authorised in every region. Regulatory and equipment conditions must be checked again before operational deployment or use in another jurisdiction.
10 — 部署方案Deployment Plan

從單隊到鄉鎮規模。

From one team to township scale.

以下均為設計情境與成本試算,用於比較不同部署規模,不代表已完成相同規模的正式演練或採購。

These design scenarios and cost estimates compare deployment scales; they do not claim a completed drill or purchase at the same scale.

01

單隊演練情境

Single-team scenario

  • 4 名搜救員、10 個節點、1 個 HQ 指揮端
  • 規劃範圍 1 km²,任務時間 90 分鐘
  • 同時處理 1 個 Victim SOS 與 1 個搜救員 MAYDAY
  • 4 rescuers, 10 nodes and 1 HQ command endpoint
  • 1 km² planned area and a 90-minute mission
  • One Victim SOS and one rescuer MAYDAY handled concurrently
02

規模化與成本

Scaling & cost

  • 10 節點:約 NT$20,000
  • 40 節點:約 NT$80,000
  • 100 節點:約 NT$200,000;均以 SBN 基準 NT$2,000/節點估算,不含人力、載具、SEN 價差與備品
  • 10 nodes: approximately NT$20,000
  • 40 nodes: approximately NT$80,000
  • 100 nodes: approximately NT$200,000; calculated from the SBN baseline of NT$2,000 per node, excluding labour, vehicles, SEN cost differences and spares
03

鄉鎮級情境

Township-scale scenario

  • 4 支搜救隊、40 個節點、2 個 HQ 端點
  • 規劃範圍 4 km²,節點平均間距約 300–500 m
  • 40 節點高負載預估抵達率 93.5%,P95 延遲 2.7 s
  • 保留 10% 備援節點,即另備 4 個節點
  • 4 rescue teams, 40 nodes and 2 HQ endpoints
  • 4 km² planned area with 300–500 m average node spacing
  • 40-node high-load estimate: 93.5% delivery and 2.7 s P95 latency
  • 10% node reserve, equivalent to 4 spare nodes