-1

I was working on Bluetooth project and I connected two Raspberry pi4 successfully and they are exchanging the data, Referred from this.
Now I need to send sensor data to multiple raspberry pi's at a time and they should exchange message automatically. I saw some articles, saying that we can connect up to 10 devices at a time. But how to create multiple clients for a single Bluetooth server?

Any help would be appreciated.

Ganesh
  • 21
  • 1
  • 4
  • 1
    Welcome to [Stack Overflow.](https://stackoverflow.com/ "Stack Overflow") Please be aware this is not a code-writing or tutoring service. We can help solve specific, technical problems, not open-ended requests for code or advice. Please edit your question to show what you have tried so far, and what specific problem you need help with. See the [How To Ask a Good Question](https://stackoverflow.com/help/how-to-ask "How To Ask a Good Question") page for details on how to best help us help you. – itprorh66 Jan 27 '22 at 00:52
  • From what I know, a device can connect to only 2 bluetooth devices at once. – vinalti Jan 27 '22 at 17:59

1 Answers1

1

When an LE server accepts a connection, it stops advertising and so will not accept any more connections. (see Bluetooth Core Spec Vol 2 Part E 7.8.9). You need each Pi to connect, read, and then disconnect at separate times without tripping over each other, or one Pi connected to the LE server, and multiple Classic RFCOMM serial connections (which can be open simultaneously) from there to the other Pis to pass the data on.

petzval
  • 441
  • 1
  • 2
  • 7
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 28 '22 at 05:58
  • @petzval Thank you for clarifying me. It might be stupid to ask this question, but Can we create RFCOMM channels without dongles? If possible can you attach the links to refer. It would be really helpful for me to understand RFCOMM in RasPi. – Ganesh Jan 28 '22 at 15:30
  • Which Bluetooth Core spec are you relating to? Vol. 2 Part E was moved to Vol. 4 and 7.8.9 "LE Set Advertising Enable command" does. not contain anything about the server being required to stop advertising after a connection was established. In fact, there are BLE devices that allow multiple connections by simply keeping advertising. [This question](https://stackoverflow.com/questions/51018017/is-it-possible-to-connect-multiple-ble-devices-to-a-central-device) asked the same and got an answer specifically for the RPi3 stating 10 connections are possible. This is all hardware dependent – Michael Kotzjan Jan 31 '22 at 07:54