You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+91-41Lines changed: 91 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,83 +40,96 @@ Init files can also be defined for a given device, meshcore-cli will look for `&
40
40
41
41
### Arguments
42
42
43
-
Arguments mostly deals with ble connection
43
+
Arguments mostly deals with connection to the node
44
44
45
45
<pre>
46
46
-h : prints this help
47
47
-v : prints version
48
48
-j : json output (disables init file)
49
49
-D : debug
50
-
-S : performs a ble scan and ask for device
51
-
-l : list available ble devices and exit
52
-
-T <timeout> : timeout for the ble scan (-S and -l) default 2s
53
-
-a <address> : specifies device address (can be a name)
54
-
-d <name> : filter meshcore devices with name or address
55
-
-t <hostname> : connects via tcp/ip
56
-
-p <port> : specifies tcp port (default 5000)
57
-
-s <port> : use serial port <port>
58
-
-b <baudrate> : specify baudrate
50
+
-S : scan for devices and show a selector
51
+
-l : list available ble/serial devices and exit
52
+
-T <timeout> : timeout for the ble scan (-S and -l) default 2s
53
+
-a <address> : specifies device address (can be a name)
54
+
-d <name> : filter meshcore devices with name or address
55
+
-P : forces pairing via the OS
56
+
-t <hostname> : connects via tcp/ip
57
+
-p <port> : specifies tcp port (default 5000)
58
+
-s <port> : use serial port <port>
59
+
-b <baudrate> : specify baudrate
60
+
-C : toggles classic mode for prompt
61
+
-c <on/off> : disables most of color output if off
59
62
</pre>
60
63
61
64
### Available Commands
62
65
63
66
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.
64
67
65
68
<pre>
69
+
?<cmd> may give you some more help about cmd
66
70
General commands
67
71
chat : enter the chat (interactive) mode
68
-
chat_to <ct> : enter chat with contact to
69
-
script <filename> : execute commands in filename
72
+
chat_to <ct> : enter chat with contact to
73
+
script <filename> : execute commands in filename
70
74
infos : print informations about the node i
71
75
self_telemetry : print own telemtry t
72
76
card : export this node URI e
73
77
ver : firmware version v
74
78
reboot : reboots node
75
-
sleep <secs> : sleeps for a given amount of secs s
76
-
wait_key : wait until user presses <Enter> wk
77
-
Messenging
78
-
msg <name> <msg> : send message to node by name m {
79
+
sleep <secs> : sleeps for a given amount of secs s
80
+
wait_key : wait until user presses <Enter> wk
81
+
apply_to <f><cmds> : sends cmds to contacts matching f at
82
+
Messaging
83
+
msg <name><msg> : send message to node by name m {
79
84
wait_ack : wait an ack wa }
80
-
chan <nb><msg> : send message to channel number <nb> ch
81
-
public <msg> : send message to public channel (0) dch
85
+
chan <nb><msg> : send message to channel number <nb> ch
86
+
public <msg> : send message to public channel (0) dch
82
87
recv : reads next msg r
83
88
wait_msg : wait for a message and read it wm
84
89
sync_msgs : gets all unread msgs from the node sm
85
90
msgs_subscribe : display msgs as they arrive ms
86
-
get_channel <n> : get info for channel n
91
+
get_channels : prints all channel info
92
+
get_channel <n> : get info for channel (by number or name)
87
93
set_channel n nm k : set channel info (nb, name, key)
94
+
remove_channel <n> : remove channel (by number or name)
95
+
scope <s> : sets node's flood scope
88
96
Management
89
97
advert : sends advert a
90
98
floodadv : flood advert
91
-
get <param> : gets a param, "get help" for more
92
-
set <param><value> : sets a param, "set help" for more
93
-
time <epoch> : sets time to given epoch
99
+
get <param> : gets a param, \"get help\" for more
100
+
set <param><value> : sets a param, \"set help\" for more
101
+
time <epoch> : sets time to given epoch
94
102
clock : get current time
95
103
clock sync : sync device clock st
104
+
node_discover <filter> : discovers nodes based on their type nd
96
105
Contacts
97
106
contacts / list : gets contact list lc
98
-
contact_info <ct> : prints information for contact ct ci
99
-
contact_timeout <ct> v : sets temp default timeout for contact
100
-
share_contact <ct> : share a contact with others sc
101
-
export_contact <ct> : get a contact's URI ec
102
-
import_contact <URI> : import a contact from its URI ic
103
-
remove_contact <ct> : removes a contact from this node
104
-
path <ct> : diplays path for a contact
105
-
reset_path <ct> : resets path to a contact to flood rp
106
-
change_path <ct> <pth> : change the path to a contact cp
login <name><pwd> : log into a node (rep) with given pwd l
116
-
logout <name> : log out of a repeater
117
-
cmd <name><cmd> : sends a command to a repeater (no ack) c [
126
+
login <name><pwd> : log into a node (rep) with given pwd l
127
+
logout <name> : log out of a repeater
128
+
cmd <name><cmd> : sends a command to a repeater (no ack) c [
118
129
wmt8 : wait for a msg (reply) with a timeout ]
119
-
req_status <name> : requests status from a node rs
130
+
req_status <name> : requests status from a node rs
131
+
req_neighbours <name> : requests for neighbours in binary form rn
132
+
trace <path> : run a trace, path is comma separated
120
133
</pre>
121
134
122
135
### Interactive Mode
@@ -138,6 +151,43 @@ When you are connected to a node, the behaviour will depend on the node type, if
138
151
139
152
You can alse set a channel as recipient, `to public` will switch to the public channel, and `to ch1` to channel 1.
140
153
154
+
#### Flood Scope in interactive mode
155
+
156
+
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.
157
+
158
+
When entering chat mode, scope will be reset to `*`, meaning classic flood.
159
+
160
+
You can switch scope using the `scope` command, or postfixing the `to` command with `%<scope>`.
161
+
162
+
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.
163
+
164
+
### Issuing batch commands to contacts with apply to
165
+
166
+
`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.
167
+
168
+
Filter is constructed with comma separated fields :
169
+
170
+
-`u`, matches modification time `<` or `>` than a timestamp (can also be days hours or minutes ago if followed by `d`,`h` or `m`)
171
+
-`t`, matches the type (1: client, 2: repeater, 3: room, 4: sensor)
172
+
-`h`, matches number of hops
173
+
-`d`, direct, similar to `h>-1`
174
+
-`f`, flood, similar to `h<0` or `h=-1`
175
+
176
+
Commands should be written as if in interactive mode, if writing from the commandline don't forget to use commas to clearly delimit fields.
177
+
178
+
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 ...
179
+
180
+
#### Examples
181
+
182
+
```
183
+
# removes all clients that have not been updated in last 2 days
184
+
at u<2d,t=1 remove_contact
185
+
# gives traces to repeaters that have been updated in the last 24h and are direct
nd can be used with no filter parameter ... !!! BEWARE WITH CHAINING !!!
3221
3196
""")
3222
3197
3198
+
elifcmdname=="get" :
3199
+
print("""Gets parameters from node
3200
+
Please see also help for set command, which is more up to date ...
3201
+
name : node name
3202
+
bat : battery level in mV
3203
+
fstats : fs statistics
3204
+
coords : adv coordinates
3205
+
lat : latitude
3206
+
lon : longitude
3207
+
radio : radio parameters
3208
+
tx : tx power
3209
+
print_snr : snr display in messages
3210
+
print_adverts : display adverts as they come
3211
+
print_new_contacts : display new pending contacts when available
3212
+
print_path_updates : display path updates as they come
3213
+
custom : all custom variables in json format
3214
+
each custom var can also be get/set directly""")
3215
+
3216
+
elifcmdname=="set" :
3217
+
print("""Available parameters :
3218
+
device:
3219
+
pin <pin> : ble pin
3220
+
radio <freq,bw,sf,cr> : radio params
3221
+
tuning <rx_dly,af> : tuning params
3222
+
tx <dbm> : tx power
3223
+
name <name> : node name
3224
+
lat <lat> : latitude
3225
+
lon <lon> : longitude
3226
+
coords <lat,lon> : coordinates
3227
+
auto_update_contacts <> : automatically updates contact list
3228
+
multi_ack <on/off> : multi-acks feature
3229
+
telemetry_mode_base <mode> : set basic telemetry mode all/selected/off
3230
+
telemetry_mode_loc <mode> : set location telemetry mode all/selected/off
3231
+
telemetry_mode_env <mode> : set env telemetry mode all/selected/off
3232
+
advert_loc_policy <policy> : "share" means loc will be shared in adv
3233
+
display:
3234
+
print_snr <on/off> : toggle snr display in messages
3235
+
print_adverts <on/off> : display adverts as they come
3236
+
print_new_contacts <on/off> : display new pending contacts when available
3237
+
print_path_updates <on/off> : display path updates as they come
3238
+
json_log_rx <on/off> : logs packets incoming to device as json
3239
+
channel_echoes <on/off> : print repeats for channel data
3240
+
echo_unk_channels <on/off> : also dump unk channels (encrypted)
3241
+
color <on/off> : color off should remove ANSI codes from output
3242
+
prompt:
3243
+
classic_prompt <on/off> : activates less fancier prompt
3244
+
arrow_head <string> : change arrow head in prompt
3245
+
slash_start <string> : idem for slash start
3246
+
slash_end <string> : slash end
3247
+
invert_slash <on/off> : apply color inversion to slash """)
3248
+
3249
+
elifcmdname=="scope":
3250
+
print("""scope <scope> : changes flood scope of the node
3251
+
3252
+
The scope command can be used from command line or interactive mode to set the region in which flood packets will be transmitted.
3253
+
3254
+
Managing Flood Scope in interactive mode
3255
+
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.
3256
+
When entering chat mode, scope will be reset to *, meaning classic flood.
3257
+
You can switch scope using the scope command, or postfixing the to command with %<scope>.
3258
+
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.""")
0 commit comments