Multi slave Bluetooth Low energy  - Page 1
Forum section: electronics / projects

author: TimB100
author_rank: Contributor
timestamp: October 21, 2020, 03:30:51 pm
content: Hi,This is what I'm looking to do.I need 2 BLE modules to talk to a PC, Phone, Tablet etc, The 2 modules will periodically (~every 1 second) fire a few bytes to the main device and once in a while the main device will send a few bytes back. From my initial checks its not possible. You cannot have 2 devices talking to the same device.I know I can make a dongle with say a nrf24l01+ to a USB Pic and use HID to connect to the PC, Tablet etc. I have one already but looking to remove the dongle.The issue I have always had with Bluetooth is how finicky it is. Just use a set of BL head phones. Your into settings trying to link the device. You need to put the modules into pair mode etc etc not to mention the number of times they just drop out. With the HID pic NRFxxx device its plug and play. On an Android device from memory you just need to plug the dongle in and it works. At worst its a pop up saying do you want to xxxx. Defiantly no issues on a PC. However its a dongle.So my question is Can I use 2 modules talking to one device at the same time and is there a simple system to enable the device once it is paired to "Just work" when app is running and device is turned on.

author: janoc
author_rank: Super Contributor
timestamp: October 21, 2020, 03:55:53 pm
content: Of course you can do it. But you need to start about the architecture differently. BLE is not your old style bluetooth where you pair two devices and the only those devices can talk together.Have your modules implement a peripheral role, exposing the data as GATT attributes/characteristics. Then have the PC, tablet, what have you implement the central role and periodically poll your modules - i.e. connect to them, read the data they need from the GATT characteristics and/or write any feedback data.You can even have your modules simply broadcast the data blindly (without connection) and the PC/tablet/phone connects to them only when it needs to send some data to the devices. That's often how the various fitness/exercise machines are implemented.Assuming that you have your network credentials setup correctly (devices are bonded together or broadcasting data freely), this will work just fine as long as the modules keep advertising (so that they are discoverable and connectable).However, I think you need to make it clear for yourself which version of Bluetooth are you trying to use. At first you talk about BLE but then about pairing and headphones - which is Bluetooth Classic (there is no audio profile for BLE yet, AFAIK). A totally different beast that is unable to do what you want and uses a completely different hardware (e.g. the popular Nordic nRF52 modules don't support Bluetooth Classic at all, only BLE).Nordic has a ton of excellent documentation on BLE, I suggest that you start there to learn how the protocol even works and what you can do with it. And also what it takes to use it - implementing a BLE device using one of the Nordic modules is not for the faint of heart. Even if you avoid the legacy proprietary SoftDevice and use Zephyr RTOS instead, the learning curve is STEEP!

author: TimB100
author_rank: Contributor
timestamp: October 21, 2020, 05:09:31 pm
content: Many many thanks janocYour right I was thinking old school bluetooth. The GATT or the blind broadcast would work as well. All good news for me!Plenty of reading it seems thoughCheers again!Tim

author: janoc
author_rank: Super Contributor
timestamp: October 21, 2020, 05:40:57 pm
content: Adafruit has a high level intro to BLE:https://learn.adafruit.com/introduction-to-bluetooth-low-energy