meshcore-cli 1.2.12__py3-none-any.whl → 1.3.6__py3-none-any.whl

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.
@@ -0,0 +1,349 @@
1
+ Metadata-Version: 2.4
2
+ Name: meshcore-cli
3
+ Version: 1.3.6
4
+ Summary: Command line interface to meshcore companion radios
5
+ Project-URL: Homepage, https://github.com/fdlamotte/meshcore-cli
6
+ Project-URL: Issues, https://github.com/fdlamotte/meshcore-cli/issues
7
+ Author-email: Florent de Lamotte <florent@frizoncorrea.fr>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.10
13
+ Requires-Dist: bleak<2.0,>=0.22
14
+ Requires-Dist: meshcore>=2.2.2
15
+ Requires-Dist: prompt-toolkit>=3.0.50
16
+ Requires-Dist: pycryptodome
17
+ Requires-Dist: requests>=2.28.0
18
+ Description-Content-Type: text/markdown
19
+
20
+ # meshcore-cli
21
+
22
+ meshcore-cli : CLI interface to MeschCore companion app over BLE, TCP or Serial
23
+
24
+ ## Install
25
+
26
+ Meshcore-cli depends on the [python meshcore](https://github.com/fdlamotte/meshcore_py) package. You can install both via `pip` or `pipx` using the command:
27
+
28
+ <pre>
29
+ $ pipx install meshcore-cli
30
+ </pre>
31
+
32
+ It will install you `meshcore-cli` and `meshcli`, which is an alias to the former.
33
+
34
+ You can use the flake under [nix](https://nixos.org/):
35
+
36
+ <pre>
37
+ $ nix run github:meshcore-dev/meshcore-cli#meshcore-cli
38
+ </pre>
39
+
40
+ If you want meshcore-cli to remember last BLE device, you should have some `$HOME/.config/meshcore` where configuration for meschcore-cli will be stored (if not it will use first device it finds).
41
+
42
+ ## Usage
43
+
44
+ <pre>
45
+ $ meshcli &lt;args&gt; &lt;commands&gt;
46
+ </pre>
47
+
48
+ If using BLE, don't forget to pair your device first (using `bluetoothctl` for instance on Linux) or meshcli won't be able to communicate. There is a device selector for BLE, you'll just have to use `meshcli -S` to select your device, subsequent calls to meshcli will be send to that device.
49
+
50
+ ### Configuration
51
+
52
+ Configuration files are stored in `$HOME/.config/meshcore`
53
+
54
+ If the directory exists, default ble address and history will be stored there.
55
+
56
+ If there is an initialization script file called `init`, it will be executed just before the commands provided on command line are executed (and after evaluation of the arguments).
57
+
58
+ Init files can also be defined for a given device, meshcore-cli will look for `&lt;device-name>.init` file in configuration directory (usefull to specify timeout for contacts that are behind bridges with `contact_timeout` command).
59
+
60
+ ### Arguments
61
+
62
+ Arguments mostly deals with connection to the node
63
+
64
+ <pre>
65
+ -h : prints this help
66
+ -v : prints version
67
+ -j : json output (disables init file)
68
+ -D : debug
69
+ -S : scan for devices and show a selector
70
+ -l : list available ble/serial devices and exit
71
+ -T &lt;timeout&gt; : timeout for the ble scan (-S and -l) default 2s
72
+ -a &lt;address&gt; : specifies device address (can be a name)
73
+ -d &lt;name&gt; : filter meshcore devices with name or address
74
+ -P : forces pairing via the OS
75
+ -t &lt;hostname&gt; : connects via tcp/ip
76
+ -p &lt;port&gt; : specifies tcp port (default 5000)
77
+ -s &lt;port&gt; : use serial port &lt;port&gt;
78
+ -b &lt;baudrate&gt; : specify baudrate
79
+ -C : toggles classic mode for prompt
80
+ -c &lt;on/off&gt; : disables most of color output if off
81
+ </pre>
82
+
83
+ ### Available Commands
84
+
85
+ Commands are given after arguments, they can be chained and some have shortcuts. Also prefixing a command with a dot `.` will force it to output json instead of synthetic result.
86
+
87
+ <pre>
88
+ ?&lt;cmd&gt; may give you some more help about cmd
89
+ General commands
90
+ chat : enter the chat (interactive) mode
91
+ chat_to &lt;ct&gt; : enter chat with contact to
92
+ script &lt;filename&gt; : execute commands in filename
93
+ infos : print informations about the node i
94
+ self_telemetry : print own telemtry t
95
+ card : export this node URI e
96
+ ver : firmware version v
97
+ reboot : reboots node
98
+ sleep &lt;secs&gt; : sleeps for a given amount of secs s
99
+ wait_key : wait until user presses &lt;Enter&gt; wk
100
+ apply_to &lt;f&gt; &lt;cmds&gt; : sends cmds to contacts matching f at
101
+ Messaging
102
+ msg &lt;name&gt; &lt;msg&gt; : send message to node by name m {
103
+ wait_ack : wait an ack wa }
104
+ chan &lt;nb&gt; &lt;msg&gt; : send message to channel number &lt;nb&gt; ch
105
+ public &lt;msg&gt; : send message to public channel (0) dch
106
+ recv : reads next msg r
107
+ wait_msg : wait for a message and read it wm
108
+ sync_msgs : gets all unread msgs from the node sm
109
+ msgs_subscribe : display msgs as they arrive ms
110
+ get_channels : prints all channel info
111
+ get_channel &lt;n&gt; : get info for channel (by number or name)
112
+ set_channel n nm k : set channel info (nb, name, key)
113
+ remove_channel &lt;n&gt; : remove channel (by number or name)
114
+ scope &lt;s&gt; : sets node's flood scope
115
+ Management
116
+ advert : sends advert a
117
+ floodadv : flood advert
118
+ get &lt;param&gt; : gets a param, \"get help\" for more
119
+ set &lt;param&gt; &lt;value&gt; : sets a param, \"set help\" for more
120
+ time &lt;epoch&gt; : sets time to given epoch
121
+ clock : get current time
122
+ clock sync : sync device clock st
123
+ node_discover &lt;filter&gt; : discovers nodes based on their type nd
124
+ Contacts
125
+ contacts / list : gets contact list lc
126
+ reload_contacts : force reloading all contacts rc
127
+ contact_info &lt;ct&gt; : prints information for contact ct ci
128
+ contact_timeout &lt;ct&gt; v : sets temp default timeout for contact
129
+ share_contact &lt;ct&gt; : share a contact with others sc
130
+ export_contact &lt;ct&gt; : get a contact's URI ec
131
+ import_contact &lt;URI&gt; : import a contact from its URI ic
132
+ remove_contact &lt;ct&gt; : removes a contact from this node
133
+ path &lt;ct&gt; : diplays path for a contact
134
+ disc_path &lt;ct&gt; : discover new path and display dp
135
+ reset_path &lt;ct&gt; : resets path to a contact to flood rp
136
+ change_path &lt;ct&gt; &lt;pth&gt; : change the path to a contact cp
137
+ change_flags &lt;ct&gt; &lt;f&gt; : change contact flags (tel_l|tel_a|star)cf
138
+ req_telemetry &lt;ct&gt; : prints telemetry data as json rt
139
+ req_mma &lt;ct&gt; : requests min/max/avg for a sensor rm
140
+ req_acl &lt;ct&gt; : requests access control list for sensor
141
+ pending_contacts : show pending contacts
142
+ add_pending &lt;pending&gt; : manually add pending contact
143
+ flush_pending : flush pending contact list
144
+ Repeaters
145
+ login &lt;name&gt; &lt;pwd&gt; : log into a node (rep) with given pwd l
146
+ logout &lt;name&gt; : log out of a repeater
147
+ cmd &lt;name&gt; &lt;cmd&gt; : sends a command to a repeater (no ack) c [
148
+ wmt8 : wait for a msg (reply) with a timeout ]
149
+ req_status &lt;name&gt; : requests status from a node rs
150
+ req_neighbours &lt;name&gt; : requests for neighbours in binary form rn
151
+ trace &lt;path&gt; : run a trace, path is comma separated
152
+ </pre>
153
+
154
+ ### Interactive Mode
155
+
156
+ aka Instant Message or chat mode ...
157
+
158
+ Chat mode lets you interactively interact with your node or remote nodes. It is automatically triggered when no option is given on the command line.
159
+
160
+ You'll get a prompt with the name of your node. From here you can type meshcore-cli commands. The prompt has history and a basic completion (pressing tab will display possible command or argument options).
161
+
162
+ The `to` command is specific to chat mode, it lets you enter the recipient for next command. By default you're on your node but you can enter other nodes or public rooms. Here are some examples :
163
+
164
+ - `to <dest>` : will enter dest (node or channel)
165
+ - `to /`, `to ~` : will go to the root (your node)
166
+ - `to ..` : will go to the last node (it will switch between the two last nodes, this is just a 1-depth history)
167
+ - `to !` : will switch to the node you received last message from
168
+
169
+ When you are in a node, the behaviour will depend on the node type, if you're on a chat node, it will send messages by default and you can chat. On a repeater or a room server, it will send commands (autocompletion has been set to comply with the CommonCli class of meshcore). To send a message through a room you'll have to prefix the message with a quote or use the send command.
170
+
171
+ The `/` character is used to bypass the node you have currently selected using `to`:
172
+ - `/<cmd>` issues cmd command on the root
173
+ - `/<node>/<cmd>` will send cmd to selected node
174
+ - `/<dest> <msg>` will send msg to dest (channel or node)
175
+
176
+ #### Flood Scope in interactive mode
177
+
178
+ Flood scope has recently been introduced in meshcore (from `v1.10.0`). It limits the scope of packets to regions, using transport codes in the frame.
179
+
180
+ When entering chat mode, scope will be reset to `*`, meaning classic flood.
181
+
182
+ You can switch scope using the `scope` command, or postfixing the `to` command with `%<scope>`.
183
+
184
+ Scope can also be applied to a command using `%` before the scope name. For instance `login%#Morbihan` will limit diffusion of the login command (which is usually sent flood to get the path to a repeater) to the `#Morbihan` region.
185
+
186
+ #### Channel echoes
187
+
188
+ It's sometimes interesting to know the path taken by a message received from a channel or which repeaters have repeated a sent message.
189
+
190
+ The app give you the information by listening `rx_log` from the device, when obtained the information is attached to the message and can be read.
191
+
192
+ In meshcore-cli I went lower-level by implementing channel echoes. When activated (with `/set channel_echoes on`), all the channel messages will be printed on the terminal along with the SNR and path taken. When sending a message, you'll have all the repeats from 0-hop repeaters as echoes, and when a message is received, you should see information about the received message, but also all the instances of the same message that might have reached you from another path.
193
+
194
+ In the example below, a msg has been sent between two repeaters, 21 and 25. 25 repeated the message and 21 the repeat and both echoes came back to the node with different SNRs.
195
+
196
+ ```
197
+ f1down/#fdl|*> 8
198
+ #fdl f1down: 8 [25] -4.75-112
199
+ #fdl f1down: 8 [2521] 1.00-109
200
+ ```
201
+
202
+ ### Contact management
203
+
204
+ To receive a message from another user, it is necessary to have its public key. This key is stored on a contact list in the device, and this list has a finite size (50 when meshcore started, now over 350 for most devices).
205
+
206
+ By default contacts are automatically added to the device contact list when an advertisement is received, so as soon as you receive an advert, you can talk with your buddy.
207
+
208
+ With growing number of users, it becomes necessary to manage contact list and one of the ways is to add contacts manually to the device. This is done by turning on `manual_add_contacts`. Once this option has been turned on, a pending list is built by meshcore-cli from the received adverts. You can view the list issuing a `pending_contacts` command, flush the list using `flush_pending` or add a contact from the list with `add_pending` followed by the key of the contact or its name (both will be auto-completed with tab).
209
+
210
+ This feature only really works in interactive mode.
211
+
212
+ Note: There is also an `auto_update_contacts` setting that has nothing to do with adding contacts, it permits to automatically sync contact lists between device and meshcore-cli (when there is an update in name, location or path).
213
+
214
+ ### Issuing batch commands to contacts with apply to
215
+
216
+ `apply_to <f> <cmd>` : applies cmd to contacts matching filter `<f>` it can be used to apply the same command to a pool of repeaters, or remove some contacts matching a condition.
217
+
218
+ Filter is constructed with comma separated fields :
219
+
220
+ - `u`, matches modification time `<` or `>` than a timestamp (can also be days hours or minutes ago if followed by `d`,`h` or `m`)
221
+ - `t`, matches the type (1: client, 2: repeater, 3: room, 4: sensor)
222
+ - `h`, matches number of hops
223
+ - `d`, direct, similar to `h>-1`
224
+ - `f`, flood, similar to `h<0` or `h=-1`
225
+
226
+ Commands should be written as if in interactive mode, if writing from the commandline don't forget to use commas to clearly delimit fields.
227
+
228
+ Note: Some commands like `contact_name` (aka `cn`), `reset_path` (aka `rp`), `forget_password` (aka `fp`) can be chained. There is also a `sleep` command taking an optional time parameter. The sleep will be issued after the command, it helps limiting rate through repeaters ...
229
+
230
+ #### Examples
231
+
232
+ ```
233
+ # removes all clients that have not been updated in last 2 days
234
+ at u<2d,t=1 remove_contact
235
+ # gives traces to repeaters that have been updated in the last 24h and are direct
236
+ at t=2,u>1d,d cn trace
237
+ # tries to do flood login to all repeaters
238
+ at t=2 rp login
239
+ ```
240
+
241
+ ## Examples
242
+
243
+ <pre>
244
+ # gets info from first ble MC device it finds (was -s but now used for serial port)
245
+ $ meshcore-cli -d "" infos
246
+ INFO:meshcore:Scanning for devices
247
+ INFO:meshcore:Found device : C2:2B:A1:D5:3E:B6: MeshCore-t114_fdl
248
+ INFO:meshcore:BLE Connection started
249
+ {
250
+ "adv_type": 1,
251
+ "tx_power": 22,
252
+ "max_tx_power": 22,
253
+ "public_key": "993acd42fc779962c68c627829b32b111fa27a67d86b75c17460ff48c3102db4",
254
+ "adv_lat": 47.794,
255
+ "adv_lon": -3.428,
256
+ "radio_freq": 869.525,
257
+ "radio_bw": 250.0,
258
+ "radio_sf": 11,
259
+ "radio_cr": 5,
260
+ "name": "t114_fdl"
261
+ }
262
+
263
+ # getting time
264
+ $ meshcli -a C2:2B:A1:D5:3E:B6 clock
265
+ INFO:meshcore:BLE Connection started
266
+ Current time : 2025-04-18 08:19:26 (1744957166)
267
+
268
+ # If you're familiar with meshcli, you should have noted that
269
+ # now output is not json only, to get json output, use -j
270
+ # or prefix your commands with a dot
271
+ $ meshcli -a C2:2B:A1:D5:3E:B6 .clock
272
+ INFO:meshcore:BLE Connection started
273
+ {
274
+ "time": 1744957249
275
+ }
276
+
277
+ # Using -j, meshcli will return replies in json format ...
278
+ $ meshcli -j -a C2:2B:A1:D5:3E:B6 clock
279
+ {
280
+ "time": 1744957261
281
+ }
282
+
283
+ # So if I reboot the node, and want to set time, I can chain the commands
284
+ # and get that kind of output (even better by feeding it to jq)
285
+ $ meshcli reboot
286
+ INFO:meshcore:BLE Connection started
287
+ $ meshcli -j clock clock sync clock | jq -c
288
+ { "time": 1715770371 }
289
+ { "ok": "time synced" }
290
+ { "time": 1745996105 }
291
+
292
+ # Now check if time is ok with human output (I don't read epoch time yet)
293
+ $ meshcli clock
294
+ INFO:meshcore:BLE Connection started
295
+ Current time : 2025-04-30 08:56:27 (1745996187)
296
+
297
+ # Now you'll probably want to send some messages ...
298
+ # For that, there is the msg command, wait_ack
299
+ $ meshcli msg Techo_fdl "Hello T-Echo" wa
300
+ INFO:meshcore:BLE Connection started
301
+ Msg acked
302
+
303
+ # I can check the message on the techo
304
+ $ meshcli -d Techo sm
305
+ INFO:meshcore:Scanning for devices
306
+ INFO:meshcore:Found device : DE:B6:D0:68:D5:62: MeshCore-Techo_fdl
307
+ INFO:meshcore:BLE Connection started
308
+ t114_fdl(0): Hello T-Echo
309
+
310
+ # And reply using json output for more verbosity
311
+ # here I've used jq with -cs to get a compact array
312
+ $ meshcli msg t114_fdl hello wa | jq -cs
313
+ [{"type":0,"expected_ack":"4802ed93","suggested_timeout":2970},{"code":"4802ed93"}]
314
+
315
+ # But this could have been done interactively using the chat mode
316
+ # Here from the techo side. Note that un-acked messages will be
317
+ # signaled with an ! at the start of the prompt (or red color in color mode)
318
+ $ meshcli chat
319
+ INFO:meshcore:BLE Connection started
320
+ Interactive mode, most commands from terminal chat should work.
321
+ Use "to" to selects contact, "list" to list contacts, "send" to send a message ...
322
+ Line starting with "$" or "." will issue a meshcli command.
323
+ "quit" or "q" will end interactive mode
324
+ t114_fdl(D): Hello T-Echo
325
+ EnsibsRoom> Hi
326
+ !EnsibsRoom> to t114_fdl
327
+ t114_fdl> Hi
328
+ t114_fdl(D): It took you long to reply ...
329
+ t114_fdl> I forgot to set the recipient with the to command
330
+ t114_fdl(D): It happens ...
331
+ t114_fdl>
332
+
333
+ # Loging into repeaters and sending commands is also possible
334
+ # directly from the chat, because we can use meshcli commands ;)
335
+ $ meshcli chat (pending msgs are shown at connexion ...)
336
+ INFO:meshcore:BLE Connection started
337
+ Interactive mode, most commands from terminal chat should work.
338
+ Use "to" to selects contact, "list" to list contacts, "send" to send a message ...
339
+ Line starting with "$" or "." will issue a meshcli command.
340
+ "quit" or "q" will end interactive mode
341
+ Techo_fdl(0): Cool to receive some msgs from you
342
+ Techo_fdl(D): Hi
343
+ Techo_fdl(D): I forgot to set the recipient with the to command
344
+ FdlRoom> login password
345
+ Login success
346
+ FdlRoom> clock
347
+ FdlRoom(0): 06:40 - 18/4/2025 UTC
348
+ FdlRoom>
349
+ </pre>
@@ -0,0 +1,8 @@
1
+ meshcore_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ meshcore_cli/__main__.py,sha256=PfYgibmu2LEtC-OV7L1UgmvV3swJ5rQ4bbXHlwUFlgE,83
3
+ meshcore_cli/meshcore_cli.py,sha256=T4WVxfscFpfjSs1MkqaQ1L3sG4EfNSyXFI02wc0l9d8,151800
4
+ meshcore_cli-1.3.6.dist-info/METADATA,sha256=Fv1DS6ckI3a3dUq4HFQUsGcCLDmnzAL3A3s6S6bEn8E,17137
5
+ meshcore_cli-1.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ meshcore_cli-1.3.6.dist-info/entry_points.txt,sha256=77V29Pyth11GteDk7tneBN3MMk8JI7bTlS-BGSmxCmI,103
7
+ meshcore_cli-1.3.6.dist-info/licenses/LICENSE,sha256=F9s987VtS0AKxW7LdB2EkLMkrdeERI7ICdLJR60A9M4,1066
8
+ meshcore_cli-1.3.6.dist-info/RECORD,,
@@ -1,267 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: meshcore-cli
3
- Version: 1.2.12
4
- Summary: Command line interface to meshcore companion radios
5
- Project-URL: Homepage, https://github.com/fdlamotte/meshcore-cli
6
- Project-URL: Issues, https://github.com/fdlamotte/meshcore-cli/issues
7
- Author-email: Florent de Lamotte <florent@frizoncorrea.fr>
8
- License-Expression: MIT
9
- License-File: LICENSE
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.10
13
- Requires-Dist: meshcore>=2.1.24
14
- Requires-Dist: prompt-toolkit>=3.0.50
15
- Requires-Dist: pycryptodome
16
- Requires-Dist: requests>=2.28.0
17
- Description-Content-Type: text/markdown
18
-
19
- # meshcore-cli
20
-
21
- meshcore-cli : CLI interface to MeschCore companion app over BLE, TCP or Serial
22
-
23
- ## Install
24
-
25
- Meshcore-cli depends on the [python meshcore](https://github.com/fdlamotte/meshcore_py) package. You can install both via `pip` or `pipx` using the command:
26
-
27
- <pre>
28
- $ pipx install meshcore-cli
29
- </pre>
30
-
31
- It will install you `meshcore-cli` and `meshcli`, which is an alias to the former.
32
-
33
- You can use the flake under [nix](https://nixos.org/):
34
-
35
- <pre>
36
- $ nix run github:meshcore-dev/meshcore-cli#meshcore-cli
37
- </pre>
38
-
39
- If you want meshcore-cli to remember last BLE device, you should have some `$HOME/.config/meshcore` where configuration for meschcore-cli will be stored (if not it will use first device it finds).
40
-
41
- ## Usage
42
-
43
- <pre>
44
- $ meshcli &lt;args&gt; &lt;commands&gt;
45
- </pre>
46
-
47
- If using BLE, don't forget to pair your device first (using `bluetoothctl` for instance on Linux) or meshcli won't be able to communicate. There is a device selector for BLE, you'll just have to use `meshcli -S` to select your device, subsequent calls to meshcli will be send to that device.
48
-
49
- ### Configuration
50
-
51
- Configuration files are stored in `$HOME/.config/meshcore`
52
-
53
- If the directory exists, default ble address and history will be stored there.
54
-
55
- If there is an initialization script file called `init`, it will be executed just before the commands provided on command line are executed (and after evaluation of the arguments).
56
-
57
- Init files can also be defined for a given device, meshcore-cli will look for `&lt;device-name>.init` file in configuration directory (usefull to specify timeout for contacts that are behind bridges with `contact_timeout` command).
58
-
59
- ### Arguments
60
-
61
- Arguments mostly deals with ble connection
62
-
63
- <pre>
64
- -h : prints this help
65
- -v : prints version
66
- -j : json output (disables init file)
67
- -D : debug
68
- -S : performs a ble scan and ask for device
69
- -l : list available ble devices and exit
70
- -T &lt;timeout> : timeout for the ble scan (-S and -l) default 2s
71
- -a &lt;address> : specifies device address (can be a name)
72
- -d &lt;name> : filter meshcore devices with name or address
73
- -t &lt;hostname> : connects via tcp/ip
74
- -p &lt;port> : specifies tcp port (default 5000)
75
- -s &lt;port> : use serial port &lt;port>
76
- -b &lt;baudrate> : specify baudrate
77
- </pre>
78
-
79
- ### Available Commands
80
-
81
- Commands are given after arguments, they can be chained and some have shortcuts. Also prefixing a command with a dot `.` will force it to output json instead of synthetic result.
82
-
83
- <pre>
84
- General commands
85
- chat : enter the chat (interactive) mode
86
- chat_to &lt;ct> : enter chat with contact to
87
- script &lt;filename> : execute commands in filename
88
- infos : print informations about the node i
89
- self_telemetry : print own telemtry t
90
- card : export this node URI e
91
- ver : firmware version v
92
- reboot : reboots node
93
- sleep &lt;secs> : sleeps for a given amount of secs s
94
- wait_key : wait until user presses &lt;Enter> wk
95
- Messenging
96
- msg &lt;name> &lt;msg> : send message to node by name m {
97
- wait_ack : wait an ack wa }
98
- chan &lt;nb> &lt;msg> : send message to channel number &lt;nb> ch
99
- public &lt;msg> : send message to public channel (0) dch
100
- recv : reads next msg r
101
- wait_msg : wait for a message and read it wm
102
- sync_msgs : gets all unread msgs from the node sm
103
- msgs_subscribe : display msgs as they arrive ms
104
- get_channel &lt;n> : get info for channel n
105
- set_channel n nm k : set channel info (nb, name, key)
106
- Management
107
- advert : sends advert a
108
- floodadv : flood advert
109
- get &lt;param> : gets a param, "get help" for more
110
- set &lt;param> &lt;value> : sets a param, "set help" for more
111
- time &lt;epoch> : sets time to given epoch
112
- clock : get current time
113
- clock sync : sync device clock st
114
- Contacts
115
- contacts / list : gets contact list lc
116
- contact_info &lt;ct> : prints information for contact ct ci
117
- contact_timeout &lt;ct> v : sets temp default timeout for contact
118
- share_contact &lt;ct> : share a contact with others sc
119
- export_contact &lt;ct> : get a contact's URI ec
120
- import_contact &lt;URI> : import a contact from its URI ic
121
- remove_contact &lt;ct> : removes a contact from this node
122
- path &lt;ct> : diplays path for a contact
123
- reset_path &lt;ct> : resets path to a contact to flood rp
124
- change_path &lt;ct> &lt;pth> : change the path to a contact cp
125
- change_flags &lt;ct> &lt;f> : change contact flags (tel_l|tel_a|star)cf
126
- req_telemetry &lt;ct> : prints telemetry data as json rt
127
- req_mma &lt;ct> : requests min/max/avg for a sensor rm
128
- req_acl &lt;ct> : requests access control list for sensor
129
- pending_contacts : show pending contacts
130
- add_pending &lt;key> : manually add pending contact from key
131
- flush_pending : flush pending contact clist
132
- Repeaters
133
- login &lt;name> &lt;pwd> : log into a node (rep) with given pwd l
134
- logout &lt;name> : log out of a repeater
135
- cmd &lt;name> &lt;cmd> : sends a command to a repeater (no ack) c [
136
- wmt8 : wait for a msg (reply) with a timeout ]
137
- req_status &lt;name> : requests status from a node rs
138
- </pre>
139
-
140
- ### Interactive Mode
141
-
142
- aka Instant Message or chat mode ...
143
-
144
- Chat mode lets you interactively interact with your node or remote nodes. It is automatically triggered when no option is given on the command line.
145
-
146
- You'll get a prompt with the name of your node. From here you can type meshcore-cli commands. The prompt has history and a basic completion (pressing tab will display possible command or argument options).
147
-
148
- The `to` command is specific to chat mode, it lets you enter the recipient for next command. By default you're on your node but you can enter other nodes or public rooms. Here are some examples :
149
-
150
- - `to <nodename>` : will enter nodename
151
- - `to /`, `to ~` : will go to the root (your node)
152
- - `to ..` : will go to the last node (it will switch between the two last nodes, this is just a 1-depth history)
153
- - `to !` : will switch to the node you received last message from
154
-
155
- When you are connected to a node, the behaviour will depend on the node type, if you're on a chat node, it will send messages by default and you can chat. On a repeater or a room server, it will send commands (autocompletioin has been set to comply with the CommonCli class of meshcore). To send a message through a room you'll have to prefix the message with a quote or use the send command.
156
-
157
- You can alse set a channel as recipient, `to public` will switch to the public channel, and `to ch1` to channel 1.
158
-
159
- ## Examples
160
-
161
- <pre>
162
- # gets info from first ble MC device it finds (was -s but now used for serial port)
163
- $ meshcore-cli -d "" infos
164
- INFO:meshcore:Scanning for devices
165
- INFO:meshcore:Found device : C2:2B:A1:D5:3E:B6: MeshCore-t114_fdl
166
- INFO:meshcore:BLE Connection started
167
- {
168
- "adv_type": 1,
169
- "tx_power": 22,
170
- "max_tx_power": 22,
171
- "public_key": "993acd42fc779962c68c627829b32b111fa27a67d86b75c17460ff48c3102db4",
172
- "adv_lat": 47.794,
173
- "adv_lon": -3.428,
174
- "radio_freq": 869.525,
175
- "radio_bw": 250.0,
176
- "radio_sf": 11,
177
- "radio_cr": 5,
178
- "name": "t114_fdl"
179
- }
180
-
181
- # getting time
182
- $ meshcli -a C2:2B:A1:D5:3E:B6 clock
183
- INFO:meshcore:BLE Connection started
184
- Current time : 2025-04-18 08:19:26 (1744957166)
185
-
186
- # If you're familiar with meshcli, you should have noted that
187
- # now output is not json only, to get json output, use -j
188
- # or prefix your commands with a dot
189
- $ meshcli -a C2:2B:A1:D5:3E:B6 .clock
190
- INFO:meshcore:BLE Connection started
191
- {
192
- "time": 1744957249
193
- }
194
-
195
- # Using -j, meshcli will return replies in json format ...
196
- $ meshcli -j -a C2:2B:A1:D5:3E:B6 clock
197
- {
198
- "time": 1744957261
199
- }
200
-
201
- # So if I reboot the node, and want to set time, I can chain the commands
202
- # and get that kind of output (even better by feeding it to jq)
203
- $ meshcli reboot
204
- INFO:meshcore:BLE Connection started
205
- $ meshcli -j clock clock sync clock | jq -c
206
- { "time": 1715770371 }
207
- { "ok": "time synced" }
208
- { "time": 1745996105 }
209
-
210
- # Now check if time is ok with human output (I don't read epoch time yet)
211
- $ meshcli clock
212
- INFO:meshcore:BLE Connection started
213
- Current time : 2025-04-30 08:56:27 (1745996187)
214
-
215
- # Now you'll probably want to send some messages ...
216
- # For that, there is the msg command, wait_ack
217
- $ meshcli msg Techo_fdl "Hello T-Echo" wa
218
- INFO:meshcore:BLE Connection started
219
- Msg acked
220
-
221
- # I can check the message on the techo
222
- $ meshcli -d Techo sm
223
- INFO:meshcore:Scanning for devices
224
- INFO:meshcore:Found device : DE:B6:D0:68:D5:62: MeshCore-Techo_fdl
225
- INFO:meshcore:BLE Connection started
226
- t114_fdl(0): Hello T-Echo
227
-
228
- # And reply using json output for more verbosity
229
- # here I've used jq with -cs to get a compact array
230
- $ meshcli msg t114_fdl hello wa | jq -cs
231
- [{"type":0,"expected_ack":"4802ed93","suggested_timeout":2970},{"code":"4802ed93"}]
232
-
233
- # But this could have been done interactively using the chat mode
234
- # Here from the techo side. Note that un-acked messages will be
235
- # signaled with an ! at the start of the prompt (or red color in color mode)
236
- $ meshcli chat
237
- INFO:meshcore:BLE Connection started
238
- Interactive mode, most commands from terminal chat should work.
239
- Use "to" to selects contact, "list" to list contacts, "send" to send a message ...
240
- Line starting with "$" or "." will issue a meshcli command.
241
- "quit" or "q" will end interactive mode
242
- t114_fdl(D): Hello T-Echo
243
- EnsibsRoom> Hi
244
- !EnsibsRoom> to t114_fdl
245
- t114_fdl> Hi
246
- t114_fdl(D): It took you long to reply ...
247
- t114_fdl> I forgot to set the recipient with the to command
248
- t114_fdl(D): It happens ...
249
- t114_fdl>
250
-
251
- # Loging into repeaters and sending commands is also possible
252
- # directly from the chat, because we can use meshcli commands ;)
253
- $ meshcli chat (pending msgs are shown at connexion ...)
254
- INFO:meshcore:BLE Connection started
255
- Interactive mode, most commands from terminal chat should work.
256
- Use "to" to selects contact, "list" to list contacts, "send" to send a message ...
257
- Line starting with "$" or "." will issue a meshcli command.
258
- "quit" or "q" will end interactive mode
259
- Techo_fdl(0): Cool to receive some msgs from you
260
- Techo_fdl(D): Hi
261
- Techo_fdl(D): I forgot to set the recipient with the to command
262
- FdlRoom> login password
263
- Login success
264
- FdlRoom> clock
265
- FdlRoom(0): 06:40 - 18/4/2025 UTC
266
- FdlRoom>
267
- </pre>
@@ -1,8 +0,0 @@
1
- meshcore_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- meshcore_cli/__main__.py,sha256=PfYgibmu2LEtC-OV7L1UgmvV3swJ5rQ4bbXHlwUFlgE,83
3
- meshcore_cli/meshcore_cli.py,sha256=cbZPbXrhDENJvnGlR63lrupJQ22Nzk4bxGzudBKQMxQ,143616
4
- meshcore_cli-1.2.12.dist-info/METADATA,sha256=XU2LqLOUEHonAUDaa2VaiLsp_wvVa5XIwobda-mP_NE,11658
5
- meshcore_cli-1.2.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- meshcore_cli-1.2.12.dist-info/entry_points.txt,sha256=77V29Pyth11GteDk7tneBN3MMk8JI7bTlS-BGSmxCmI,103
7
- meshcore_cli-1.2.12.dist-info/licenses/LICENSE,sha256=F9s987VtS0AKxW7LdB2EkLMkrdeERI7ICdLJR60A9M4,1066
8
- meshcore_cli-1.2.12.dist-info/RECORD,,