Author Topic: Newbie Bluetooth Question re: default comm data rates  (Read 211 times)

0 Members and 1 Guest are viewing this topic.

Offline Dundarave

  • Regular Contributor
  • *
  • Posts: 50
  • Country: ca
Newbie Bluetooth Question re: default comm data rates
« on: February 24, 2019, 06:02:30 pm »
Since I can't find an answer despite a robust Google effort, I'm sure this must be an incredibly stupid question...

I'm playing with three Bluetooth modules, one an HC-05, another embedded in a Soma Smart Shades blind motor, and a 3rd embedded RPi Bluetooth module, trying to figure out how to get the HC-05 (connected to an Arduino Nano) to talk directly to the blind motor without needing to use the HCI & HomeBridge code via the RPi.  I.e. use the HC-05/Arduino combo to simply emulate the 4 or 5 commands I need to send to the Soma blinds device without needing to use the whole RPi/HomeBridge enchilada.

My question is this:  how does a Bluetooth master know at which data rate to initially talk to an arbitrary slave device (i.e. one it has not connected with before)?  Default commands for HC-05 are at the 38400 rate, and default on-line data rate is 9600, but they can both be changed manually.  The HCITools program on the RPi can return various inquiry and scan data, but I see nothing returned from any device about its presently-configured (i.e. on-line) data rate.

I ask because while the RPi can "inquire" and get data from both the HC-05 and the Soma blind transceiver, I cannot get the Soma transceiver to respond to the HC-05 module via a connect/scan/inquiry command, and I'm thinking that until I confirm that the current Soma blind transceiver on-line data rate is 9600 (or not), I'm just wasting my time. 

For example, if the Soma blind device has been set for on-line data at 19200, how would the HC-05 ever find out? The RPi seems to be able to figure it out, so I'm thinking that there must be a well-known convention that deals with this, but I sure can't find it.  Does it perhaps simply run through all the data rates until it gets a valid response?  If so, I would have hoped that it would display any data rate-finding result in the inquiry response... :-//

Thanks for any insight...
 

Offline Dundarave

  • Regular Contributor
  • *
  • Posts: 50
  • Country: ca
Re: Newbie Bluetooth Question re: default comm data rates
« Reply #1 on: February 25, 2019, 05:40:30 am »
Since I can't find an answer despite a robust Google effort, I'm sure this must be an incredibly stupid question...

Further googling has sent me down an interesting rabbit-hole of low-energy Bluetooth vs legacy types, and the Linux BlueZ Bluetooth stack with its associated command line tool set.  I can so far see that the answer to my question is ultimately buried in the sophisticated Bluetooth master-slave handshake protocols, and that these appear to be done on a "well-known" Bluetooth channel at some standard data rate.

I'll eventually follow up with a summary of what I find re: connecting (and controlling) the standalone HC-05 Bluetooth module to the Soma window blind motor for those interested.  I love getting "down to the metal" with new (to me) technologies. 
 

Offline mvs

  • Regular Contributor
  • *
  • Posts: 179
  • Country: de
Re: Newbie Bluetooth Question re: default comm data rates
« Reply #2 on: February 25, 2019, 05:57:31 am »
My question is this:  how does a Bluetooth master know at which data rate to initially talk to an arbitrary slave device (i.e. one it has not connected with before)?  Default commands for HC-05 are at the 38400 rate, and default on-line data rate is 9600, but they can both be changed manually.  The HCITools program on the RPi can return various inquiry and scan data, but I see nothing returned from any device about its presently-configured (i.e. on-line) data rate.
Bluetooth SPP profile is just emulation of UART, there is no fixed/defined bit rate like in UART. If you send a symbol between RPi and HC-05, it will be transmited at available bluetooth link speed, which can be some hunderts of kbit/s.
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 1314
  • Country: 00
Re: Newbie Bluetooth Question re: default comm data rates
« Reply #3 on: February 25, 2019, 06:37:58 am »
In practice, using Serial Port Profile you can go up to approx. 40 KBytes/sec.

Keep in mind that there's no minimum speed, at least because you have to share the 2.4GHz band with other devices
(Bluetooth, Wi-Fi, Industrial, Scientific, Medical, Microwaves, etc.).

https://www.linux.org/threads/bluetooth-and-linux.4555/

https://en.wikipedia.org/wiki/ISM_band

In short, there's no manufacturer of Bluetooth modules that will guarantee that you can transmit at least one byte per second over a distance of 1 meter...

The difference between theory and practice is less in theory than
the difference between theory and practice in practice.
Expensive tools cannot compensate for lack of experience.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf