cancel
Showing results for 
Search instead for 
Did you mean: 

Pairing BlueNRG with Android

nick239955_stm1_st
Associate II
Posted on May 30, 2016 at 07:10

I have our BlueNRG device set up to use a fixed pin for pairing.

I am able to successfully pair with Apple iOS decvices and windows phone when I enter the correct PIN when prompted by the device.

However when connecting to an Android device, the pairing always fails even though I enter the correct PIN when prompted. Using a packet sniffer I can see that the reason for failing is 0x04 (The confirm value does not match the calculated compare value).

I have tried with several different Android devices and versions including 4.4, 5.1 & 6.0 and I have the same issue with all of these.

Has anyone successfully paired an Android device with BlueNRG using a PIN code?

Regards

Nick

#bluenrg-pairing #android #android #bluenrg-pairing
4 REPLIES 4
mehdi
Associate II
Posted on November 29, 2016 at 17:58

Hi Nick,

I have the same problem as you desctibed, did you find any solution to pair your android device to the bluenrg ?

Thanks,

MBR 

daithi62
Associate II
Posted on November 30, 2016 at 18:35

Hi guys,

I did have issues similar to you guys but I was entering the password as a hex value. Simple I know but may be the cause. I just got mine paired and will work on the comms tomorrow hopefully.

daithi62
Associate II
Posted on December 01, 2016 at 09:24

....and as well as that I also noticed that rev6 of the User Manual (UM1686) doesn't provide the parameter details for the 

aci_gap_set_authentication_requirement

comand.

I retrieved theses settings from the rev3 document.

Regards,

cod

aci_gap_set_authentication_requirement

MITM_Mode

= 0x01

OOB_Enable

= 0

OOB_Data

= 0

Min_Encryption_Size

= 0x07

Max_Encryption_Size

= 0x

10

Use_Fixed_Pin

= 0

Fixed_Pin

= 123456 (decimal)

Bonding_Mode

= 1

aci_gap_set_authentication_requirement

pagano.paganino
Associate III
Posted on December 01, 2016 at 10:28

Hi all,

i have successfully paired SPBTLE-RF with Android and iOS devices.

result = self.aci_gap_set_auth_requirement(

            mitm_mode=MITM_PROTECTION_REQUIRED,

            oob_enable=bool(OOB_AUTH_DATA_ABSENT),

            oob_data=b'\x00'*16,

            min_encryption_key_size=MIN_ENCRY_KEY_SIZE,

            max_encryption_key_size=MAX_ENCRY_KEY_SIZE,

            use_fixed_pin=bool(USE_FIXED_PIN_FOR_PAIRING),

            fixed_pin=123456,

            bonding_mode=BONDING)

I have reimplemented  a pure python drivers for

http://www.micropython.org/

 based on bluenrg dk ''2.0.2''. 

MicroPython v1.8.6-114-g8b82429-dirty on 2016-11-30; PYBv1.1 with STM32F405RG

Type ''help()'' for more information.

>>> from sensor_demo import SensorDemo

>>> ble = SensorDemo()

>>> ble.run()

INFO:examples.sensor_demo current version 7.2c

INFO:examples.sensor_demo #acc_serv_handle 000c

INFO:examples.sensor_demo #free_fall_char_handle: 000d

INFO:examples.sensor_demo #acc_char_handle: 0010

INFO:examples.sensor_demo #env_serv_handle 0013

INFO:examples.sensor_demo #temp_char_handle: 0014

INFO:examples.sensor_demo #press_char_handle: 0017

INFO:examples.sensor_demo gap_connection_complete_cb

INFO:examples.sensor_demo gap_disconnection_complete_cb

INFO:examples.sensor_demo gap_connection_complete_cb

INFO:examples.sensor_demo gap_disconnection_complete_cb

INFO:examples.sensor_demo gap_connection_complete_cb

INFO:examples.sensor_demo gap_disconnection_complete_cb

Regards,

D.