omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Crash in cb discover_characteristics()

    Pythonista
    3
    3
    1447
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rlmalisz
      rlmalisz last edited by

      I'm working on a script that gathers readings from Xiaomi plant sensors. Using LightBlue I know that there's essentially a serial number whose value can be gotten through service UUID FE95, and thence through characteristic 0014.

      I'm able to access data (and even write settings) through other service UUID/char UUID sets. I'm adding this code so I can maintain a mapping of sensors to locations that will work across multiple iOS devices.

      discover_services() does a callback to did_discover_services() with an object that has the right UUID. Calling discover_characteristics() with that object crashes Pythonista 100% of the time on my iPad. Irrespective of any oddities about this device (and LightBlue reads it just fine), this seems like a serious bug.

      Help/suggestions?

      --Richard

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        Have you installed the fault_handler? It will provide info on exactly what is failing.

        1 Reply Last reply Reply Quote 0
        • omz
          omz last edited by

          One thing you could try would be to keep a reference to the discovered peripheral as a property on your delegate. That way, the peripheral object won't be garbage-collected prematurely (this is basically a workaround, the crash shouldn't happen).

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors