Android Question Bluetooth 4.0 data exchange

red30

Well-Known Member
Licensed User
Longtime User
I have a microcontroller to which the Bluetooth HC-08 (Bluetooth 4.0) module is connected. I want to exchange data, but I have not found a single example on the forum. I need to work exactly with Bluetooth 4.0. How can i do this?
I found the program Serial Bluetooth Terminal. Can I do the same with b4a?

I tried this example. I get the error: java.io.IOException: read failed, socket might closed or timeout, read ret: -1

I found the program from the official manufacturer, it works fine with this bluetooth module.
 

Attachments

  • 2016330162415101 (1).zip
    329.7 KB · Views: 768
Last edited:

emexes

Expert
Licensed User
We're using modules from China (aliexpress) nRF52840
100% tested with standard ceramic antenna ~650mts
just can't be used to connect direct to the phone, you need something like
your sensors - BLE log range - serial - BLE standard - Smartphone

Is that ~650mts as tested by you, or by the manufacturer? Presumably your distance is at ground level but still line-of-sight. What sort of noise would you have had in that radio band? Are we talking country fields and no other wifi or Bluetooth in sight, or are we talking of invisible battles taking place during the signal's ~650 metre expedition?

That nRF52840 does look pretty good, though. I read this post about Nordic Semiconductor themselves doing tests with with a drone and GPS, where they got "almost 800 meters" line-of-sight using the 125 kbps long range mode. My default reality-adjustment-factor for the Scandinavian marketplace is about 20 dB higher than for for the Chinese marketplace, so I'll take those results as being true, but... the post did leave me with a couple of background niggles.

One is that they say they didn't go further because the drone pilot couldn't (legally) go beyond visual range, but... the base station receiving the GPS coordinates doesn't have to be co-located with the drone pilot, so why didn't they just move the station (or the pilot) to increase the test distance??? Like, presumably these guys are keen to see how far it will go, so why stop just as they're coming 'round the home turn?

The other is that they're suggesting that it should be possible to get to 3200 metres. Really? Nothing is impossible, but that'd be mighty impressive they did get a usable and reasonably stable link over that distance. In the meantime, I think this guy in the comments is at the head of the Queue Here For Disappointment line:
So technically with a bitrate of 125Kbps, you are telling me we can use nRF52840 boards can advertise packets up to a range of 800x4 i.e 3200 meters?

I'd be wanting some good odds on that before placing any bets.

;-)
 
Upvote 0

emexes

Expert
Licensed User
Is that ~650mts as tested by you, or by the manufacturer? Presumably your distance is at ground level but still line-of-sight. What sort of noise would you have had in that radio band? Are we talking country fields and no other wifi or Bluetooth in sight, or are we talking of invisible battles taking place during the signal's ~650 metre expedition?

Btw I'm not disputing whatever range measurement you achieved, I'm just asking because it's always interesting - and useful - to find out what results people actually get in the real world with real devices, as opposed to what the device literature says.

:)
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
yes, ground level, 650+ meters using the ceramic antenna , but I tested in like visual comunication like to say flat..

then we added an external antenna, getting 700+ mts but very hard to test because you need a flat area..

One is that they say they didn't go further because the drone pilot couldn't (legally) go beyond visual range, but... the base station receiving the GPS coordinates doesn't have to be co-located with the drone pilot, so why didn't they just move the station (or the pilot) to increase the test distance???
they are using a direcctional antenna, I used an omnidirectional antenna,
maybe they didn't want to lost the control of the drone..
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
they are using a directional antenna
Where did you get this? I couldn't find either of those two words in article or comments. Are there other articles about the same test?

I did think that the altitude of the drone would help too, in that if it is eg 100 metres up, then that means that interference (at the drone end) is going to be say 100-times smaller than if it was say 10 metres away, which makes pulling the signal out of the noise that much easier too. But they said it was a one-way link and in the other direction to boot, so perhaps altitude will make no difference to the range.

A directional antenna would, though, through both amplifying the signal and cutting the noise.

{long break}

Somehow I got from long range wifi to boat ramp fail. How did that happen?!?!
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Where did you get this? I couldn't find either of those two words in article or comments.
ahh not sure now :-( your link looks diffrent to the link that I read last year.. but I couldn't find it
or maybe I mixed the information because I was looking for an antenna to make sure to get 600mts

Somehow I got from long range wifi to boat ramp fail. How did that happen?!?!
:eek::eek::eek:

Edit: they did it 1300mts? :eek:
https://devzone.nordicsemi.com/b/bl...ith-nordic-solution-it-simply-works-922075585
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
ahh not sure now :-( your link looks different to the link that I read last year..

That is no problem, because the new link you provided is even better. Plus the way they discuss what they're doing, including explanations and reasoning and a healthy bit of real-world-awareness, instills confidence that they're being honest and accurate. And I haven't even finished reading it yet!

As you noted earlier, it does need Bluetooth Long Range hardware at both ends to get that range, and thus it's not directly compatible with the Bluetooth in Android devices (yet...)
 
Upvote 0

red30

Well-Known Member
Licensed User
Longtime User
Today I discovered such an incomprehensible situation:
I have two bluetooth modules HC-08 and HC-08-TEST. Both have firmware is HC-08 V2.0,2014-08-22.
And there are two tablets, let's call them No. 1 and No. 2.
I worked all the time on tablet No. 1, with the bluetooth module HC-08-TEST and everything was fine,
Screenshot_20190305-161753.png
but when I connected to the Bluetooth module HC-08, I noticed that only two characteristics were read.
Screenshot_20190305-160634.png
The first thing I thought was that the new Bluetooth module is just not working. But I tried to connect to it with the tablet No. 2 and all the characteristics were perfectly considered.
Screenshot_20190305-160859.png
Why could it happen at all? These are two absolutely identical bluetooth modules.
That is, the situation is this: two identical modules work on all devices, except for tablet No. 1. One module works with it, and the other does not ...
 
Upvote 0

emexes

Expert
Licensed User
Today I discovered such an incomprehensible situation

I'm going to start calling you Sherlock... ;-)

Why could it happen at all? These are two absolutely identical bluetooth modules.

Good question, and yes (or close to it - bear in mind that we seem to be working with clones of the HM-10)

My first thought would be turn everything off and on, in case something's stuck in a cache or has timed-out overnight, or perhaps the first caffeine of the morning hadn't quite kicked in yet (we've all been there at some point...)

:)
 
Upvote 0
Top