
After three days of LoRaWAN theory, today I finally got to look at something closer to what I'll actually be working on: Meshtastic. This is the first time the internship material connected directly to a product line I'll be touching, so I paid extra attention.
Meshtastic is an open-source firmware project for building LoRa-based mesh messaging and positioning devices. The important word there is "mesh," and it's a genuinely different model from the LoRaWAN gateway topology I've been reading about all week. In LoRaWAN, end devices talk up to a fixed gateway, and the gateway relays to a network server — a hub-and-spoke shape. In a Meshtastic network, there's no fixed infrastructure requirement at all: every node can potentially relay messages for other nodes, hopping a message across multiple devices to reach one that's out of direct radio range. No cellular, no wifi backhaul, no internet connection required for the network to function at all.
Meshtastic runs on fairly common, inexpensive microcontroller-plus-LoRa-radio hardware — I saw ESP32-based boards and nRF52-based boards mentioned a lot, both paired with a Semtech LoRa radio chip. It's not tied to one specific board design, which I think is part of why it's gotten as popular as it has in the hobbyist and off-grid communications space — cheap, widely available hardware plus open firmware.
The other piece I spent time on today: channels. A Meshtastic channel is defined by a pre-shared key, and devices that share the same channel/key can decrypt each other's traffic. From what I read, this is how you get some privacy/access control on what is otherwise a fairly open mesh — anyone with a compatible radio in range can technically hear the packets, but without the right key they can't read the contents. I want to go back and actually read how the key exchange and channel config works at the message-format level, because right now I only understand it at the "there's a shared secret" level, not the "here's exactly what's encrypted with what" level.
Why this matters for me specifically: as I understand it, Siliqs' own mesh firmware for the SQC485Iv2 builds on Meshtastic concepts — using LoRa radios in a mesh topology rather than a LoRaWAN gateway setup, which fits our actual use case (RS485 sensors spread across an industrial site, not devices that need to reach the public internet directly). I don't yet know exactly where our firmware diverges from stock Meshtastic or how much is shared code versus a from-scratch reimplementation of similar ideas — that's high on my list to ask Wei about, since it seems pretty central to understanding our own product.
Tomorrow: MeshCore, which I'm told is a newer, smaller project doing something similar but with different design choices. Going in mostly blind on that one.

看了三天 LoRaWAN 理論之後,今天終於接觸到跟我實際會經手的東西比較接近的題目:Meshtastic。這是這次實習教材第一次直接連到我會碰到的產品線,所以我格外認真看。
Meshtastic 是一個開源韌體專案,用來打造以 LoRa 為基礎的 mesh 訊息傳遞跟定位裝置。重點字是「mesh」,這跟我這禮拜一直在讀的、以 gateway 為中心的 LoRaWAN 拓樸是真的不一樣的模型。在 LoRaWAN 裡,終端裝置往上跟固定的 gateway 通訊,gateway 再轉送給 network server——是一個中心輻射狀(hub-and-spoke)的結構。而在 Meshtastic 網路裡,完全不需要固定的基礎設施:每個節點原則上都能幫其他節點轉發訊息,讓一則訊息透過多個裝置一路跳(hop)到直接無線範圍之外的節點。整個網路運作不需要行動網路、不需要 wifi backhaul,也不需要連上網際網路。
Meshtastic 跑在相當常見、便宜的「微控制器 + LoRa radio」硬體組合上——我看到很多提到 ESP32 系列跟 nRF52 系列的板子,兩者都搭配 Semtech 的 LoRa radio 晶片。它不綁定單一板子設計,我覺得這也是它在玩家跟離網通訊(off-grid communications)圈子能這麼受歡迎的原因之一——便宜、容易取得的硬體加上開源韌體。
今天花時間看的另一個部分是 channel(頻道)。Meshtastic 的一個 channel 是由一組 pre-shared key(預先共享的金鑰)定義的,共用同一個 channel/key 的裝置才能解密彼此的流量。照我讀到的內容,這就是在一個原則上相當開放的 mesh 上取得某種隱私/存取控制的方式——技術上,範圍內任何有相容 radio 的人都能聽到封包,但沒有對的 key 就讀不到內容。我還想回頭去看金鑰交換跟 channel 設定在訊息格式層級到底是怎麼運作的,因為目前我只理解到「有一個共享祕密」這個程度,還沒到「這裡具體是用什麼加密什麼」的程度。
對我來說特別重要的原因是:照我目前的理解,Siliqs 自己給 SQC485Iv2 用的 mesh 韌體是建立在 Meshtastic 的概念之上——用 LoRa radio 組成 mesh 拓樸,而不是 LoRaWAN 那種 gateway 架構,這跟我們實際的使用情境相符(分散在工業現場的 RS485 感測器,而不是需要直接連上公開網際網路的裝置)。我還不知道我們的韌體具體在哪些地方跟原生 Meshtastic 不一樣、也不知道有多少是共用程式碼、有多少是針對類似想法重新從頭實作的——這件事在我要問 Wei 的清單裡排得很前面,因為它看起來對理解我們自己的產品相當關鍵。
明天要看 MeshCore,聽說是一個更新、更小的專案,做的是類似的事,但設計選擇不太一樣。這一篇大概是幾乎沒有底子就直接上了。