Replies: 3 comments
-
Can you share the program to reproduce this error? |
Beta Was this translation helpful? Give feedback.
0 replies
-
import asyncio
import logging
import sys
import numpy as np
from bleak import BleakClient
logger = logging.getLogger()
def callback_handler(sender,data):
if data is None:
logger.info(
"Qiuting...."
)
else:
try:
EMG_NUM.EMG=np.array(str(data, "utf-8").split(','),dtype='int64')
except:
pass
async def main(address: str, char_uuid: str):
async with BleakClient(address) as client:
await client.start_notify(char_uuid, callback_handler)
while True:
await asyncio.sleep(1.0)
def ble():
while EMG_NUM.Kill == False:
try:
logging.basicConfig(level=logging.INFO)
asyncio.run(
main(
"7C:9E:BD:48:6A:36",
"ca73b3ba-39f6-4ab3-91ae-186dc9577d99",
)
)
except:
pass |
Beta Was this translation helpful? Give feedback.
0 replies
-
Try moving the while loop inside of the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Run bleak program, it will to prompt:
What I Did
Restarting the BT device for several times does not work. I must wait patiently for the connection success message to appear.
Beta Was this translation helpful? Give feedback.
All reactions