Android Question BLE Chat bugs

techknight

Well-Known Member
Licensed User
Longtime User
So, I am using the BLE chat example with my app. The Android device is the Central, while my iOS tablet is the Peripheral. At the same time, the iOS tablet is connected to another BLE peripheral, to control a device.

It works fine, except after a while when its connected, the connection would suddenly drop. Sometimes it will stay connected, but the Notify would drop out. So I could send TO the peripheral, but be unable to receive anything FROM the peripheral.

Then I when I would send back to the peripheral on a "Drop", I would get this error from the central:

B4X:
Logger connected to:  Google Pixel
--------- beginning of main
'A whole bunch of time passing by here, maybe 5 to 8 minutes
CLOCK;76:24;40;25;40
CLOCK;76:23;40;25;40
CLOCK;76:22;40;25;40
CLOCK;76:21;40;25;40
CLOCK;76:20;40;25;40
CLOCK;76:19;40;25;40
CLOCK;76:18;40;25;40
CLOCK;76:17;40;25;40
CLOCK;76:16;40;25;40
CLOCK;76:15;40;25;40
CLOCK;76:14;40;25;40
CLOCK;76:13;40;25;40
retries: 4 'Me pressing a button to attempt a Write.
retries: 3
retries: 2
retries: 1
Error occurred on line: 751 (Main)
java.lang.RuntimeException: Error writing data to: 00001002-0000-1000-8000-00805f9b34fb
    at anywheresoftware.b4a.objects.BleManager2.WriteData(BleManager2.java:356)
    at md.smrm01.main._cmdstartclock_click(main.java:802)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
    at android.view.View.performClick(View.java:6597)
    at android.view.View.performClickInternal(View.java:6574)
    at android.view.View.access$3100(View.java:778)
    at android.view.View$PerformClick.run(View.java:25885)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6718)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

With more testing, It only happens when the iOS app is connected both as a Peripheral to my phone, as well as a Central to the BLE module.

This keeps happening. Any thoughts?
 
Last edited:
Top