Arduino Uno + BLE HM-10 Master Mode collecting custom characteristic

Hello all,

I am really really struggling with such a simple thing as collecting one custom characteristic using arduino from BLE 4.0 module which is broadcasting this. So I reach for help here. I did try to search for solution of my problem, but I cannot find this combination anywhere. It seems that everyone is using controllers with inbuild bluetooth so please be patient if there actually is somewhere a post like this.

Hardware and set up :
I have Arduino Uno with BLE 4.0 (original HM-10 bluetooth module) in Master mode.
I set it up to be connected to my peripherial device (electric unicycle).
After some AT commands, my module is now connected and receiving advertised data. I am able to print them out in serial monitor. The device has one custom characteristic which I would like to collect. Ideally to subscribe for any changes to be sent directly to the module. I believe it is called "notify". This works in my android app. But I cannot get these data into arduino.

**The problem : **
But I am not able to get that one characteristic, to read it and change it to ASCII characters from what I believe will come as HEX values. I am able to receive advertised, but not those characteristics and I am crazy out of this already :slight_smile:

Can someone help me provide some usable material how can I finish this (what I thought will be) a simple task?

Thank you everyone kind to push me in right direction.

Jakub

Could You make a test code by copying the troubling code and comment out the working BT parts? Does the troubling function work or still make trouble?

Hello Railroader,

I am not sure what you mean :slight_smile: My BT is working correctly, I am able to get advertised data into serial monitor.
The point is that I am missing a code that would tell the module to collect also custom characteristic which I believe I need to subscribe (set notify value somehow) on.

Can you please advise what that code would look like? Or how shall I make it work?
Or if a code is not necessary and there is any AT command for it? I did not find anything on this matter, while this sounds like a stupid question, I know... but the only thing I want to do, is not working for me :smiley:

Thank you.

Sorry, I don't understand what You're trying to describe. There are modules, devices, characteristics.... mixed in the text. It makes no sence.
Present a scientific description and facts, not only a lot if text.

Hi again,

well maybe I am missing or misunderstanding something.
I am sorry about that. But let me try to describe my case one more time and really briefly, maybe you will have some answer to problems I have.

I have one peripheral device. My goal is to read custom characteristic that is this peripheral device able to broadcast. However I believe (and please correct me if I am wrong) that BLE device is advertising only basic data like list of characteristics and their attributes (if they are Read/Write/Notify).

I have one central device (Arduino uno with HM-10 bluetooth module) in which I desire to collect custom characteristic from said peripheral device and show it on a display.

In my android cell phone, if I want to achieve this, I need to click Notify button on that characteristic and only then it starts to send it to my phone. I want this to happen on arduino too, however I have no clue how to code said notification enabling.

That is my question, how should I enlist my bluetooth (in master mode ofcourse) module to ask for recurrent sending of data from peripheral device. I am able to connect between those two, but I only see advertised packets, not those data packets.

Thank you for your time.

Jakub

Your "device", "custom characteristic" tells nothing. If You transfers bytes or books are not interesting yet.
Post information useful in engineering.
Post a system overview as well as links to the stuff involved.

Your post is just made-up technobabble. I recognise that English is probably a second language but, if you keep it simple, you will probably get by. You might start by explaining what you mean by custom characteristic, which seems to be where the problem lies. Blueteeth just receive information and pass it on, and are thus usually innocent at times like this.

I have Arduino Uno with BLE 4.0 (original HM-10 bluetooth module) in Master mode.
I set it up to be connected to my peripherial device (electric unicycle).

The device has one custom characteristic which I would like to collect.

Do you have documentation on the electric unicycle and what is the service and characteristic you are trying to read? There are probably BLE scanner tools you can use to figure out what the unicycle is trying to say.

I'm unclear if you can actually configure the HM10 in central mode to read this characteristic/service. Working with the HM10 and AT commands seems like a tough interface for a custom application.

I would think that you would be better off with a more fully featured BLE device which can use a BLE library to do some of the heavy lifting.

Are you limited the the HM10?

Railroader:
Your "device", "custom characteristic" tells nothing. If You transfers bytes or books are not interesting yet.
Post information useful in engineering.
Post a system overview as well as links to the stuff involved.

Hi Railroader. The device is Gotway electric unicycle. I can find it and connect to it in BLE scan (the name broadcasted is Gotway_8963). In BLE scan I am able to find multiple characteristics like battery level, name (said Gotway_8963) and the one I am interested in which is literally called "Custom characteristic" and from the log I observed, it is sending roughly 48 bytes which are started with sort of header : 04 18 5A 5A 5A 5A 55 AA. In between that header and what seems to be similar footer, there are data which I want to capture.

However I am not asking for explicit code. I only wanted to have an advice how to proceed with setting the module to capture those data. That is really all :slight_smile:

Your post is just made-up technobabble. I recognise that English is probably a second language but, if you keep it simple, you will probably get by. You might start by explaining what you mean by custom characteristic, which seems to be where the problem lies. Blueteeth just receive information and pass it on, and are thus usually innocent at times like this.

I am sorry, but I am writing what I really see. I though that custom characteristic is legitimate term. That is literally what I read from BLE scanner in my android, there are no usable data. Only some hex formation/pattern/protocol of some sort that I am only yet to understand.

I'm unclear if you can actually configure the HM10 in central mode to read this characteristic/service. Working with the HM10 and AT commands seems like a tough interface for a custom application.

I would think that you would be better off with a more fully featured BLE device which can use a BLE library to do some of the heavy lifting.

Are you limited the the HM10?

Unfortunately I don´t have any documentation with that kind of information about Bluetooth that I want. Only some basic user stuff. Therefore I need to do some reverse engineering.
Thank you for that hint, I actually start to feel that HM-10 is indeed not rich enough to provide me what I need.
I have no problem whatsoever to order anything else, do you have something particular in mind? Are there better modules out there? Or do you mean complete controllers like ESP32 rather than Arduino Uno?
Thank you all for your time.

Or do you mean complete controllers like ESP32 rather than Arduino Uno?

Yes. Arduino and Adafruit both make fully configured controllers with integrated BLE. The ESP32 is also a possibility.

praetorian4:
I actually start to feel that HM-10 is indeed not rich enough to provide me what I need.

This may well be correct. The HM-10 is a crippled version of a full-bottle BLE. and has virtually nothing to offer. It seems to be nothing more than an HC-05 substitute for iPhone users.

Nick_Pyner:
This may well be correct. The HM-10 is a crippled version of a full-bottle BLE. and has virtually nothing to offer. It seems to be nothing more than an HC-05 substitute for iPhone users.

Oh OK. I did not know THAT. I thought that HM-10 is full module, capable of everything (including master mode which is not everywhere). Also Chinese clones did not prove to be worth even trying :slight_smile: Wasted money honestly.
Thank you guys, I will try to find and buy different hardware.

praetorian4:
Also Chinese clones did not prove to be worth even trying :slight_smile: Wasted money honestly.

This is just your paranoia showing.
I'm afraid we are going round in circles here, which is at least partly down to me. Since you have already asserted you can connect and receive data, the HM-10 may well serve your needs, but those needs are still as nebulous as ever.

HM-10 can be configured as a master just like any other Bluetooth except the HC-06 which, as far as I'm aware, is the only Bluetooth that can't be. Also, since you can already connect and receive data, there is no need to worry about configuring as a master anyway.

Further, if you can find a Bluetooth that is not made in China, you are a better man than I, Gunga Din. There are no "clones" to worry about, but I understand there are fakes. "Reduced instruction set" does not necessarily mean fake, and certainly doesn't mean clone.

I might point out that the main reason why I find the HM-10 useless is that it offers nothing I need that an HC-05 doesn't, and I don't own an iPhone...

Nick_Pyner:
This is just your paranoia showing.
I'm afraid we are going round in circles here, which is at least partly down to me. Since you have already asserted you can connect and receive data, the HM-10 may well serve your needs, but those needs are still as nebulous as ever.

HM-10 can be configured as a master just like any other Bluetooth except the HC-06 which, as far as I'm aware, is the only Bluetooth that can't be. Also, since you can already connect and receive data, there is no need to worry about configuring as a master anyway.

Further, if you can find a Bluetooth that is not made in China, you are a better man than I, Gunga Din. There are no "clones" to worry about, but I understand there are fakes. "Reduced instruction set" does not necessarily mean fake, and certainly doesn't mean clone.

I might point out that the main reason why I find the HM-10 useless is that it offers nothing I need that an HC-05 doesn't, and I don't own an iPhone...

Hi Nick_Pyner,
are you serious? I am not sure if you are kidding or not.
I am not comparing people, nor genuine quality modules. I don´t have anything against China. I am comparing cheap rubbish which is here in Europe being normally sold as "clone". I did not even know what that means. Now I know that at least those two "chineese" bluetooth modules I got (AT-09 and CC2541) did not provide me with any service. They have very limited potential.
Quite recently I ordered HM-10 and what I got was CC2541. Try to compare those two and you will see how huge difference it is. It was my mistake, I did not want to spend less money. But it was indeed a trash. I can see where they made the module being one third of a price of HM-10. Just for start no automatic reconnect? Half of AT commands... Different and definitely worse output of AT commands.
HM-10/CC2541 is difference like day and night and that is all I wanted to say. I will rather have fully functional module for full money than to labor on each for a week.
Anyway yes, I wrote that I am able to get data, but only on my mobile phone. That is where I check what is actually being sent from my EUC. HC-05 I also have and I believe it is not able to get data either, because it does not support Bluetooth 4.0. For that, I thought I needed HM-10. That should capable of receiving BLE protocol, rather than ordinary old bluetooth 2.0 "pairing" system.
I did not manage to get my HM-10 module to work and collect the data I need. Yet.

I'm afraid I can't go on with this, I'm just chasing a chimera. While your HM-10/CC2541 is pretty basic and no use to me, there is nothing that you have actually said that confirms that it is no use to you, and quite a lot that suggests it is entirely suitable

I set it up to be connected to my peripherial device (electric unicycle).
After some AT commands, my module is now connected and receiving advertised data. I am able to print them out in serial monitor.

Since you can receive data, it would appear that your only problem is that you can't this "custom characteristic" that nobody has ever heard of. From that, I can only conclude that, if it is actually available, your only problem is that you don't know how to ask for it, and the hardware is 100% kosher.
I have no idea if HM-10 will auto-reconnect. I imagine it would, but don't intend looking. What I can tell you is that it won't auto-reconnect while still in slave mode, and who would ever know which is master and which is slave in your setup? You might see what Martyn Currey has to say about that stuff, but it is clearly irrelevant at this stage of the circus.

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