Skip to content

Commit 733fc53

Browse files
committed
some little updates
1 parent df12606 commit 733fc53

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $ pipx install meshcore-cli
1212

1313
It will install you `meshcore-cli` and `meshcli`, which is an alias to the former.
1414

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).
1516

1617
## Usage
1718

@@ -70,34 +71,34 @@ Commands are given after arguments, they can be chained and some have shortcuts.
7071

7172
<pre>
7273
# gets info from first MC device it finds (was -s but now used for serial port)
73-
$ ./mccli.py -d "" infos
74+
$ meshcli -d "" infos
7475
Scanning for devices
7576
Found device : F0:F5:BD:4F:9B:AD: MeshCore
7677
Connexion started
7778
{'adv_type': 1, 'public_key': '54c11cff0c2a861cfc5b0bd6e4b81cd5e6ca85e058bf53932d86c87dc7a20011', 'device_loc': '000000000000000000000000', 'radio_freq': 867500, 'radio_bw': 250000, 'radio_sf': 10, 'radio_cr': 5, 'name': 'toto'}
7879
cmd ['infos'] processed ...
7980

80-
$ ./mccli.py -a F0:F5:BD:4F:9B:AD get_time
81+
$ meshcli -a F0:F5:BD:4F:9B:AD get_time
8182
Connexion started
8283
Current time : 2024-05-15 12:52:53 (1715770373)
8384
cmd ['get_time'] processed ...
8485

8586
$ date
8687
Tue Feb 4 12:55:05 CET 2025
8788

88-
$ ./mccli.py -a F0:F5:BD:4F:9B:AD sync_time get_time
89+
$ meshcli -a F0:F5:BD:4F:9B:AD sync_time get_time
8990
Connexion started
9091
True
9192
cmd ['sync_time'] processed ...
9293
Current time : 2025-02-04 12:55:24 (1738670124)
9394
cmd ['get_time'] processed ...
9495

95-
$ ./mccli.py -a F0:F5:BD:4F:9B:AD contacts
96+
$ meshcli -a F0:F5:BD:4F:9B:AD contacts
9697
Connexion started
9798
{}
9899
cmd ['contacts'] processed ...
99100

100-
$ ./mccli.py -a F0:F5:BD:4F:9B:AD sleep 10 contacts
101+
$ meshcli -a F0:F5:BD:4F:9B:AD sleep 10 contacts
101102
Connexion started
102103
Advertisment received
103104
cmd ['sleep', '10'] processed ...
@@ -117,7 +118,7 @@ cmd ['sleep', '10'] processed ...
117118
}
118119
cmd ['contacts'] processed ...
119120

120-
$ ./mccli.py -a F0:F5:BD:4F:9B:AD sendto flo2 "Hello flo2" sleep 10
121+
$ meshcli -a F0:F5:BD:4F:9B:AD sendto flo2 "Hello flo2" sleep 10
121122
Connexion started
122123
{'type': 1, 'expected_ack': b'9\x05\x0c\x12', 'suggested_timeout': 3260}
123124
cmd ['sendto', 'flo2', 'Hello flo2'] processed ...
@@ -126,20 +127,20 @@ Received ACK
126127
Msgs are waiting
127128
cmd ['sleep', '10'] processed ...
128129

129-
$ ./mccli.py -a F0:F5:BD:4F:9B:AD recv
130+
$ meshcli -a F0:F5:BD:4F:9B:AD recv
130131
Connexion started
131132
{'type': 'PRIV', 'pubkey_prefix': 'd6e43f8e9ef2', 'path_len': 255, 'txt_type': 0, 'sender_timestamp': 1738670421, 'text': 'hi'}
132133
cmd ['recv'] processed ...
133134

134135
# logs into a repeater (HomeRep) and check time
135-
$ ./mccli.py -d t1000 login HomeRep password
136+
$ meshcli -d t1000 login HomeRep password
136137
Scanning for devices
137138
Found device : FB:F2:5C:40:4F:77: MeshCore-t1000
138139
Connexion started
139140
{'type': 0, 'expected_ack': b'\x82yU\x02', 'suggested_timeout': 4446}
140141
cmd ['login', 'HomeRep', 'password'] processed ...
141142

142-
$ ./mccli.py cmd HomeRep clock wait_msg
143+
$ meshcli cmd HomeRep clock wait_msg
143144
Connexion started
144145
{'type': 0, 'expected_ack': b'\x00\x00\x00\x00', 'suggested_timeout': 2724}
145146
cmd ['cmd', 'HomeRep', 'clock'] processed ...

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "meshcore-cli"
7-
version = "0.3"
7+
version = "0.3.1"
88
authors = [
99
{ name="Florent de Lamotte", email="[email protected]" },
1010
]

src/meshcore_cli/meshcore_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from meshcore import MeshCore
1919

2020
# default address is stored in a config file
21-
MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/mc-cli/"
21+
MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
2222
MCCLI_ADDRESS = MCCLI_CONFIG_DIR + "default_address"
2323

2424
# Fallback address if config file not found
@@ -177,9 +177,9 @@ async def next_cmd(mc, cmds):
177177

178178
def usage () :
179179
""" Prints some help """
180-
print("""mccli.py : CLI interface to MeschCore BLE companion app
180+
print("""meshcore-cli : CLI interface to MeschCore BLE companion app
181181
182-
Usage : mccli.py <args> <commands>
182+
Usage : meshcore-cli <args> <commands>
183183
184184
Arguments :
185185
-h : prints this help

0 commit comments

Comments
 (0)