1

I'm using HM-10 controller to communicate with my Android App. In Arduino console I set pin with command AT+PIN112233 which should be Passkey for BLE device. This PIN was saved to my device but Android phone can connect to this device without any confirmation or PIN request. Is this normal behaviour?

I just find device through scanning in BroadcastReceiver and I get device under action BluetoothDevice.ACTION_FOUND. It will return BluetoothDevice and I just connect to this device with

bleGatt = bleDevice.connectGatt(this, true, bleGattCallback)

I did not get any Dialog window in my Android App asking for PIN. Also tried some other apps for Bluetooth or BLE connection and it was the same. None of them asked for PIN during pairing.

Also my HM-10 BLE controller does not react to some AT commands:

  • AT+TYPE2 returns +TYPE=0
  • AT+VERR? not responding
  • AT+VERS? not responding
  • AT+RESTART not responding
  • AT not responding but AT+ responds with OK
martin1337
  • 2,384
  • 6
  • 38
  • 85
  • May I ask where you got the sample code for Android? I need to arrange the same as you and looking for jump into the task. – Nasenbaer Jan 29 '22 at 13:52

3 Answers3

0

I believe this behavior is normal. The same thing happened with my Arduino Nano 33 BLE and Android app that I built. The pin code connection process is for bonding.

anyotherdude
  • 73
  • 1
  • 8
  • I used this function before connectGatt now as I find device in BroadcastReceiver but I did not get any AlertDialog popup in my App. Is this automated process or I have to build my own AlertDialog with password field? I just simply listen to ACTION_BOND_STATE_CHANGED and if bonding state is BOND_BONDED I finally call that connectGatt row above. But I did not receive any AlertDialog in my App and BOND_BONDED is not returned – martin1337 May 05 '20 at 15:55
  • There is also problem with some third party Android apps can connect to my BLE device without password. This removes any security for my BLE device. And I don't think so I can force AlertDialog on other apps. Also what is weird is HM-10 command `AT+TYPE2` is returning `0`. It should return 2 because 0 is for AT+TYPE0 - pairing disabled. – martin1337 May 05 '20 at 16:08
0

I had clone model MLT-BT05 where AT+TYPE2 is not working. That means I cant set pairing method only change PIN which is practically useless.

martin1337
  • 2,384
  • 6
  • 38
  • 85
0

The AT+TYPE command only works with HM10 version >V515. The default for any module is

no need pincode(TYPE 1)

The command to get version of our module is AT+VERR?. Data sheet of HM10 https://people.ece.cornell.edu/land/courses/ece4760/PIC32/uart/HM10/DSD%20TECH%20HM-10%20datasheet.pdf