From f6334acbccf21bb83ced2a6496653ec091312f54 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 14 Nov 2025 16:24:16 +0100 Subject: [PATCH] doccumentation on manual_add_contacts --- README.md | 12 ++++++++++++ pyproject.toml | 4 ++-- src/meshcore_cli/meshcore_cli.py | 27 ++++++++++++++++++++++++--- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 80ebe68..35e30ff 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,18 @@ f1down/#fdl|*> 8 #fdl f1down: 8 [2521] 1.00-109 ``` +### Contact management + +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). + +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. + +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). + +This feature only really works in interactive mode. + +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). + ### Issuing batch commands to contacts with apply to `apply_to ` : applies cmd to contacts matching filter `` it can be used to apply the same command to a pool of repeaters, or remove some contacts matching a condition. diff --git a/pyproject.toml b/pyproject.toml index 66fe855..3bb4276 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore-cli" -version = "1.3.1" +version = "1.3.2" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, ] @@ -17,7 +17,7 @@ classifiers = [ ] license = "MIT" license-files = ["LICEN[CS]E*"] -dependencies = [ "meshcore >= 2.1.24", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0", "pycryptodome" ] +dependencies = [ "meshcore >= 2.2.0", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0", "pycryptodome" ] [project.urls] Homepage = "https://github.com/fdlamotte/meshcore-cli" diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index 6f93996..bada3d5 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -32,7 +32,7 @@ import re from meshcore import MeshCore, EventType, logger # Version -VERSION = "v1.3.1" +VERSION = "v1.3.2" # default ble address is stored in a config file MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/" @@ -591,6 +591,9 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None): "?at":None, "?node_discover":None, "?nd":None, + "?pending_contacts":None, + "?add_pending":None, + "?flush_pending":None, } contact_completion_list = { @@ -3329,12 +3332,15 @@ def get_help_for (cmdname, context="line") : lat : latitude lon : longitude coords : coordinates - auto_update_contacts <> : automatically updates contact list multi_ack : multi-acks feature telemetry_mode_base : set basic telemetry mode all/selected/off telemetry_mode_loc : set location telemetry mode all/selected/off telemetry_mode_env : set env telemetry mode all/selected/off advert_loc_policy : "share" means loc will be shared in adv + manual_add_contacts : let user manually add contacts to device + - when off device automatically adds contacts from adverts + - when on contacts must be added manually using add_pending + (pending contacts list is built by meshcli from adverts while connected) display: print_snr : toggle snr display in messages print_adverts : display adverts as they come @@ -3344,12 +3350,13 @@ def get_help_for (cmdname, context="line") : channel_echoes : print repeats for channel data echo_unk_channels : also dump unk channels (encrypted) color : color off should remove ANSI codes from output - prompt: + meshcore-cli behaviour: classic_prompt : activates less fancier prompt arrow_head : change arrow head in prompt slash_start : idem for slash start slash_end : slash end invert_slash : apply color inversion to slash + auto_update_contacts : auto sync contact list with device """) elif cmdname == "scope": @@ -3373,6 +3380,20 @@ Managing Flood Scope in interactive mode - contact_type (ct) """) + elif cmdname == "pending_contacts" or cmdname == "flush_pending" or cmdname == "add_pending": + print("""Contact management + +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). + +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. + +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). + +This feature only really works in interactive mode. + +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). +""") + else: print(f"Sorry, no help yet for {cmdname}")