I have 3 Bluetooth modules HC-05 connected to my laptop using an USB-TTL interface and 3 microcontrollers each one has its own HC-05 slave. These devices shall send values to my laptop (each slave sends a value to his own master only). In the laptop side, I have a Python script that manages the communication in this way:
- Open COM1 (Master 1)
- Send request to the slave
- The slave sends a response
- Close COM1 (Master 1)
- Open COM2 (Master 2)
- Send request to the slave
- The slave sends a response
- Close COM2 (Master 2)
- Open COM3 (Master 3)
- Send request to the slave
- The slave sends a response
- Close COM3 (Master 3)
To do so, is it possible to set different baud rates in order to avoid conflicts between them ?
For example:
- Master 1 and Slave 1: 115200 bit/s
- Master 2 and Slave 2: 19200 bit/s
- Master 3 and Slave 3: 9600 bit/s
Is there another efficient way to make sure that every pair of HC-05 avoid other HC-05 devices ?
Best Answer
If you bind master 1 to slave 1, master 2 to slave 2, and master 3 to slave 3, then the 3 master/slave pairs should communicate without any conflicts and you will not need to keep closing and reopening COM ports. The binding procedure is described in this video - you need CMODE=0.