Kivy and Bluetooth Low Energy (BLE) using jnius

135 views
Skip to first unread message
Message has been deleted

Juan Sierra Pons

unread,
Nov 9, 2019, 5:47:05 AM11/9/19
to kivy-...@googlegroups.com
Hi,

I am testing bluetooth BLE following the instructions on [1] "Kivy-Android et Arduino en Bluetooth Low Energy (BLE)" web page

I can compile and create the app on python3.7 but I am getting the following error while pressing the connect button:

11-09 02:30:03.459 18715 18778 I python  :    File "/home/juan/git/BLE/.buildozer/android/app/main.py", line 139, in connect
11-09 02:30:03.460 18715 18778 I python  :    File "/home/juan/git/BLE/.buildozer/android/app/main.py", line 84, in try_connect
11-09 02:30:03.461 18715 18778 I python  :    File "jnius/jnius_export_class.pxi", line 1034, in jnius.jnius.JavaMultipleMethod.__call__
11-09 02:30:03.462 18715 18778 I python  :  jnius.jnius.JavaException: No methods matching your arguments, available: ['(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;)Landroid/bluetooth/BluetoothGatt;', '(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;I)Landroid/bluetooth/BluetoothGatt;', '(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;II)Landroid/bluetooth/BluetoothGatt;', '(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;IILandroid/os/Handler;)Landroid/bluetooth/BluetoothGatt;', '(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;IZILandroid/os/Handler;)Landroid/bluetooth/BluetoothGatt;']
11-09 02:30:03.462 18715 18778 I python  : Python for android ended.

in the code there are defined to java methods:

    @java_method('(Landroid/bluetooth/BluetoothGatt;II)V')
    def onConnectionStateChange(self, gatt, status, newstate):

    @java_method('(Landroid/bluetooth/BluetoothGatt;I)V')
    def onServicesDiscovered(self, gatt, status):

I have found a similar case
"
I created the bluetooth connection quite easily, but as soon as I try to read or write data I get a jnius.jnius.JavaException that No methods matching your arguments, and that the methods available for read are: '()I', '([B)I', '([BII)I' and for write are '(I)V', '([B)V', '([BII)V'. I tried finding this in the developer android docs as well as DuckDuckGoing it but with no clarity.
"

I guess that the two methods should be updated with the available options given in the error message but not sure as I am not a Java guy.

Any idea how to proceed?

Thanks for your time

Best regards

--------------------------------------------------------------------------------------
Juan Sierra Pons                                 ju...@elsotanillo.net
Linux User Registered: #257202      
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages