I am using MIT App Inventor 2 to do some bluetooth connection. I am trying to connect to my Arduino Bluetooth hc05.
I noticed that if I didn't pair my device, the app I wrote can't connect to the device.
Below is the code that I used to connect to my Bluetooth device.
Is there any way to use the code to connect with the Bluetooth device without having to pair it first?
Or is there any way to use the code to input the pairing password using MIT App Inventor 2?
The devices must be paired before being able to connect.
There is no Pairing method available in the App Inventor Bluetooth components. But you could write your own extension, which does the pairing.
More information about how to create an extension see here.
However that will be more advanced and will require some Java skills...
Related
We have a new Ble Device we are using to connect to UWP, Android, and iOS devices.
We have used the "Plugin. BLE" library for our other Ble Devices. https://github.com/xabre/xamarin-bluetooth-le.
This new Device requires Pairing for encryption to be effective. We have used ConnectAsync() methods but it only connects it does not Pair. With Connect we are able to get the services and characteristics but unable to get past encryption as it is not paired. Are there any methods we could use for Pairing a Ble?
In short
When I connect to a BLE device with an unofficial app/program, GATT commands are not executed by the device.
Does the app need to run some king of authentication with the device? (a Bulb)
My reverse engineering story
I am trying to reverse-engineer a Bluetooth LE bulb (the Holi Sleep Companion). I have successfully found the GATT messages I need:
by reading the HCI journals from Android (dev tools)
by disassembling the Java code of the Android app (Sleep360)
However, sending the exact same sequence of Bluetooth messages to the Bulb does not work.
While testing, I actually found that the following works for one GATT command if quickly run in the right order:
I connect the official Android app
I close the official Android app
I connect my own app/program and send one GATT command (from the same device or another)
My tests
I run my tests with two methods:
with the nF Connect Android app
with my own python script running on a Linux laptop with bluez
Thank you for you help!
No there is no such "authentication standard". You have the pairing and bonding however in the standard but that is usually taken care of by the system and not by an app in Android.
A manufacturer is free to use GATT as a transport layer and then build an authentication protocol on top of it.
I was wondering if there's any way that I can control BLE device pairing specific to my app running on mobile device?
I do not want to write my own bluetooth profile so that only my app can talk to the BLE device instead i want to standard profiles available in BLE device but when it's paired to my phone, only my app should be able to communicate to it and none of the other apps should be able to communicate.
No don't do that.
If you MUST then you should encrypt your data with a key only your app knows.
Bluetooth Low Energy is supposed to be open and free for all.
What is the purpose for you to block others? Preventing them to block your service?
Then use some pre-shared key to verify that it's your app in both sides and close the connection if it's not.
I'm trying to pair my iPhone with my ubuntu computer over bluetooth. I'd like to use CoreBluetooth. I have bluez configured correctly, but I need a UUID for CoreBluetooth to connect to my computer. How do I go about setting a custom UUID in bluez?
Ultimately, I'd like to send commands with my iPhone to my pc and then use https://github.com/eelcocramer/node-bluetooth-serial-port to access the transferred data. Is there a better way to do this? I'm new to bluetooth.
Does your computer supports bluetooth 4.0? You can search for
[centralManager scanForPeripheralsWithServices:nil options:nil];
and every reachable device will be found.
With your other problem i can't help you sry.
You need to use bluetooth classic not the low energy for serial port communication
I am using a Single-Mode Bluetooth Low Energy PAN1720BR BLE dongle which is loaded with the firmware "BlueRadios nBlue 1.2.1.3.1.0-PAN1720" (latest). When plugged to a computer, I can control and configure this PAN1720BR module with AT Commands through a terminal application on the computer.
With a second computer equipped with a standard BLE dongle, I can pair and connect to the PAN1720BR. See configuration below:
PC1 + PAN1720BR <---- BT 4.0 ----> PC2 + Standard BLE dongle + App running on PC2
The problem is that BLE does not have an SPP profile, so to establish a communication between the two PCs, I need to write an application on PC2. The PAN1720BR has a proprietary profile called BlueRadios Serial Port (BRPS) which is not a standard.
BlueRadios provides libraries for iOS and Android so that we can connect a cellphone to a PAN1720BR and communicate wih it. But they are silent about how to connect a PC (Windows) to a PAN1720BR. When establishing the connection, the Battery service (standard) installs properly on PC2, but the service corresponding to BRSP does not install, driver is missing. What is going on here is not very clear to me.
My goal is to write an application to be run on PC2 to enable communication between the two PCs. My question is, how can I access the Bluetooth with my application? Please correct me if I'm wrong, but I believe my app needs to access the ATT/GATT layer in order to read/write data.
Do you have any sample code that would help, in Java (prefered), C/C++, C# or anything else that would help on Windows?
Thank you
For an App with BLE Module from BlueRadios you must use the ATT/GATT Profile or you use the library from BlueRadios with there BRSP Profile.