Dear community,
since almost one week I tried to find a solution for this problem:
For medical simulation, I built six pulseoximeter-mockups and six remote control units. Both circuits are equipped with HC-05 modules, the mockups are slaves and the remote controls are masters.
Three conditions have to be realized:
- Every mockup must be combinable with every remote control, and therefore
- pairing between any mockup and any remote control must be done easily.
- If pairing was succeessful, the master is permitted to connect to only one slave and vice versa
The hardware for this requirements consists of a magnet and a reed contact in juxtaposition in each mockup and remote control. So if a mockup and a remote control are positioned side by side, both reed contacts are closed and give the signal to their microcontrollers to start the pairing process between these two individual devices.
At the moment I´m working with two HC-05 modules on a breadboard to find a suitable sequence of AT commands to pair them.
I tried the following sequences of AT-comands:
Remote control:
AT+ORGL (set default values)
AT+RMAAD (delete addresses of former binded devices)
AT+CMODE=1 (connect to all devices)
AT+ROLE=1 (set device as master)
After a High on the state-pin indicates the successful binding:
AT+CMODE=0 (connect to only one device)
Mockup:
AT+ORGL (set default values)
AT+RMAAD (delete addresses of former binded devices)
AT+CMODE=1 (connect to all devices)
After a High on the state-pin indicates the successful binding:
AT+CMODE=0 (connect to only one device)
After these commands the HC-05 modules only connect if I repower them. However, in both mockups and remote controls the modules are continuously connected to power, so repowering is technically not possible.
The AT+BIND command doesn´t help me, because it requires the address of the device that has to be bound, and this is not known in the particular case.
Can anybody give me a hint how to connect two arbitrary HC-05 devices?