Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth connection issue (Bluetooth unexpectedly disconnected during operation.) #552

Open
JulienDuf opened this issue Feb 13, 2025 · 1 comment

Comments

@JulienDuf
Copy link

JulienDuf commented Feb 13, 2025

Summary

Our application is pairing with a M2 reader to process payment. We don't see this error with all the readers, only with a few of them.

When starting our app, we try to connect to the reader. The reader is discovered, but an error is thrown when connecting to it.

Code to reproduce

val connectionConfig = ConnectionConfiguration.BluetoothConnectionConfiguration(
  locationId = locationId,
  autoReconnectOnUnexpectedDisconnect = true, // default is true
  bluetoothReaderListener = this,
)
  
Terminal.getInstance().connectReader(
  reader,
  connectionConfig,
  object : ReaderCallback {
      override fun onFailure(e: TerminalException) {
          result.error(
              "stripeTerminal#unableToConnect",
              e.errorMessage,
              e.stackTraceToString()
          )
      }
  
      override fun onSuccess(reader: Reader) {
          result.success(true)
      }
  }
)

Android version

Android 14

Impacted devices (Android devices or readers)

Android device: TMRV5GTB
M2 reader: STRM26214000420

SDK version

4.1.0

Other information

Here's the stack trace I see in my logs

Bluetooth unexpectedly disconnected during operation., com.stripe.stripeterminal.external.models.TerminalException: Bluetooth unexpectedly disconnected during operation.
	at com.stripe.stripeterminal.internal.common.adapter.BbposBluetoothAdapter.onDisconnect(Unknown Source:144)
	at com.stripe.stripeterminal.internal.common.adapter.BbposAdapter$registerReaderDisconnectHandler$1.accept(SourceFile:5)
	at com.stripe.stripeterminal.internal.common.adapter.BbposAdapter$registerReaderDisconnectHandler$1.accept(SourceFile:1)
	at io.reactivex.rxjava3.internal.observers.LambdaObserver.onNext(Unknown Source:8)
	at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(Unknown Source:47)
	at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(Unknown Source:8)
	at io.reactivex.rxjava3.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(Unknown Source:10)
	at io.reactivex.rxjava3.internal.schedulers.g.run(Unknown Source:82)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
, null)

We've try to reboot the Android device, but we still have the issue.
The M2 reader is not updating when this error occures.

The same Android device and M2 reader were able to connect to each other 14 days ago. However, I don't know if an update was being installed at that time.

@JulienDuf
Copy link
Author

Update: We were able to fix the issue by rebooting the M2 (long press the power button).

This is problematic for us, because the M2 is in an enclosure, we don't have a direct access to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant