You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import time
import adafruit_ble
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService
target_address = '6c:79:b8:bb:b1:ed'
target_address_bytes = bytes(reversed([int(x, 16) for x in target_address.split(":")]))
print("Scanning for BLE devices...")
ble = adafruit_ble.BLERadio()
devices = ble.start_scan(timeout=1, extended=True, interval=.2)
for device in devices:
if device.address.address_bytes == target_address_bytes:
print("found target device!")
for attr in ['address', 'connectable', 'flags', 'matches', 'rssi', 'scan_response', 'tx_power', 'complete_name', 'get_prefix_bytes', 'data_dict', 'mutable', 'match_prefixes', '_prefix_bytes', 'short_name']:
print(f"{attr}: {getattr(device, attr)}")
try:
ble.stop_scan()
print("Stopped Scan")
robot_connection = ble.connect(device)
if robot_connection and robot_connection.connected:
print("Connected to robot")
uart_service = robot_connection[UARTService]
uart_service.write(0xfff2)
print("Sent message to robot")
except Exception as e:
print("Error connecting to robot:", e)
break
The text was updated successfully, but these errors were encountered:
This is on a ESP32-S3 Reverse TFT, connecting to a BLE device. I get "Failed to connect: internal error"
Output:
The text was updated successfully, but these errors were encountered: