
One of the more satisfying design problems I've worked through recently is how to make a mesh of Modbus RTU devices look, from a downstream SCADA system's point of view, like it's just... local RS485 devices. No mesh, no radio, no latency weirdness — just poll an address and get a reply. Getting there required picking apart what "Modbus over mesh" actually means, and it led us somewhere I didn't originally expect: supporting two different addressing modes on the gateway, not one.
The basic shape of the system
Each Siliqs node acts as a Modbus master for its own local RS485 bus — it's the one polling whatever sensors are wired to it, on its own schedule, and holding the latest readings. That data then travels over our private LoRa mesh to a gateway node, which is the one node that's also sitting on a downstream RS485 bus talking to something like a customer's SCADA system.
Here's the part that makes the whole thing feel instant instead of laggy: the gateway doesn't relay a request out over the mesh and wait for a live answer every time it's polled. It maintains a cache — the latest reading it has heard from every device on every other node's bus — and answers SCADA polls directly from that cache, in native Modbus RTU. From the SCADA master's perspective, it's polling a normal RS485 device and getting a normal, fast reply. It has no idea there's a mesh hop in between.
That speed comes with an obligation, though: never silently hand out old data. Every cached reading carries an age, and if a poll comes in for a reading older than a configurable staleness threshold, the gateway returns a proper Modbus exception rather than the stale value. A SCADA operator polling a node that's gone quiet — battery dead, out of range, whatever — needs to see an honest "this isn't current" signal, not a number that looks fine but is actually hours old.
Why one addressing mode wasn't enough
This is where the real design tradeoff showed up. The question is: under what Modbus slave address does the gateway present a remote sensor's cached data?
The first answer, and the obvious one, is transparent mode: the gateway answers under each remote sensor's own original Modbus slave address, exactly as if that sensor were sitting on the gateway's local bus. This is the drop-in option — if a customer already has a SCADA poll list with slave addresses 1 through 20, transparent mode means we don't touch that list at all. Zero configuration changes on their side. That matters a lot for retrofits and for any customer who doesn't want to re-validate their SCADA configuration just because we added mesh connectivity behind the scenes.
But transparent mode has a ceiling: standard Modbus RTU slave addressing tops out at 247 addresses on a single bus, and in practice a SCADA integrator may not want to burn a dozen distinct addresses managing a dozen sensors that, conceptually, belong to one physical installation. That's where aggregated mode comes in: several sensors' readings sit under one shared slave address, differentiated by register offset instead of slave address. From the SCADA side, it looks like one device with a wide register map, not a dozen separate devices. For a customer adding a new install to an already-crowded SCADA poll list, adding one aggregated address is a much smaller lift than adding several transparent ones.
So the real answer to "which mode should the gateway support" turned out to be: it depends entirely on what the customer's existing SCADA setup looks like and how they want to grow it, and we don't get to make that call for them. Supporting both modes on the same gateway means we're not forcing a migration decision onto a customer's existing infrastructure just because our mesh sits underneath it — which, for an industrial retrofit product, is exactly the kind of decision that should stay invisible to the layer above.

最近解得比較過癮的一個設計問題是:怎麼讓一整個 mesh 的 Modbus RTU 裝置,從下游 SCADA 系統的角度看起來,就只是……本地的 RS485 裝置。沒有 mesh、沒有無線電、沒有奇怪的延遲——就是 poll 一個位址、拿到一個回覆。要走到這一步,得先拆解清楚「Modbus over mesh」到底該長什麼樣子,而這個過程把我們帶到一個我原本沒預料到的地方:gateway 上要支援兩種不同的定址模式,而不是一種。
系統的基本樣貌
每個 Siliqs 節點都是自己那條本地 RS485 匯流排上的 Modbus master——它按自己的排程 poll 掛在上面的感測器,並保存最新的讀值。這些資料接著透過我們的私有 LoRa mesh 傳到 gateway 節點,而 gateway 同時也掛在下游的一條 RS485 匯流排上,跟客戶的 SCADA 系統之類的東西對話。
讓整套系統感覺即時而不是延遲的關鍵在這裡:gateway 被 poll 的時候,不會每次都透過 mesh 轉發請求出去、等一個即時回覆。它維護一份快取——記錄它從其他每個節點的匯流排上、每個裝置聽到的最新讀值——然後直接用原生 Modbus RTU 從這份快取回答 SCADA 的 poll。從 SCADA master 的角度看,它就是在 poll 一個普通的 RS485 裝置,拿到一個普通、快速的回覆。它完全不知道中間隔了一個 mesh hop。
不過這種速度是有代價的:絕不能悄悄地把過期資料當新的給出去。每一筆快取的讀值都帶著時間戳,如果 poll 進來時那筆讀值已經超過可設定的過期門檻,gateway 會回傳正規的 Modbus exception,而不是把那個過期值直接送出去。一個 SCADA 操作員在 poll 一個已經沉默的節點——電池沒電、超出範圍、隨便什麼原因——需要看到誠實的「這不是最新資料」訊號,而不是一個看起來正常、實際上卻是幾小時前的數字。
為什麼一種定址模式不夠用
真正的設計 tradeoff 在這裡浮現。問題是:gateway 該用哪個 Modbus slave address 來呈現某個遠端感測器的快取資料?
第一個答案,也是最直覺的答案,是 transparent 模式:gateway 用每個遠端感測器原本自己的 Modbus slave address 來回答,就好像那個感測器真的掛在 gateway 的本地匯流排上一樣。這是「直接插進去就能用」的選項——如果客戶原本的 SCADA poll list 已經有 slave address 1 到 20,transparent 模式代表我們完全不動那份清單,客戶端零設定變更。這對舊系統改裝,以及任何不想因為我們在背後加了 mesh 連線就得重新驗證整套 SCADA 設定的客戶來說,非常重要。
但 transparent 模式有天花板:標準 Modbus RTU 的 slave 定址在單一匯流排上最多 247 個位址,而實務上,SCADA 整合商可能不想為了概念上屬於同一個實體安裝點的十幾個感測器,就燒掉十幾個獨立位址去管理。這就是 aggregated 模式 派上用場的地方:好幾個感測器的讀值放在同一個共用 slave address 底下,用 register offset 而不是 slave address 來區分。從 SCADA 那端看,這就像一台有著寬廣 register map 的裝置,而不是十幾台各自獨立的裝置。對一個要把新裝置加進已經很擁擠的 SCADA poll list 的客戶來說,多加一個 aggregated address 遠比多加好幾個 transparent address 輕鬆得多。
所以「gateway 該支援哪種模式」這個問題,最後的真實答案是:完全取決於客戶現有的 SCADA 架構長什麼樣、以及他們想怎麼擴充,而這個選擇不該由我們替他們做。在同一個 gateway 上同時支援兩種模式,意味著我們不會因為底下多了一層我們的 mesh,就強迫客戶對他們既有的基礎架構做遷移決策——對一個工業改裝型產品來說,這正是應該對上層完全隱形的那種決策。