[SOLVED] HC 42 Bluetooth Module Rejecting to Pair to Android (ver. 10) Phone

I have a new HC 42 Bluetooth Module. The module is successfully detected by an Android (ver. 10) phone, but the pairing fails with the message - ‘Pairing rejected by HC-42’.

Even in the AT mode, some of the commands like setting it back to factory settings (AT+DEFAULT), are not executed.

The connections are as follows:
HC 42 Arduino
Vcc 5v
GND GND
TX TX
RX RX
Key 5v

Request you to please help.

Thank you

The first issue I am noticing is that RX and TX should be swapped:

  • RX (receive) should be connected to TX (transmit)
  • TX (transmit) should be connected to RX (receive).

As for the device rejecting the connection, you may need to download a separate app that works with the GATT protocol which these modules use. I would recommend GATTBrowser, which should be able to connect to your module even without any configuration.

shreyas_arbatti:
The module is successfully detected by an Android (ver. 10) phone, but the pairing fails with the message - 'Pairing rejected by HC-42'.

This may be because of wrong procedure.

You need a phone app that is compatible with BLE. The only BLE app I have used is the terminal by Kai Morisch. It has to be manually switched between standard and BLE Bluetooth.

The connection is made in the app without being on the pairing list.

mmdk95:
The first issue I am noticing is that RX and TX should be swapped:

  • RX (receive) should be connected to TX (transmit)
  • TX (transmit) should be connected to RX (receive).

Thank you for the reply. I have connected TX to TX and RX to RX as I am using it in AT mode.

mmdk95:
As for the device rejecting the connection, you may need to download a separate app that works with the GATT protocol which these modules use. I would recommend GATTBrowser, which should be able to connect to your module even without any configuration.

I installed the GATTBrowser on my Android phone. The connection is successful, but I am unable to bond. Clicking on ‘Create Bond’ shows the message ‘Paring Rejected by HC-42’.

Nick_Pyner:
The connection is made in the app without being on the pairing list.

Thank you for the reply. I was able to connect using the Bluetooth Terminal app that you have suggested. My requirement is to have the Bluetooth module in the paring list as I would like to control the devices through MIT App Inventor. MIT App Inventor can only connect to Bluetooth devices that are paired.

shreyas_arbatti:
My requirement is to have the Bluetooth module in the paring list as I would like to control the devices through MIT App Inventor. MIT App Inventor can only connect to Bluetooth devices that are paired.

I have very little experience with BLE devices. Mine works only in the manner I have described and indeed as you have experienced. It is fair to assume that all BLE devices work that way. I guess this leaves you with two options:

  1. Find that what you said about AppInventor is not true and there is a method to control the devices., or

  2. Ditch the BLE, and use an HC-0x, which indeed works in the way you expect.

I would go for option 1. BLE has been around for a while, and I find it hard to believe that AppInv can't handle it.

You would be well advised to read reply#1 again - twice. The transmitter and receiver are single function facilities. Once you work out the meaning of the words "transmitter" and "receiver" you will probably realise that connecting a transmitter to a transmitter is a dumb idea. You will not have done any damage and, once done, you may find that you can send AT commands OK. I think you will find that the connection to KEY is redundant.

I was able to connect using the Bluetooth Terminal app that you have suggested.

The Kai Morich app will only connect if the device has previously paired with the phone.

I have a new HC 42 Bluetooth Module. The module is successfully detected by an Android (ver. 10) phone, but the pairing fails with the message - 'Pairing rejected by HC-42'.

Was this message seen in the phone's "connected devices" dialog in "Settings"?

cattledog:
The Kai Morich app will only connect if the device has previously paired with the phone.

That sounds rather too Kafkaesk to be true. The only way I have ever had BLE working is with Morich’s app. No pairing, and nothing subsequently left in Bluetooth list in phone settings.

Clicking on 'Create Bond' shows the message 'Paring Rejected by HC-42'.

Yeah, BLE does not create a bond. Some devices support this, I am not sure if the HC-42 does, at least not without configuration. You can however send commands over BLE and such.

When you are connected to the device in the GATTBrowser, you can scroll down the list of services. On the bottom, you'll see an id that is formatted like xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx. Under that, you will have different services that are listed. Clicking on one of the services opens the 'characteristics' screen. You'll probably see a few options there. Turning on Notifications will show the data the Bluetooth device is sending. When you write data, it will send data to the Bluetooth device. I recommend setting it in string mode first instead of hex mode.

As for MIT app inventor, perhaps take a look at this:

Thank you all for your suggestions, with which the issues are now resolved.

  • With the GattBrowser, I was able to get the UUIDs of the BLE
  • MIT App Inventor has an extension for BLE Devices
    With the above information, I can now connect the HC 42 and control the devices using MIT App Inventor.

All your suggestions were a learning experience as I am using the BLE device for the first time. I learned about GATTBrowser, the features of Kai Morich's app, BLE Extension in MIT App Inventor, and more.
Thank you all for the assistance.

Good job working through the complexity of BLE.

For controlling an Arduino with Bluetooth from a phone, why would you use BLE instead of BT classic? Is this a learning experience? Is there some sort of battery operated power use issue?

cattledog:
Good job working through the complexity of BLE.

For controlling an Arduino with Bluetooth from a phone, why would you use BLE instead of BT classic? Is this a learning experience? Is there some sort of battery operated power use issue?

I am a young electronics enthusiast. After working on BT classic, I bought HC 42 assuming that it is simply an advanced version of HC 05. Only later did I come to know that BLE devices work differently. This has indeed been a great learning experience, thanks to everyone who responded to my query.

shreyas_arbatti:
I bought HC 42 assuming that it is simply an advanced version of HC 05.

This is essentially true - just - although perhaps more an advance on the HM-10, which is a BT4 device. The HM-10 offered very little over the HC-05. About the most you could say for it was that it offered HC-05 facility to iPhone users. It seems that this HC-42 is a BT5 device and is only a small increment over an HM-10. I believe the main difference is that it has an iBeacon facility. Both are crippled versions of the real McCoy, and you may find that neither offer you much over an HC-05.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.