Merge pull request #68 from jeremiah-k/ble-config-update

Update BLE config field
feature/plugins-parameters
Jeremiah K 2024-07-01 14:22:24 -05:00 zatwierdzone przez GitHub
commit d135ec8da9
2 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -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}")

Wyświetl plik

@ -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