mbientlab / PyWarble

MetaWear Python SDK - Linux / Windows - Wrapper for Warble C library
https://mbientlab.com
Other
6 stars 2 forks source link

Running on PyPy2 or PyPy3 #8

Open zzvara opened 4 years ago

zzvara commented 4 years ago

Hi!

We use 4 MBient MetaMotionR devices at the same time on an AARCH64 Linaro Cortex A53. We used Python2 and Python3 interpreters recently with the Python APIs to connect to MMRs. After we observed unsatisfactory performance on our SoM, we decided to switch to PyPy2 or PyPy3 as a Python interpreter, to speed up code execution.

It nearly works out of the box. Both PyPy2 (taken from aptitude) or PyPy3 built for AARCH64, installed from TGZ results in a Segmentation Fault right after connection would be handled at this code:

https://github.com/mbientlab/PyWarble/blob/02806b1f896054044023331863dad35510959bc9/mbientlab/warble/gatt.py#L60

This means that the connection is successfully made to the MMR using gatt by the warble C library.

We noticed that ctypes support is not full in PyPy. PyPy uses cffi for interfacing with C code.

We are interested in moving to PyPy and would like to ask for advice in regard to fixing the pywarble library for PyPy.

  1. Should we reimplement pywarble with cffi interfacing?
  2. Or can we fix the current pywarble implementation that uses ctypes?

Thank you for your kind help!

zzvara commented 3 years ago

Is there any way to get this working?

lkasso commented 3 years ago

Is this still an issue?

zzvara commented 3 years ago

Yes.

However, we are quite disappointed that through official support e-mails we received a message "We can not help you at the moment." and here we also did not get a response, although we ordered 500 pcs of R-variant.