HM10, HC05/06 problem - Head Unit Android Car Radio


I have a problem with Bluetooth module, HC05/HC06. When Im using app on android phone, everything is ok. Pairing, connecting etc.. but when i used this app on head unit android radio i have problem with error 504. Bluetooth module is paired fine... i guess.. another app, like bluetooth terminal is connecting with this module correct.

My head unit android radio doesn't see BLE modules like HM10 (i don't know why :frowning: phone does see these correct) so i decided to choice module which is visible, like HC05/06... but i have a problem with error 504...

Where is a problem?? Thank you!

504 means the bt device is not paired with the android device. Are you correctly getting the bt device list in the app?

Yes, first I paired the module directly from bluetooth settings, but the pairing was strange .. I didn't have the option to enter the pin ...

In the case of HC05 / 06 and HM10 (BLE), I wonder if adding additional android permissions will help?

I did one experiment. I added some permissions in the screen initialization section:


After starting the app, I get a message like below... after that the app is automatically closed.

Without asking for it you didn't get this message?

are you using by accident my bluetooth example app?

it might have been a good idea to mention that...
and if you are using my example app and deny the permission, you get exactly that error message

you might want to elaborate, what exactly you are trying to do... also a screenshot of your relevant blocks might help... Note: my extension only can help you with Bluetooth Classic but not BLE...


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Note: To be able to ask for permission, it must be declared in the Manifest.

Yes, when i delete this permission from initialization screen, I didn't get this message.

Yes, I tried use yours extension for HC05/06 - Bluetooth Classic. Just added the above permissions for quick test. I didn't change anything else in your sample app.

Good to know. I will remember.

Good point. Where to set it?

I tried many example apps for Bluetooth Classic and BLE, not the only one..

An extension that required a permission, should declare it in the Manifest. Since this extension was created by @Taifun I'm pretty sure this is the case. To check it you must decompile the APK and take a look in the Manifest.

you only have to ask for dangerous permissions and ACCESS_FINE_LOCATION includes ACCESS_COARSE_LOCATION, i.e. you only have to ask for ACCESS_FINE_LOCATION as my example app is doing it

you still did not provide a screenshot of your relevant blocks, which means unfortunately we still have to guess what you are trying to do


You write that the pairing was weird. Is the module on the list of available modules in your application? It is possible that the radio connected to the module automatically in a different profile. Does the LED sometimes light up on the module as after connecting to the application?

I had such a case once. The user of my application could not connect to a device that had a built-in BT 2.0 module, because his audio equipment automatically connected to this module. Back then it was not possible to connect to the app. Watch the LED of the BT module.

Bluetooth extension which was created by Taifun i used once, yesterday... I just wanted to know how to add permissions to the Manifest. But if you say that the permissions are probably added by default in the extensions for Bluetooth, that's enough for me.

Below is an example program from the Internet to control the LED by the BLE HM10 module. Everything works on the android phones (with differents android versions: 8, 9, 10), the modules are detected immediately.
The problem is on the car radio.
The program uses the bluetooth module for BLE from this link: MIT App Inventor + Internet of Things

No, that's not it. Nothing is connected to this module automatically in 100%, because even a fresh module that has never been paired is not detected.

In an application that works 100% on Android phones and communicates with BLE modules, I use this extension: MIT App Inventor + Internet of Things

The problem starts only in the car radio with android 9. I was upgrading from version 8 because someone on the internet wrote that on version 8 "oreo" there is a problem with bluetooth communication ... it didn't help. Oh, the car radio connects to the phone without any problems, so I exclude the wrong bluetooth drivers in the radio system.

The bluetooth module in the android radio is SD-968.