diff --git a/meshtastic_utils.py b/meshtastic_utils.py index 8c17a3b..e0e1b7c 100644 --- a/meshtastic_utils.py +++ b/meshtastic_utils.py @@ -40,12 +40,12 @@ def connect_meshtastic(force_connect=False): meshtastic_client = meshtastic.serial_interface.SerialInterface(serial_port) elif connection_type == "ble": - ble_node = relay_config["meshtastic"].get("ble_node") - if ble_node: - logger.info(f"Connecting to BLE node {ble_node} ...") - meshtastic_client = meshtastic.ble_interface.BLEInterface(address=ble_node) + ble_address = relay_config["meshtastic"].get("ble_address") + if ble_address: + logger.info(f"Connecting to BLE address or name {ble_address} ...") + meshtastic_client = meshtastic.ble_interface.BLEInterface(address=ble_address) else: - logger.error("No BLE node provided.") + logger.error("No BLE address or name provided.") return None else: @@ -156,4 +156,4 @@ def on_meshtastic_message(packet, loop=None): ) found_matching_plugin = result.result() if found_matching_plugin: - logger.debug(f"Processed {portnum} with plugin {plugin.plugin_name}") + logger.debug(f"Processed {portnum} with plugin {plugin.plugin_name}") \ No newline at end of file diff --git a/sample_config.yaml b/sample_config.yaml index 0e04fa1..18ee657 100644 --- a/sample_config.yaml +++ b/sample_config.yaml @@ -13,7 +13,7 @@ meshtastic: connection_type: serial # Choose either "network", "serial", or "ble" serial_port: /dev/ttyUSB0 # Only used when connection is "serial" host: "meshtastic.local" # Only used when connection is "network" - ble_node: "AA:BB:CC:DD:EE:FF" # Only used when connection is "ble" - Can be either an address or a name from a `meshtastic --ble-scan` + ble_address: "AA:BB:CC:DD:EE:FF" # Only used when connection is "ble" - Uses either an address or name from a `meshtastic --ble-scan` meshnet_name: "Your Meshnet Name" # This is displayed in full on Matrix, but is truncated when sent to a Meshnet broadcast_enabled: true # Must be set to true to enable Matrix to Meshtastic messages