Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aioble happens Guru Meditation Error #709

Closed
rivendell1984 opened this issue Aug 2, 2023 · 0 comments
Closed

aioble happens Guru Meditation Error #709

rivendell1984 opened this issue Aug 2, 2023 · 0 comments

Comments

@rivendell1984
Copy link

rivendell1984 commented Aug 2, 2023

Environment:

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:

and finally raise the asyncio.TimeoutError:

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:

Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0). 

Core  0 register dump:
PC      : 0x40006fd0  PS      : 0x00060634  A0      : 0x8002b764  A1      : 0x3fc9aed0  
A2      : 0x00020000  A3      : 0x00000000  A4      : 0x3ff1a412  A5      : 0x00000105  
A6      : 0x8e89bed6  A7      : 0x00000000  A8      : 0x00000001  A9      : 0x3fcef9e4  
A10     : 0x3fcef9e4  A11     : 0x00000001  A12     : 0x00020000  A13     : 0x00000000  
A14     : 0x00000001  A15     : 0xffffffff  SAR     : 0x00000005  EXCCAUSE: 0x00000005  
EXCVADDR: 0x00000000  LBEG    : 0x40006fc4  LEND    : 0x40006fcb  LCOUNT  : 0x00000000  
Core  0 was running in ISR context:
EPC1    : 0x420f9473  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x40006fd0


Backtrace:0x40006fcd:0x3fc9aed00x4002b761:0x3fc9aef0  |<-CORRUPTED


Core  1 register dump:
PC      : 0x420fb506  PS      : 0x00060034  A0      : 0x82002e3a  A1      : 0x3fcf5af0  
A2      : 0x3fca0b7d  A3      : 0x00060020  A4      : 0x80384ab0  A5      : 0x3fcbc2e0  
A6      : 0x00060023  A7      : 0x00000003  A8      : 0x82074a51  A9      : 0x3fcf5ae0  
A10     : 0x00060023  A11     : 0x00000000  A12     : 0x00060020  A13     : 0x3fcbc2e0  
A14     : 0x00060023  A15     : 0x00000003  SAR     : 0x0000001d  EXCCAUSE: 0x00000005  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  


Backtrace:0x420fb503:0x3fcf5af00x42002e37:0x3fcf5b10 0x40382e74:0x3fcf5b30 




ELF file SHA256: fa29813f4fbb6a13

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

@rivendell1984 rivendell1984 changed the title What's the best practice to handle the aioble timeout exception aioble happens Guru Meditation Error Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant