kopia lustrzana https://github.com/mate-dev/meshtastic-matrix-relay
Merge pull request #67 from jeremiah-k/ble-updates
Consolidate new config fieldsfeature/plugins-parameters
commit
b68ef55472
|
@ -40,17 +40,12 @@ def connect_meshtastic(force_connect=False):
|
||||||
meshtastic_client = meshtastic.serial_interface.SerialInterface(serial_port)
|
meshtastic_client = meshtastic.serial_interface.SerialInterface(serial_port)
|
||||||
|
|
||||||
elif connection_type == "ble":
|
elif connection_type == "ble":
|
||||||
ble_address = relay_config["meshtastic"].get("ble_address")
|
ble_node = relay_config["meshtastic"].get("ble_node")
|
||||||
ble_name = relay_config["meshtastic"].get("ble_name")
|
if ble_node:
|
||||||
|
logger.info(f"Connecting to BLE node {ble_node} ...")
|
||||||
if ble_address:
|
meshtastic_client = meshtastic.ble_interface.BLEInterface(address=ble_node)
|
||||||
logger.info(f"Connecting to BLE address {ble_address} ...")
|
|
||||||
meshtastic_client = meshtastic.ble_interface.BLEInterface(address=ble_address)
|
|
||||||
elif ble_name:
|
|
||||||
logger.info(f"Connecting to BLE name {ble_name} ...")
|
|
||||||
meshtastic_client = meshtastic.ble_interface.BLEInterface(address=ble_name)
|
|
||||||
else:
|
else:
|
||||||
logger.error("No BLE address or name provided.")
|
logger.error("No BLE node provided.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -13,8 +13,7 @@ meshtastic:
|
||||||
connection_type: serial # Choose either "network", "serial", or "ble"
|
connection_type: serial # Choose either "network", "serial", or "ble"
|
||||||
serial_port: /dev/ttyUSB0 # Only used when connection is "serial"
|
serial_port: /dev/ttyUSB0 # Only used when connection is "serial"
|
||||||
host: "meshtastic.local" # Only used when connection is "network"
|
host: "meshtastic.local" # Only used when connection is "network"
|
||||||
ble_address: "AA:BB:CC:DD:EE:FF" # Only used when connection is "ble" - Choose one. If used, don't set `ble_name`
|
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_name: "Your BLE Name" # Only used when connection is "ble" - Choose one. If used, don't set `ble_address`
|
|
||||||
meshnet_name: "Your Meshnet Name" # This is displayed in full on Matrix, but is truncated when sent to a Meshnet
|
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
|
broadcast_enabled: true # Must be set to true to enable Matrix to Meshtastic messages
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue