meshcore-cli 0.3__tar.gz → 0.3.2__tar.gz
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.
- {meshcore_cli-0.3 → meshcore_cli-0.3.2}/PKG-INFO +19 -17
- {meshcore_cli-0.3 → meshcore_cli-0.3.2}/README.md +17 -15
- {meshcore_cli-0.3 → meshcore_cli-0.3.2}/pyproject.toml +2 -2
- {meshcore_cli-0.3 → meshcore_cli-0.3.2}/src/meshcore_cli/meshcore_cli.py +6 -3
- meshcore_cli-0.3.2/src/meshcore_cli/python +1 -0
- {meshcore_cli-0.3 → meshcore_cli-0.3.2}/.gitignore +0 -0
- {meshcore_cli-0.3 → meshcore_cli-0.3.2}/LICENSE +0 -0
- {meshcore_cli-0.3 → meshcore_cli-0.3.2}/src/meshcore_cli/__init__.py +0 -0
- {meshcore_cli-0.3 → meshcore_cli-0.3.2}/src/meshcore_cli/__main__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshcore-cli
|
|
3
|
-
Version: 0.3
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Command line interface to meshcore companion radios
|
|
5
5
|
Project-URL: Homepage, https://github.com/fdlamotte/meshcore-cli
|
|
6
6
|
Project-URL: Issues, https://github.com/fdlamotte/meshcore-cli/issues
|
|
@@ -10,27 +10,29 @@ License-File: LICENSE
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Requires-Python: >=3.10
|
|
13
|
-
Requires-Dist: meshcore
|
|
13
|
+
Requires-Dist: meshcore>=0.3.2
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
|
|
16
|
-
#
|
|
16
|
+
# meshcore-cli
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
meshcore-cli : CLI interface to MeschCore companion app over BLE, TCP or Serial
|
|
19
19
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
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 :
|
|
23
23
|
|
|
24
24
|
<pre>
|
|
25
|
-
$
|
|
25
|
+
$ pipx install meshcore-cli
|
|
26
26
|
</pre>
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
It will install you `meshcore-cli` and `meshcli`, which is an alias to the former.
|
|
29
|
+
|
|
30
|
+
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).
|
|
29
31
|
|
|
30
32
|
## Usage
|
|
31
33
|
|
|
32
34
|
<pre>
|
|
33
|
-
$
|
|
35
|
+
$ meshcli <args> <commands>
|
|
34
36
|
</pre>
|
|
35
37
|
|
|
36
38
|
### Arguments
|
|
@@ -84,14 +86,14 @@ Commands are given after arguments, they can be chained and some have shortcuts.
|
|
|
84
86
|
|
|
85
87
|
<pre>
|
|
86
88
|
# gets info from first MC device it finds (was -s but now used for serial port)
|
|
87
|
-
$
|
|
89
|
+
$ meshcli -d "" infos
|
|
88
90
|
Scanning for devices
|
|
89
91
|
Found device : F0:F5:BD:4F:9B:AD: MeshCore
|
|
90
92
|
Connexion started
|
|
91
93
|
{'adv_type': 1, 'public_key': '54c11cff0c2a861cfc5b0bd6e4b81cd5e6ca85e058bf53932d86c87dc7a20011', 'device_loc': '000000000000000000000000', 'radio_freq': 867500, 'radio_bw': 250000, 'radio_sf': 10, 'radio_cr': 5, 'name': 'toto'}
|
|
92
94
|
cmd ['infos'] processed ...
|
|
93
95
|
|
|
94
|
-
$
|
|
96
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD get_time
|
|
95
97
|
Connexion started
|
|
96
98
|
Current time : 2024-05-15 12:52:53 (1715770373)
|
|
97
99
|
cmd ['get_time'] processed ...
|
|
@@ -99,19 +101,19 @@ cmd ['get_time'] processed ...
|
|
|
99
101
|
$ date
|
|
100
102
|
Tue Feb 4 12:55:05 CET 2025
|
|
101
103
|
|
|
102
|
-
$
|
|
104
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD sync_time get_time
|
|
103
105
|
Connexion started
|
|
104
106
|
True
|
|
105
107
|
cmd ['sync_time'] processed ...
|
|
106
108
|
Current time : 2025-02-04 12:55:24 (1738670124)
|
|
107
109
|
cmd ['get_time'] processed ...
|
|
108
110
|
|
|
109
|
-
$
|
|
111
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD contacts
|
|
110
112
|
Connexion started
|
|
111
113
|
{}
|
|
112
114
|
cmd ['contacts'] processed ...
|
|
113
115
|
|
|
114
|
-
$
|
|
116
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD sleep 10 contacts
|
|
115
117
|
Connexion started
|
|
116
118
|
Advertisment received
|
|
117
119
|
cmd ['sleep', '10'] processed ...
|
|
@@ -131,7 +133,7 @@ cmd ['sleep', '10'] processed ...
|
|
|
131
133
|
}
|
|
132
134
|
cmd ['contacts'] processed ...
|
|
133
135
|
|
|
134
|
-
$
|
|
136
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD sendto flo2 "Hello flo2" sleep 10
|
|
135
137
|
Connexion started
|
|
136
138
|
{'type': 1, 'expected_ack': b'9\x05\x0c\x12', 'suggested_timeout': 3260}
|
|
137
139
|
cmd ['sendto', 'flo2', 'Hello flo2'] processed ...
|
|
@@ -140,20 +142,20 @@ Received ACK
|
|
|
140
142
|
Msgs are waiting
|
|
141
143
|
cmd ['sleep', '10'] processed ...
|
|
142
144
|
|
|
143
|
-
$
|
|
145
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD recv
|
|
144
146
|
Connexion started
|
|
145
147
|
{'type': 'PRIV', 'pubkey_prefix': 'd6e43f8e9ef2', 'path_len': 255, 'txt_type': 0, 'sender_timestamp': 1738670421, 'text': 'hi'}
|
|
146
148
|
cmd ['recv'] processed ...
|
|
147
149
|
|
|
148
150
|
# logs into a repeater (HomeRep) and check time
|
|
149
|
-
$
|
|
151
|
+
$ meshcli -d t1000 login HomeRep password
|
|
150
152
|
Scanning for devices
|
|
151
153
|
Found device : FB:F2:5C:40:4F:77: MeshCore-t1000
|
|
152
154
|
Connexion started
|
|
153
155
|
{'type': 0, 'expected_ack': b'\x82yU\x02', 'suggested_timeout': 4446}
|
|
154
156
|
cmd ['login', 'HomeRep', 'password'] processed ...
|
|
155
157
|
|
|
156
|
-
$
|
|
158
|
+
$ meshcli cmd HomeRep clock wait_msg
|
|
157
159
|
Connexion started
|
|
158
160
|
{'type': 0, 'expected_ack': b'\x00\x00\x00\x00', 'suggested_timeout': 2724}
|
|
159
161
|
cmd ['cmd', 'HomeRep', 'clock'] processed ...
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# meshcore-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
meshcore-cli : CLI interface to MeschCore companion app over BLE, TCP or Serial
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
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 :
|
|
8
8
|
|
|
9
9
|
<pre>
|
|
10
|
-
$
|
|
10
|
+
$ pipx install meshcore-cli
|
|
11
11
|
</pre>
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
It will install you `meshcore-cli` and `meshcli`, which is an alias to the former.
|
|
14
|
+
|
|
15
|
+
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).
|
|
14
16
|
|
|
15
17
|
## Usage
|
|
16
18
|
|
|
17
19
|
<pre>
|
|
18
|
-
$
|
|
20
|
+
$ meshcli <args> <commands>
|
|
19
21
|
</pre>
|
|
20
22
|
|
|
21
23
|
### Arguments
|
|
@@ -69,14 +71,14 @@ Commands are given after arguments, they can be chained and some have shortcuts.
|
|
|
69
71
|
|
|
70
72
|
<pre>
|
|
71
73
|
# gets info from first MC device it finds (was -s but now used for serial port)
|
|
72
|
-
$
|
|
74
|
+
$ meshcli -d "" infos
|
|
73
75
|
Scanning for devices
|
|
74
76
|
Found device : F0:F5:BD:4F:9B:AD: MeshCore
|
|
75
77
|
Connexion started
|
|
76
78
|
{'adv_type': 1, 'public_key': '54c11cff0c2a861cfc5b0bd6e4b81cd5e6ca85e058bf53932d86c87dc7a20011', 'device_loc': '000000000000000000000000', 'radio_freq': 867500, 'radio_bw': 250000, 'radio_sf': 10, 'radio_cr': 5, 'name': 'toto'}
|
|
77
79
|
cmd ['infos'] processed ...
|
|
78
80
|
|
|
79
|
-
$
|
|
81
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD get_time
|
|
80
82
|
Connexion started
|
|
81
83
|
Current time : 2024-05-15 12:52:53 (1715770373)
|
|
82
84
|
cmd ['get_time'] processed ...
|
|
@@ -84,19 +86,19 @@ cmd ['get_time'] processed ...
|
|
|
84
86
|
$ date
|
|
85
87
|
Tue Feb 4 12:55:05 CET 2025
|
|
86
88
|
|
|
87
|
-
$
|
|
89
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD sync_time get_time
|
|
88
90
|
Connexion started
|
|
89
91
|
True
|
|
90
92
|
cmd ['sync_time'] processed ...
|
|
91
93
|
Current time : 2025-02-04 12:55:24 (1738670124)
|
|
92
94
|
cmd ['get_time'] processed ...
|
|
93
95
|
|
|
94
|
-
$
|
|
96
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD contacts
|
|
95
97
|
Connexion started
|
|
96
98
|
{}
|
|
97
99
|
cmd ['contacts'] processed ...
|
|
98
100
|
|
|
99
|
-
$
|
|
101
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD sleep 10 contacts
|
|
100
102
|
Connexion started
|
|
101
103
|
Advertisment received
|
|
102
104
|
cmd ['sleep', '10'] processed ...
|
|
@@ -116,7 +118,7 @@ cmd ['sleep', '10'] processed ...
|
|
|
116
118
|
}
|
|
117
119
|
cmd ['contacts'] processed ...
|
|
118
120
|
|
|
119
|
-
$
|
|
121
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD sendto flo2 "Hello flo2" sleep 10
|
|
120
122
|
Connexion started
|
|
121
123
|
{'type': 1, 'expected_ack': b'9\x05\x0c\x12', 'suggested_timeout': 3260}
|
|
122
124
|
cmd ['sendto', 'flo2', 'Hello flo2'] processed ...
|
|
@@ -125,20 +127,20 @@ Received ACK
|
|
|
125
127
|
Msgs are waiting
|
|
126
128
|
cmd ['sleep', '10'] processed ...
|
|
127
129
|
|
|
128
|
-
$
|
|
130
|
+
$ meshcli -a F0:F5:BD:4F:9B:AD recv
|
|
129
131
|
Connexion started
|
|
130
132
|
{'type': 'PRIV', 'pubkey_prefix': 'd6e43f8e9ef2', 'path_len': 255, 'txt_type': 0, 'sender_timestamp': 1738670421, 'text': 'hi'}
|
|
131
133
|
cmd ['recv'] processed ...
|
|
132
134
|
|
|
133
135
|
# logs into a repeater (HomeRep) and check time
|
|
134
|
-
$
|
|
136
|
+
$ meshcli -d t1000 login HomeRep password
|
|
135
137
|
Scanning for devices
|
|
136
138
|
Found device : FB:F2:5C:40:4F:77: MeshCore-t1000
|
|
137
139
|
Connexion started
|
|
138
140
|
{'type': 0, 'expected_ack': b'\x82yU\x02', 'suggested_timeout': 4446}
|
|
139
141
|
cmd ['login', 'HomeRep', 'password'] processed ...
|
|
140
142
|
|
|
141
|
-
$
|
|
143
|
+
$ meshcli cmd HomeRep clock wait_msg
|
|
142
144
|
Connexion started
|
|
143
145
|
{'type': 0, 'expected_ack': b'\x00\x00\x00\x00', 'suggested_timeout': 2724}
|
|
144
146
|
cmd ['cmd', 'HomeRep', 'clock'] processed ...
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "meshcore-cli"
|
|
7
|
-
version = "0.3"
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
|
10
10
|
]
|
|
@@ -17,7 +17,7 @@ classifiers = [
|
|
|
17
17
|
]
|
|
18
18
|
license = "MIT"
|
|
19
19
|
license-files = ["LICEN[CS]E*"]
|
|
20
|
-
dependencies = [ "meshcore" ]
|
|
20
|
+
dependencies = [ "meshcore>=0.3.2" ]
|
|
21
21
|
|
|
22
22
|
[project.urls]
|
|
23
23
|
Homepage = "https://github.com/fdlamotte/meshcore-cli"
|
|
@@ -18,7 +18,7 @@ from meshcore import printerr
|
|
|
18
18
|
from meshcore import MeshCore
|
|
19
19
|
|
|
20
20
|
# default address is stored in a config file
|
|
21
|
-
MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/
|
|
21
|
+
MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
|
|
22
22
|
MCCLI_ADDRESS = MCCLI_CONFIG_DIR + "default_address"
|
|
23
23
|
|
|
24
24
|
# Fallback address if config file not found
|
|
@@ -171,15 +171,18 @@ async def next_cmd(mc, cmds):
|
|
|
171
171
|
case "sleep" | "s" :
|
|
172
172
|
argnum = 1
|
|
173
173
|
await asyncio.sleep(int(cmds[1]))
|
|
174
|
+
case "cli" :
|
|
175
|
+
argnum = 1
|
|
176
|
+
print (await mc.send_cli(cmds[1]))
|
|
174
177
|
|
|
175
178
|
printerr (f"cmd {cmds[0:argnum+1]} processed ...")
|
|
176
179
|
return cmds[argnum+1:]
|
|
177
180
|
|
|
178
181
|
def usage () :
|
|
179
182
|
""" Prints some help """
|
|
180
|
-
print("""
|
|
183
|
+
print("""meshcore-cli : CLI interface to MeschCore BLE companion app
|
|
181
184
|
|
|
182
|
-
Usage :
|
|
185
|
+
Usage : meshcore-cli <args> <commands>
|
|
183
186
|
|
|
184
187
|
Arguments :
|
|
185
188
|
-h : prints this help
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from meshcore_cli import cli; cli()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|