-
Notifications
You must be signed in to change notification settings - Fork 672
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
Unable to connect to device : Error Callback #78
Comments
Are you seeing the problem on iOS or Android? What device are you trying to connect to? |
Hi Don, We are facing the same issue. We are trying to connect a Samsung S4 which is paired with Nexus 7 Tab. We have the mac address of the Nexus 7 Tab and we call the bluetoothSerial.connect API. But this always goes in error function saying "Unable to connect to device". I am getting in to enabled success handler and I also got the list of devices. Below is the code:
|
@ankittanna This plugin does not support Android to Android communication. Android is using Bluetooth Classic and expects to connect to a generic RFCOMM uuid 00001101-0000-1000-8000-00805F9B34FB. The plugin does not implement code that starts a server socket. If you had another Android app start a server socket it's theoretically possible for an app using this plugin to connect to it. This Android code in the plugin is based on sample in the Android SDK. They have a good example of Android to Android chat. |
Hi Don, This would be the most common scenario of Android to Android Communication? Do we have any alternative plugin for the same? Thanks, |
I don't know of an alternative plugin. Look at BluetoothSerialService.AcceptThread, you can probably modify it to open the socket on UUID_SPP (00001101-0000-1000-8000-00805F9B34FB) and add some JavaScript wrappers for cordova.
If you get something to work, send a pull request. I'm not planning on adding this functionality unless a client needs it. |
Hi Don, I'm getting "Unable to connect to device" when attempting to connect to a paired device with its MAC address on Android. I have gotten the mac address via a call to bluetoothSerial.list(), so I'm certain that the address is correct. Here are some information regarding the devices: Running on: Android 4.4.4 Any suggestions on how to troubleshoot? |
@ankittanna There is a fork that should work with Android to Android https://github.com/tomvanenckevort/BluetoothSerial |
@booybooy I'd guess that the camera doesn't support Serial Port Profile (SPP). The plugin expects to connect to UUID 00001101-0000-1000-8000-00805F9B34FB. You can modify the plugin if the camera is using a different UUID, but I'd expect is using another Bluetooth Profile. |
This is probably out of scope, but any idea how to find out which profile this camera remote supports, i.e via API? I'm also confused about: "The plugin expects to connect to UUID 00001101-0000-1000-8000-00805F9B34FB.". Does this pertain to only Android? Because BluetoothSerial.connect()'s documentation seems to suggest that if I were developing with iOS, I'd be able to pass in the UUID of the camera remote to make the connection. |
No idea on your camera. For Android, the plugin used Bluetooth Classic and uses Serial Port Profile (SPP). 00001101-0000-1000-8000-00805F9B34FB is a well known RFCOMM UUID. For iOS, this plugin uses Bluetooth Low Energy (BLE). BLE doesn't have SPP, but a bunch of the devices have custom UART services that behave similar to SPP. On iOS you're passing in the iOS generated UUID that is a reference to the BLE device that was discovered when scanning for devices. BLE doesn't pair like Bluetooth Classic. |
Hai Don, |
@Sasikumariosdeveloper I don't think the AB Shutter 3 will work with this plugin. I expect the AB Shutter 3 just emulates a HID (keyboard) on iOS. The Bluetooth id in the settings is the MAC address of the adapter. This plugin uses Bluetooth Low Energy on iOS. For BLE, iOS needs a UUID to connect. You get the UUID by scanning for Bluetooth devices. |
Good Morning Don, |
Hi Don, I try to connect in a Blue Bamboo PM25-M bluetooth. But when I send de connect command. They returns same error : Unable to connect to device. I use ionic + angularJS bluetoothSerial.connectInsecure( The MAC Address is correct . Do you have any solution ? |
@booybooy booybooy follow code will be work!
|
I have integrated plugin using CLI successfully and also listed connected android device but when i call bluetoothSerial.connect it is always go to error callback though Mac Address of remote device is correct.. I have also tried by put this into SETTIMEOUT but not working. please help me to resolve this issue I am stucked in this problem.
The text was updated successfully, but these errors were encountered: