Pic To Pic Bluetooth

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Pic To Pic Bluetooth

Post by siliconchip »

hi all,
i have no experience of Bluetooth comms but want to start off and basically send a signal from one pic to another to light a LED using the HC-05 Modules. I've looked at the wiki and altered a program to suit my needs however i must stress that I'm guessing but I've attached the transmit pic flowchart, is it possible those of the more experienced could take a look and see where I've gone wrong or point me in the right direction, or do i need to add the receive Pic flowchart as well any info would be greatly appreciated

cheers bob
Attachments
HC05_SEND.fcfx
(13.38 KiB) Downloaded 113 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 618
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 195 times
Contact:

Re: Pic To Pic Bluetooth

Post by chipfryer27 »

Hi

Been a while since I used BT and then it was connecting to an android, not another PIC.

Offhand I think you may need to send some "AT" commands to the Rx module to set it as a Slave device and then pair with your Tx (Master). I think once it has been paired it "stays" paired (but I'm not 100% certain) and you could probably do that with a PC and USB-TTL convertor running PuTTY / Terminal or such like. Failing that you will need to get your PIC / MCU to do the work.

I think I've a module or two kicking around somewhere and if I find them I'll have a better look.

Regards

chipfryer27
Valued Contributor
Valued Contributor
Posts: 618
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 195 times
Contact:

Re: Pic To Pic Bluetooth

Post by chipfryer27 »

Hi

I found a Slave Module running v1.06 HC-06 firmware, I should have a Master Module somewhere too but as of yet whereabouts unknown.

These modules may be different to what you have in that the Master can only be a Master and will automatically pair with any Slave Module (which can only be a Slave) with the correct credentials.

If I find the Master I'll look a bit further.

Do you have a link to the modules you are using?

Regards

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: Pic To Pic Bluetooth

Post by siliconchip »

hi chipfryer,
im going to use the HC-05 modules
https://www.etechnophiles.com/hc-05-pin ... datasheet/

hope this is of help

bob

chipfryer27
Valued Contributor
Valued Contributor
Posts: 618
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 195 times
Contact:

Re: Pic To Pic Bluetooth

Post by chipfryer27 »

Hi

Sorry, I don't have those particular modules so I'm guessing a bit :) Maybe someone that has used them before can advise better?

Do you have any USB to TTL adapters and a couple of PC's?

(e.g. https://www.amazon.co.uk/Fasizi-convert ... 176&sr=8-6 )

I would use a PC/Laptop running a terminal program such as Terminal or PuTTY to experiment with and have the HC-05's in a bit of breadboard so you can easily connect / set pins as required. The link you sent informs that the default state is set as Slave.

You will need both a Slave and Master and the link provides details on how to send AT commands to set up as a Master (note Key needs to be High to enter command mode by connecting to +3.3v and make sure you have set the correct baud as it is easy to overlook. Once done disconnect Key and cycle power).

Incidentally, to set up as a Slave device it is the same as setting up as Master except "ROLE" will equal 0.

Now the guessing bit.

If you have two PC's, one connected to Master the other to Slave, with luck you should now be able to send data via Terminal. If so, cycle power on both modules again to make sure they retain settings. If all good you now have a pair of modules that will transparently send data.

I don't know what Flowcode does when initialising the HC-05 Component etc and it might overwrite settings. If so then if you could perhaps use the Generic BT Component instead, as you can specify settings and set scripts to configure (v2 allows more options).

Hope this gives you a start.

Regards

Post Reply