@seeed-studio/meshtastic 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,136 +1,257 @@
1
- # openclaw-meshtastic
1
+ <p align="center">
2
+ <img src="media/GoMeshClaw.png" width="700" alt="Meshtastic LoRa hardware" />
3
+ </p>
2
4
 
3
- OpenClaw channel plugin for [Meshtastic](https://meshtastic.org/) LoRa mesh networks.
5
+ # MeshClaw: OpenClaw Meshtastic Channel Plugin
4
6
 
5
- Lets your OpenClaw gateway send and receive messages over Meshtastic devices — via USB serial, HTTP (WiFi), or MQTT broker.
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@seeed-studio/meshtastic">
9
+ <img alt="npm version" src="https://img.shields.io/npm/v/@seeed-studio/meshtastic.svg" />
10
+ </a>
11
+ <a href="https://www.npmjs.com/package/@seeed-studio/meshtastic">
12
+ <img alt="license" src="https://img.shields.io/npm/l/@seeed-studio/meshtastic.svg" />
13
+ </a>
14
+ <a href="https://github.com/openclaw/openclaw">
15
+ <img alt="openclaw compat" src="https://img.shields.io/badge/OpenClaw-2026.3.x-blue" />
16
+ </a>
17
+ </p>
6
18
 
19
+ <!-- LANG_SWITCHER_START -->
7
20
  <p align="center">
8
- <img src="media/hardware.jpg" width="400" alt="Meshtastic LoRa hardware with Seeed WM1302 module" />
21
+ <b>English</b> | <a href="README.zh-CN.md">中文</a> | <a href="README.ja.md">日本語</a> | <a href="README.fr.md">Français</a> | <a href="README.pt.md">Português</a> | <a href="README.es.md">Español</a>
9
22
  </p>
23
+ <!-- LANG_SWITCHER_END -->
24
+
25
+ **MeshClaw** is an OpenClaw channel plugin that lets your AI gateway send and receive messages over Meshtastic — no internet, no cell towers, just radio waves. Talk to your AI assistant from the mountains, the ocean, or anywhere the grid doesn't reach.
26
+
27
+ ⭐ Star us on GitHub — it motivates us a lot!
28
+
29
+ > [!IMPORTANT]
30
+ > This is a **channel plugin** for the [OpenClaw](https://github.com/openclaw/openclaw) AI gateway — not a standalone application. You need a running OpenClaw instance (Node.js 22+) to use it.
31
+
32
+ [Documentation][docs] · [Hardware Guide](#recommended-hardware) · [Report Bug][issues] · [Request Feature][issues]
33
+
34
+ ## Table of Contents
35
+
36
+ - [How It Works](#how-it-works)
37
+ - [Recommended Hardware](#recommended-hardware)
38
+ - [Features](#features)
39
+ - [Capabilities & Roadmap](#capabilities--roadmap)
40
+ - [Demo](#demo)
41
+ - [Quick Start](#quick-start)
42
+ - [Setup Wizard](#setup-wizard)
43
+ - [Configuration](#configuration)
44
+ - [Troubleshooting](#troubleshooting)
45
+ - [Development](#development)
46
+ - [Contributing](#contributing)
47
+
48
+ ## How It Works
49
+
50
+ ```mermaid
51
+ flowchart LR
52
+ subgraph mesh ["📻 LoRa Mesh Network"]
53
+ N["Meshtastic Nodes"]
54
+ end
55
+ subgraph gw ["⚙️ OpenClaw Gateway"]
56
+ P["Meshtastic Plugin"]
57
+ AI["AI Agent"]
58
+ end
59
+ N -- "Serial (USB)" --> P
60
+ N -- "HTTP (WiFi)" --> P
61
+ N -. "MQTT (Broker)" .-> P
62
+ P <--> AI
63
+ ```
10
64
 
11
- ## Demo
65
+ The plugin bridges Meshtastic LoRa devices and the OpenClaw AI agent. It supports three transport modes:
66
+
67
+ - **Serial** — direct USB connection to a local Meshtastic device
68
+ - **HTTP** — connects to a device over WiFi / local network
69
+ - **MQTT** — subscribes to a Meshtastic MQTT broker, no local hardware needed
12
70
 
13
- https://github.com/user-attachments/assets/demo.mp4
71
+ Inbound messages go through access control (DM policy, group policy, mention gating) before reaching the AI. Outbound replies are stripped of markdown formatting (LoRa devices can't render it) and chunked to fit radio packet size limits.
14
72
 
15
- > The video above shows OpenClaw communicating over a Meshtastic LoRa mesh network. If it doesn't load, see [media/demo.mp4](media/demo.mp4).
73
+ ## Recommended Hardware
74
+
75
+ <p align="center">
76
+ <img src="media/XIAOclaw.png" width="760" alt="Meshtastic device with Seeed XIAO module" />
77
+ </p>
78
+
79
+ | Device | Best for | Link |
80
+ | ----------------------------- | ----------------------- | ------------------ |
81
+ | XIAO ESP32S3 + Wio-SX1262 kit | Entry-level development | [Buy][hw-xiao] |
82
+ | Wio Tracker L1 Pro | Portable field gateway | [Buy][hw-wio] |
83
+ | SenseCAP Card Tracker T1000-E | Compact tracker | [Buy][hw-sensecap] |
84
+
85
+ No hardware? MQTT transport connects via broker — no local device required.
86
+
87
+ Any Meshtastic-compatible device works.
16
88
 
17
89
  ## Features
18
90
 
19
- - **Three transport modes**
20
- - **Serial** — connect a Meshtastic device via USB (e.g. `/dev/ttyUSB0`)
21
- - **HTTP** — connect over WiFi to a device's HTTP API (e.g. `meshtastic.local`)
22
- - **MQTT** — connect through an MQTT broker (e.g. `mqtt.meshtastic.org`), no local hardware needed
23
- - **Direct messages and group channels** — supports both DM and mesh channel conversations
24
- - **Access control** — DM policy (open / pairing / allowlist), per-channel allowlists, mention-gating for group channels
25
- - **Multi-account** — run multiple Meshtastic connections with independent configs
26
- - **LoRa region selection** — configure device region on connect (US, EU_868, CN, JP, etc.)
27
- - **Device display name** — set node longName, also used as @mention trigger in channels
28
- - **Interactive onboarding** — guided setup wizard via `openclaw setup`
29
- - **Auto-reconnect** — resilient connection handling with configurable retry
91
+ - **AI Agent Integration** — Bridges OpenClaw AI agents with Meshtastic LoRa mesh networks. Enables intelligent communication without cloud dependency.
92
+
93
+ - **Three Transport Modes** — Serial (USB), HTTP (WiFi), and MQTT support
94
+
95
+ - **DM & Group Channels with Access Control** — Supports both conversation modes with DM allowlists, channel response rules, and mention-gating
96
+
97
+ - **Multi-Account Support** — Run multiple independent connections simultaneously
98
+
99
+ - **Resilient Mesh Communication** — Auto-reconnect with configurable retries. Handles connection drops gracefully.
30
100
 
31
- ## Requirements
101
+ ## Capabilities & Roadmap
32
102
 
33
- - [OpenClaw](https://github.com/openclaw/openclaw) installed and running
34
- - Node.js 22+
35
- - For serial transport: a Meshtastic device connected via USB
36
- - For HTTP transport: a Meshtastic device on the same network
37
- - For MQTT transport: access to an MQTT broker (public `mqtt.meshtastic.org` works out of the box)
103
+ The plugin treats Meshtastic as a first-class channel just like Telegram or Discord — enabling AI conversations and skill invocation entirely over LoRa radio, without internet dependency.
38
104
 
39
- ## Install
105
+ | Query Information Offline | Cross-Channel Bridge: Send from off-grid, receive anywhere | 🔜 What's next: |
106
+ | ------------------------------------------------------------ | ---------------------------------------------------------- | ------------------------------------------------------------ |
107
+ | <img src="media/image1.png" alt="Query Information Offline" /> | <img src="media/image2.png" alt="Cross-Channel Bridge" /> | We plan to ingest real-time node data (GPS location, environmental sensors, device status) into OpenClaw's context, enabling the AI to monitor mesh network health and broadcast proactive alerts without waiting for user queries. |
108
+
109
+ ## Demo
110
+
111
+ <div align="center">
112
+
113
+ https://github.com/user-attachments/assets/837062d9-a5bb-4e0a-b7cf-298e4bdf2f7c
114
+
115
+ </div>
116
+
117
+ Fallback: [media/demo.mp4](media/demo.mp4)
118
+
119
+ ## Quick Start
40
120
 
41
121
  ```bash
122
+ # 1. Install plugin
42
123
  openclaw plugins install @seeed-studio/meshtastic
43
- ```
44
124
 
45
- Or install from a local directory during development:
125
+ # 2. Guided setup walks you through transport, region, and access policy
126
+ openclaw onboard
46
127
 
47
- ```bash
48
- git clone https://github.com/Seeed-Solution/openclaw-meshtastic.git
49
- openclaw plugins install -l ./openclaw-meshtastic
128
+ # 3. Verify
129
+ openclaw channels status --probe
50
130
  ```
51
131
 
52
- ## Configuration
132
+ <p align="center">
133
+ <img src="media/setup-screenshot.png" width="700" alt="OpenClaw setup wizard" />
134
+ </p>
53
135
 
54
- ### Interactive setup
136
+ ## Setup Wizard
55
137
 
56
- ```bash
57
- openclaw setup
58
- # Select "Meshtastic" when prompted for channel
59
- ```
138
+ Running `openclaw onboard` launches an interactive wizard that walks you through each configuration step. Below is what each step means and how to choose.
139
+
140
+ ### 1. Transport
60
141
 
61
- The wizard walks you through transport selection, connection details, region, access policy, and channel config.
142
+ How the gateway connects to the Meshtastic mesh:
143
+
144
+ | Option | Description | Requires |
145
+ | ----------------- | ------------------------------------------------------------ | ------------------------------------------------ |
146
+ | **Serial** (USB) | Direct USB connection to a local device. Auto-detects available ports. | Meshtastic device plugged in via USB |
147
+ | **HTTP** (WiFi) | Connects to a device over the local network. | Device IP or hostname (e.g. `meshtastic.local`) |
148
+ | **MQTT** (broker) | Connects to the mesh via an MQTT broker — no local hardware needed. | Broker address, credentials, and subscribe topic |
149
+
150
+ ### 2. LoRa Region
151
+
152
+ > Serial and HTTP only. MQTT derives the region from the subscribe topic.
153
+
154
+ Sets the radio frequency region on the device. Must match your local regulations and other nodes on the mesh. Common choices:
155
+
156
+ | Region | Frequency |
157
+ | -------- | ------------------- |
158
+ | `US` | 902–928 MHz |
159
+ | `EU_868` | 869 MHz |
160
+ | `CN` | 470–510 MHz |
161
+ | `JP` | 920 MHz |
162
+ | `UNSET` | Keep device default |
163
+
164
+ See [Meshtastic region docs](https://meshtastic.org/docs/getting-started/initial-config/#lora) for the full list.
165
+
166
+ ### 3. Node Name
167
+
168
+ The device's display name on the mesh. Also used as the **@mention trigger** in group channels — other users send `@OpenClaw` to talk to your bot.
169
+
170
+ - **Serial / HTTP**: optional — auto-detects from the connected device if left empty.
171
+ - **MQTT**: required — there is no physical device to read the name from.
172
+
173
+ ### 4. Channel Access (`groupPolicy`)
174
+
175
+ Controls whether and how the bot responds in **mesh group channels** (e.g. LongFast, Emergency):
176
+
177
+ | Policy | Behavior |
178
+ | -------------------- | ------------------------------------------------------------ |
179
+ | `disabled` (default) | Ignores all group channel messages. Only DMs are processed. |
180
+ | `open` | Responds in **every** channel on the mesh. |
181
+ | `allowlist` | Responds only in **listed** channels. You will be prompted to enter channel names (comma-separated, e.g. `LongFast, Emergency`). Use `*` as a wildcard to match all. |
182
+
183
+ ### 5. Require Mention
184
+
185
+ > Only appears when channel access is enabled (not `disabled`).
186
+
187
+ When enabled (default: **yes**), the bot only responds in group channels when someone mentions its node name (e.g. `@OpenClaw how's the weather?`). This prevents the bot from replying to every single message in the channel.
188
+
189
+ When disabled, the bot responds to **all** messages in allowed channels.
190
+
191
+ ### 6. DM Access Policy (`dmPolicy`)
192
+
193
+ Controls who can send **direct messages** to the bot:
194
+
195
+ | Policy | Behavior |
196
+ | ------------------- | ------------------------------------------------------------ |
197
+ | `pairing` (default) | New senders trigger a pairing request that must be approved before they can chat. |
198
+ | `open` | Anyone on the mesh can DM the bot freely. |
199
+ | `allowlist` | Only nodes listed in `allowFrom` can DM. All others are ignored. |
200
+
201
+ ### 7. DM Allowlist (`allowFrom`)
202
+
203
+ > Only appears when `dmPolicy` is `allowlist`, or when the wizard determines one is needed.
204
+
205
+ A list of Meshtastic User IDs allowed to send direct messages. Format: `!aabbccdd` (hex User ID). Multiple entries are comma-separated.
62
206
 
63
207
  <p align="center">
64
- <img src="media/setup-screenshot.png" width="600" alt="OpenClaw setup wizard with Meshtastic channel configured" />
208
+ <img src="media/image3.jpg" width="400" />
65
209
  </p>
66
210
 
67
- ### Manual configuration
211
+ ### 8. Account Display Names
212
+
213
+ > Only appears for multi-account setups. Optional.
214
+
215
+ Assigns human-readable display names to your accounts. For example, an account with ID `home` could be displayed as "Home Station". If skipped, the raw account ID is used as-is. This is purely cosmetic and does not affect functionality.
68
216
 
69
- Add to your OpenClaw config (`openclaw config edit`):
217
+ ## Configuration
218
+
219
+ The guided setup (`openclaw onboard`) covers everything below. See [Setup Wizard](#setup-wizard) for a step-by-step walkthrough. For manual config, edit with `openclaw config edit`.
70
220
 
71
- **Serial (USB device):**
221
+ ### Serial (USB)
72
222
 
73
223
  ```yaml
74
224
  channels:
75
225
  meshtastic:
76
- enabled: true
77
226
  transport: serial
78
227
  serialPort: /dev/ttyUSB0
79
228
  nodeName: OpenClaw
80
- dmPolicy: pairing
81
229
  ```
82
230
 
83
- **HTTP (WiFi device):**
231
+ ### HTTP (WiFi)
84
232
 
85
233
  ```yaml
86
234
  channels:
87
235
  meshtastic:
88
- enabled: true
89
236
  transport: http
90
237
  httpAddress: meshtastic.local
91
- httpTls: false
92
238
  nodeName: OpenClaw
93
- dmPolicy: pairing
94
239
  ```
95
240
 
96
- **MQTT (broker):**
241
+ ### MQTT (broker)
97
242
 
98
243
  ```yaml
99
244
  channels:
100
245
  meshtastic:
101
- enabled: true
102
246
  transport: mqtt
247
+ nodeName: OpenClaw
103
248
  mqtt:
104
249
  broker: mqtt.meshtastic.org
105
- port: 1883
106
250
  username: meshdev
107
251
  password: large4cats
108
252
  topic: "msh/US/2/json/#"
109
- tls: false
110
- dmPolicy: pairing
111
253
  ```
112
254
 
113
- ### Configuration reference
114
-
115
- | Key | Type | Default | Description |
116
- |-----|------|---------|-------------|
117
- | `transport` | `serial` \| `http` \| `mqtt` | `serial` | Connection method |
118
- | `serialPort` | string | — | Serial device path |
119
- | `httpAddress` | string | `meshtastic.local` | Device IP or hostname |
120
- | `httpTls` | boolean | `false` | Use HTTPS for HTTP transport |
121
- | `mqtt.broker` | string | `mqtt.meshtastic.org` | MQTT broker hostname |
122
- | `mqtt.port` | number | `1883` | MQTT broker port |
123
- | `mqtt.username` | string | `meshdev` | MQTT username |
124
- | `mqtt.password` | string | `large4cats` | MQTT password |
125
- | `mqtt.topic` | string | `msh/US/2/json/#` | MQTT subscribe topic |
126
- | `mqtt.tls` | boolean | `false` | Use TLS for MQTT |
127
- | `region` | string | `UNSET` | LoRa region (serial/HTTP only) |
128
- | `nodeName` | string | — | Device display name and @mention trigger |
129
- | `dmPolicy` | `open` \| `pairing` \| `allowlist` | `pairing` | DM access policy |
130
- | `allowFrom` | string[] | — | Allowed node IDs (e.g. `["!aabbccdd"]`) |
131
- | `groupPolicy` | `open` \| `allowlist` \| `disabled` | `disabled` | Group channel policy |
132
- | `channels` | object | — | Per-channel config (requireMention, tools, allowFrom) |
133
-
134
255
  ### Multi-account
135
256
 
136
257
  ```yaml
@@ -144,27 +265,80 @@ channels:
144
265
  transport: mqtt
145
266
  mqtt:
146
267
  broker: mqtt.meshtastic.org
268
+ topic: "msh/US/2/json/#"
147
269
  ```
148
270
 
149
- ## Verify
271
+ <details>
272
+ <summary><b>All Options Reference</b></summary>
273
+
274
+ | Key | Type | Default | Notes |
275
+ | ------------------- | ------------------------------- | --------------------- | ------------------------------------------------------------ |
276
+ | `transport` | `serial \| http \| mqtt` | `serial` | |
277
+ | `serialPort` | `string` | — | Required for serial |
278
+ | `httpAddress` | `string` | `meshtastic.local` | Required for HTTP |
279
+ | `httpTls` | `boolean` | `false` | |
280
+ | `mqtt.broker` | `string` | `mqtt.meshtastic.org` | |
281
+ | `mqtt.port` | `number` | `1883` | |
282
+ | `mqtt.username` | `string` | `meshdev` | |
283
+ | `mqtt.password` | `string` | `large4cats` | |
284
+ | `mqtt.topic` | `string` | `msh/US/2/json/#` | Subscribe topic |
285
+ | `mqtt.publishTopic` | `string` | derived | |
286
+ | `mqtt.tls` | `boolean` | `false` | |
287
+ | `region` | enum | `UNSET` | `US`, `EU_868`, `CN`, `JP`, `ANZ`, `KR`, `TW`, `RU`, `IN`, `NZ_865`, `TH`, `EU_433`, `UA_433`, `UA_868`, `MY_433`, `MY_919`, `SG_923`, `LORA_24`. Serial/HTTP only. |
288
+ | `nodeName` | `string` | auto-detect | Display name and @mention trigger. Required for MQTT. |
289
+ | `dmPolicy` | `open \| pairing \| allowlist` | `pairing` | Who can send direct messages. See [DM Access Policy](#6-dm-access-policy-dmpolicy). |
290
+ | `allowFrom` | `string[]` | — | Node IDs for DM allowlist, e.g. `["!aabbccdd"]` |
291
+ | `groupPolicy` | `open \| allowlist \| disabled` | `disabled` | Group channel response policy. See [Channel Access](#4-channel-access-grouppolicy). |
292
+ | `channels` | `Record<string, object>` | — | Per-channel overrides: `requireMention`, `allowFrom`, `tools` |
293
+
294
+ </details>
295
+
296
+ <details>
297
+ <summary><b>Environment Variable Overrides</b></summary>
298
+
299
+ These override the default account's config (YAML takes precedence for named accounts):
300
+
301
+ | Variable | Equivalent config key |
302
+ | ------------------------- | --------------------- |
303
+ | `MESHTASTIC_TRANSPORT` | `transport` |
304
+ | `MESHTASTIC_SERIAL_PORT` | `serialPort` |
305
+ | `MESHTASTIC_HTTP_ADDRESS` | `httpAddress` |
306
+ | `MESHTASTIC_MQTT_BROKER` | `mqtt.broker` |
307
+ | `MESHTASTIC_MQTT_TOPIC` | `mqtt.topic` |
308
+
309
+ </details>
310
+
311
+ ## Troubleshooting
312
+
313
+ | Symptom | Check |
314
+ | --------------------- | ------------------------------------------------------------ |
315
+ | Serial won't connect | Device path correct? Host has permission? |
316
+ | HTTP won't connect | `httpAddress` reachable? `httpTls` matches device? |
317
+ | MQTT receives nothing | Region in `mqtt.topic` correct? Broker credentials valid? |
318
+ | No DM responses | `dmPolicy` and `allowFrom` configured? See [DM Access Policy](#6-dm-access-policy-dmpolicy). |
319
+ | No group replies | `groupPolicy` enabled? Channel in allowlist? Mention required? See [Channel Access](#4-channel-access-grouppolicy). |
320
+
321
+ Found a bug? [Open an issue][issues] with transport type, config (redact secrets), and `openclaw channels status --probe` output.
322
+
323
+ ## Development
150
324
 
151
325
  ```bash
152
- openclaw channels status --probe
326
+ git clone https://github.com/Seeed-Solution/MeshClaw.git
327
+ cd MeshClaw
328
+ npm install
329
+ openclaw plugins install -l ./MeshClaw
153
330
  ```
154
331
 
155
- ## Environment variables
156
-
157
- These can be used as alternatives to config file settings:
158
-
159
- - `MESHTASTIC_TRANSPORT` — `serial`, `http`, or `mqtt`
160
- - `MESHTASTIC_SERIAL_PORT` — serial device path
161
- - `MESHTASTIC_HTTP_ADDRESS` — device IP or hostname
162
- - `MESHTASTIC_MQTT_BROKER` — MQTT broker hostname
163
-
164
- ## Supported LoRa regions
332
+ No build step — OpenClaw loads TypeScript source directly. Use `openclaw channels status --probe` to verify.
165
333
 
166
- US, EU_433, EU_868, CN, JP, ANZ, KR, TW, RU, IN, NZ_865, TH, UA_433, UA_868, MY_433, MY_919, SG_923, LORA_24
334
+ ## Contributing
167
335
 
168
- ## License
336
+ - [Open an issue][issues] for bugs or feature requests
337
+ - Pull requests welcome — keep code aligned with existing TypeScript conventions
169
338
 
170
- MIT
339
+ <!-- Reference-style links -->
340
+ [docs]: https://meshtastic.org/docs/
341
+ [issues]: https://github.com/Seeed-Solution/MeshClaw/issues
342
+ [hw-xiao]: https://www.seeedstudio.com/Wio-SX1262-with-XIAO-ESP32S3-p-5982.html
343
+ [hw-wio]: https://www.seeedstudio.com/Wio-Tracker-L1-Pro-p-6454.html
344
+ [hw-sensecap]: https://www.seeedstudio.com/SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-p-5913.html