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
MicroPython v1.20.0-124-g17c3f6b6aa-dirty
ESP32S3 module (spiram octal) with ESP32S3
The latest aioble version
My code is as below:
async def _keep_reading_value():
...
try:
print("Connecting to", device)
connection = await device.connect()
except asyncio.TimeoutError:
print("Timeout during connection")
return
try:
async with connection:
try:
temp_service = await connection.service(_ENV_SENSE_UUID)
temp_characteristic = await temp_service.characteristic(_ENV_SENSE_TEMP_UUID)
value = await temp_characteristic.read()
except asyncio.TimeoutError:
#1.here raise the TimeoutError
print("Timeout discovering services/characteristics")
return
except asyncio.TimeoutError as err:
#2.here raise TimeoutError again
print("TimeoutError:", err)
if connection.is_connected():
#3.here the connection is not disconnected
print("Still connect")
async def read_value_loop():
while True:
await _keep_reading_value()
await asyncio.sleep(30)
When I'm reading the value from characteristic, I got TimeoutError in async with connection block.
And then I got TimeoutError when exit from async with connection block.
I think it happened when DeviceConnection is trying to disconnect:
After that, when I check the connection.is_connected(), it's still return true. Is there a leak for the connection?
And for a while, I got the Guru Meditation Error:
From this link, I guess there is no memory for BT controller: espressif/esp-idf#6444, is it related to the connection leak?
And could you give me suggestion, how to fix this issue? Thanks
The text was updated successfully, but these errors were encountered:
rivendell1984
changed the title
What's the best practice to handle the aioble timeout exception
aioble happens Guru Meditation Error
Aug 11, 2023
Environment:
My code is as below:
When I'm reading the value from characteristic, I got TimeoutError in
async with connection
block.And then I got TimeoutError when exit from
async with connection
block.I think it happened when DeviceConnection is trying to disconnect:
micropython-lib/micropython/bluetooth/aioble/aioble/device.py
Line 295 in 01ab7ba
and finally raise the asyncio.TimeoutError:
micropython-lib/micropython/bluetooth/aioble/aioble/device.py
Line 94 in 01ab7ba
After that, when I check the
connection.is_connected()
, it's still returntrue
. Is there a leak for the connection?And for a while, I got the Guru Meditation Error:
From this link, I guess there is no memory for BT controller: espressif/esp-idf#6444, is it related to the connection leak?
And could you give me suggestion, how to fix this issue? Thanks
The text was updated successfully, but these errors were encountered: