"Day 25/30: Okay, Now I Can Actually See the Whole SQC485Iv2"

a block diagram of MCU, RS485, LoRa radio and antenna labeled SQC485Iv2

Today was less "learn something new" and more "watch three weeks of notes click into one picture." Wei asked me to walk him through what an SQC485Iv2 node actually does, end to end, without looking anything up. I could do it. That felt like a bigger milestone than any single day so far.

Here's the version I gave him. The SQC485Iv2 is a Modbus master for an RS485 bus — not a single sensor, a controller that can poll a whole bus of RS485/Modbus devices behind it. One node, many devices. That's the part I had backwards in my head until I re-read my day 16 and day 17 notes on Modbus RTU framing and register types — the node is the thing asking the questions (function codes, register addresses) and the field devices are the ones answering, exactly the master/slave conversation I wrote up on day 16.

But the SQC485Iv2 doesn't just sit there polling a bus and doing nothing with the answers — it reports what it collects over a private LoRa mesh, which is the whole reason days 4 through 12 existed in this series. It's running Meshtastic-based firmware, so the flood-routing behavior I wrote about on day 9 (every node that hears a message rebroadcasts it) and the channel/PSK privacy model from day 10 both apply directly here. That's what makes it a private industrial mesh and not just "LoRa devices in the same building" — the channel name and pre-shared key are what keep a customer's readings off anyone else's mesh nearby.

The piece that surprised me most today was realizing how much the firmware-constraints week (days 20-24) isn't background trivia — it's actively shaping what this node can and can't do. It's an MCU with a fixed, small flash budget (day 24), which means the firmware has to fit Modbus master logic, mesh routing, and role-specific behavior all in that same limited image — nothing is free. OTA updates go through the two-slot scheme I wrote about on day 21, so a firmware update to a node already deployed at a customer site doesn't require someone to physically visit it with a USB cable, which matters a lot for something bolted to a wall in a factory. And depending on deployment, power management (day 22) and the battery-voltage read chain (day 23) affect how aggressively a node can afford to poll its bus and transmit over the mesh versus how long it needs to survive on a battery.

What I hadn't appreciated until today: none of these are separate systems bolted together. The RS485/Modbus side, the LoRa mesh side, and the firmware constraints all trade off against each other in the same device. Poll the bus more often and you get fresher data but burn more power and airtime. Add more mesh hops and you get better coverage but slower round-trip times back to a gateway. Every one of those tradeoffs I studied in isolation over the last three weeks is actually one knob on the same physical board.

One thing I still want to nail down with Wei: I understand the node has distinct roles it can run in, but I haven't seen the actual behavioral split yet — that's tomorrow's topic, gateway mode versus field/sensor mode. I have a rough mental model but I don't trust it enough to write it up until I've actually seen it explained properly.

方塊圖顯示 MCU、RS485、LoRa radio、天線,標示 SQC485Iv2

今天比較不是「學新東西」,而是「看著三週的筆記湊成同一張圖」。Wei 要我不查任何資料,完整講一遍 SQC485Iv2 node 到底在做什麼。我講出來了。這個里程碑感覺比這系列任何單一一天都更有份量。

我跟他講的版本是這樣的:SQC485Iv2 是 RS485 bus 的 Modbus master——不是單一顆感測器,而是一台可以去 poll 整條 RS485/Modbus bus、bus 上掛好幾個裝置的 controller。一個 node,背後掛很多裝置。這點我腦中原本搞反過,直到重讀 day 16、day 17 關於 Modbus RTU frame 格式跟 register 類型的筆記——node 是那個發問的角色(function code、register address),bus 上的裝置是回答的一方,正是 day 16 寫過的 master/slave 對話模式。

但 SQC485Iv2 並不是坐在那邊 poll 完 bus 就沒事了——它會把收集到的資料透過私有 LoRa mesh 回報,這正是整個系列 day 4 到 day 12 存在的原因。它跑的是 Meshtastic-based 韌體,所以我在 day 9 寫的 flood-routing 行為(每個聽到訊息的 node 都會轉發)跟 day 10 的 channel/PSK 隱私模型,兩者都直接適用在這裡。這也是它是「私有」工業級 mesh、而不只是「同一棟樓裡的一堆 LoRa 裝置」的原因——channel name 跟 pre-shared key 就是讓客戶的讀數不會跟附近別人的 mesh 混在一起的關鍵。

今天最讓我意外的是意識到韌體限制那一週(day 20-24)根本不是背景知識,而是直接在塑造這台 node 能做什麼、不能做什麼。它是一顆 flash 空間固定又小的 MCU(day 24),意味著韌體得把 Modbus master 邏輯、mesh routing、跟角色相關的行為全部塞進同一份有限大小的映像檔裡——沒有一項是「免費」的。OTA 更新走的是我在 day 21 寫過的雙 slot 機制,所以已經部署在客戶現場的 node 要更新韌體,不需要有人帶著 USB 線親自跑一趟,這對「鎖在工廠牆上的東西」來說意義很大。而依部署情境不同,電源管理(day 22)跟電池電壓量測鏈(day 23)也會影響 node 能多積極地去 poll bus、透過 mesh 傳送,還是得多省著用才能撐過電池壽命。

今天才真正體會到:這些完全不是各自獨立、拼裝起來的系統。RS485/Modbus 那一側、LoRa mesh 那一側、跟韌體限制,三者其實在同一台裝置上彼此拉扯。Bus poll 得越勤,資料越新鮮,但耗電跟佔用的 airtime 也越多。Mesh hop 加多一點,覆蓋範圍變好,但回到 gateway 的來回時間變慢。過去三週分開研究的每一個 tradeoff,其實都是同一塊實體板子上的同一顆旋鈕。

還有一件事想再跟 Wei 確認:我知道這台 node 可以跑在不同的角色(role)下,但實際的行為差異我還沒真正看過——那是明天的主題,gateway mode 跟 field/sensor mode 的差別。我心裡有個粗略的模型,但還沒親眼看過完整說明之前,我不敢就這樣寫下去。