The object has been closed

In the async connect method my Python script sometimes crashes in a line in the Metawear package code with the error 'mbientlab.warble.WarbleException: The object has been closed'. The connect method is implemented as done in the tutorials and works most of the time. I have tried adding try catch blocks and error handling but the program still crashes completely. After searching online, it seems that the issue might be due to lookups sharing memory space when attempting to connect asynchronously. Any idea what I can do to solve this issue? Could it be due to operating system bluetooth for instance?

Thank you in advance!

Comments

  • No sure on this. Can you share steps so that we can replicate?

  • edited October 2020

    Hi Laura,

    Thanks a lot for the quick reply. I am attaching a file containing my connect method and a screenshot of the error message and stack trace. The crash seems to be coming from the metawear.py file line 195 (raise result[0]). There are no specific steps per se, I just run my program connect method and occasionally this happens, but most time it doesn't. Is there a better way to handle this rather than crashing the program? or something I can do so my program doesn't crash - It is bad user experience.

  • Hi Laura,

    Let me know if you require any further information about this.

  • Hi Laura,

    A kind reminder about this issue. Let me know if you need more information.

  • @chris0417,
    Have you been able to fix this? Unfortunately I don't have time right now to look at code.

Sign In or Register to comment.