Skip to content

Commit 766ad6f

Browse files
committed
deal with badly established ble cx
1 parent 82ba4b1 commit 766ad6f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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 = "1.1.35"
7+
version = "1.1.36"
88
authors = [
99
{ name="Florent de Lamotte", email="[email protected]" },
1010
]

src/meshcore_cli/meshcore_cli.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2568,7 +2568,16 @@ async def main(argv):
25682568
logger.info(f"Couldn't find device {address}")
25692569
return
25702570

2571-
mc = await MeshCore.create_ble(address=address, device=device, client=client, debug=debug, only_error=json_output, pin=pin)
2571+
try :
2572+
mc = await MeshCore.create_ble(address=address, device=device, client=client, debug=debug, only_error=json_output, pin=pin)
2573+
except ConnectionError :
2574+
logger.info("Error while connecting, retrying once ...")
2575+
try :
2576+
mc = await MeshCore.create_ble(address=address, device=device, client=client, debug=debug, only_error=json_output, pin=pin)
2577+
except ConnectionError :
2578+
logger.error("Can't connect to node, exiting")
2579+
return
2580+
25722581

25732582
# Store device address in configuration
25742583
if os.path.isdir(MCCLI_CONFIG_DIR) :

0 commit comments

Comments
 (0)