Page 1 of 1

Bluetooth master slave connection

Posted: Sat Feb 06, 2016 7:19 am
by Icarus
Hello there.
I have purchased two bluetooth shields from Freetronics as of last week and having some troubles. I am creating a project with two Eleven boards and two bluetooth shields. I am wanting the activation of a sensor on one board to trigger an alarm on another via a bluetooth link. Although I can set up the hardware my coding ability is limited and I do not know how to set up the bluetooth shields as a master and slave respectively, has anyone on here done this before and can give me some pointers, in particular how to dedicate one as a master and one as a slave?
Thank you in advance
Icarus

Re: Bluetooth master slave connection

Posted: Sun Feb 07, 2016 11:14 pm
by andrew
You need to use AT commands to set one module into master mode, and the other into slave mode.
Have at look at step 4 onwards of
http://www.instructables.com/id/AT-comm ... /?ALLSTEPS

noting you have a HC05 module.
You will need to change the digital pins used in the sketch to D7 or lower, see:
http://www.freetronics.com.au/pages/blu ... tart-guide

Re: Bluetooth master slave connection

Posted: Tue May 17, 2016 4:23 am
by vijays
Hi there

I am trying to pair two HC-05 at 38500 baud rate. I configure them as master and slave and when used in normal mode they pair properly and i can transmit and receive data.

I use AT mode on master side to retrieve slave address using AT+INQ, i do get my address in the format 2015:4:90245 which is correct.

However when i try to retrieve name of the slave device using AT+RNAME ?2015,4,90245 nothings happens. The LED on the master board goes to slow blink .

same happens when i try AT+LINK=?2015,4,90245. Eventually i have to give up and send AT command again and redo AT+INIT and try again. The Password on both unit is 1234 and they are set to Original values by using AT+ORGL


any suggestions

Thanks

Re: Bluetooth master slave connection

Posted: Wed May 18, 2016 7:20 am
by angusgr
Hi vijay,

Please only send queries via the forum or email, we read both. :)

I've replied to you via email, but I'm going to copy part of the response here for anyone who is interested:
Try swapping the position of the '?' and the ' ' ie:

AT+RNAME? 2015,4,90245

(If this doesn't work, try also omitting the space.)

> same happens when i try AT+LINK=?2015,4,90245

You don't need the ? for this command. Try the following:

AT+LINK=2015,4,90245