Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PostedonJune19,2013byErichStyger
20Votes
AftermyfirstpostusingaBluetoothmodule,thingshaveevolvedabit.Thechallenge
withtheseBluetoothmodulesis:theylookthesame,buthavingdifferentfirmware.Idid
notfullyrealizethatuntilIhaveorderedanotherbluetoothmodulefromdx.com:
DX.comBluetoothModule(HC06)
Thatmodulecomesalreadyonacarrier,soIassumedIcanusethesamedriverasfor
myothermodule.Iwaswrong
HC05orHC06
MyearliermodulewhichIreceivedfromanothersource(withoutanadapter,seethispost)
hasadifferentfirmwareonit,knownasHC05,whilemyDX.commodulehasaHC06
firmware.Tobeclear:themodulesarethesame,butthesoftware/firmwareonitis
different,andthefirmwareusesthepinsdifferentlytoo
HC06andHC05(SourceWavesenDataSheet)
Checkoutthispostwhichexplainshowtoreprogramthefirmwareofthedevice
withfirmwareprogrammingadapter:http://byron76.blogspot.ch/2011/09/hc05
firmware.html
TheHC05hasthefullfirmwareonit:manyATcommands,andcanbebothmasterand
slavemodule.TheHC06firmwareontheotherhandonlycanbeaslavedevice,with
verylimitedATcommands.
Orinotherwords:
TheHC05modulecanbuildaconnectiontoothermodules.E.g.aRobotbeinga
masterandconnectingtoslavebluetoothmodule.Orinslavemodetomakea
wirelessbridgetoanotebook.
TheHC06moduleonlycanbeaslave.Thismakesitonlyusefulforsayconnecting
anotebookasamastertoarobotwithaslavemodulee.g.forawirelessserial
bridge.
FormostusecasestheHC06isenough,astypicallyIwanttohaveawirelessUART
connectiontomydevicesfrommynotebook.
JYMCUV1.5Module
BelowisanimageoftheJYMCUHC06(JYMCUV1.5)module.Themodulecamewith
a4pinheader,andIhaveaddedthepinsforSTATEandKEY,andremovedtheplastic
aroundthemoduletogetaccesstothepins:
HC06TopSide
Pins
Onthebottomsidetherearelabelsforthesignaldirectionandvoltagelevels:
JYMCUBT_BOARDV1.05BottomSide
KEY:accordingtothedatasheet,Ineedtopullupthispinwhilepoweronresetof
themoduletoenforceATmode.Ihavenotbeenabletoverifythisyet.Ihavebeen
toldthatsomemoduleshavethispinnotconnectedatall?
VCCisindicatedintherangeof3.6V6V.Themoduleworkedformebothwith3.3V
and5V.
GND:Ground
TXD:serialoutputofthemodule,tobeconnectedtoRXofthemicrocontroller.Note
thatthissignalisusing3.3Vlogiclevel
RXD:serialinputofthemodule,tobeconnectedtotheTXofthemicrocontroller.
Notethatthissignalisusing3.3Vlogiclevels.
STATE:connectedtoLED2(Pin32)ofthemodule,butnomeaning?Atleastonmy
modulethepinwasalwayslow,regardlessifpairedornot.
DifferentATcommands
OntheHC05module,IsendAT\r\ntothedevice,andthenitrespondswithOK\r\n.
ButontheHC06,theprotocolisdifferent
IneedtosendAT(withoutthenewline
characters),andIreceiveOK(withoutthenewlinecharacters).
Thelogicanalyzershowsthisbehaviourtoo:ATcommandsenttothedevice:
ATCommandsenttoDevice
OKresponsefromthedevicewithno\r\nattheend:
OKResponsefromtheDevice
Themissing\r\nispresentforallcommandsoftheHC06firmware.Asasthisisnot
enough,thereareveryfewcommandpossible.ThetablebelowshowsalltheHC06
firmwarecommandswiththeresponse:
CO MMA ND
RE S P O NS E
CO MME NT
AT
OK
Usedtoverifycommunication
AT+NAMExyz OKsetname
Setsthemodulenametoxyz
AT+PIN1234
OKsetPIN
SetsthemodulePINto1234
AT+BAUD1
OK1200
Setsthebaudrateto1200
AT+BAUD2
OK2400
Setsthebaudrateto2400
AT+BAUD3
OK4800
Setsthebaudrateto4800
AT+BAUD4
OK9600
Setsthebaudrateto9600
AT+BAUD5
OK19200
Setsthebaudrateto19200
AT+BAUD6
OK38400
Setsthebaudrateto38400
AT+BAUD7
OK57600
Setsthebaudrateto57600
AT+BAUD8
OK115200
Setsthebaudrateto115200
AT+BAUD9
OK230400
Setsthebaudrateto230400
AT+BAUDA
OK460800
Setsthebaudrateto460800
AT+BAUDB
OK921600
Setsthebaudrateto921600
AT+BAUDC
OK1382400
Setsthebaudrateto1382400
Thatsit.
FirmwareTiming
Asthisisnotenough,mydriverdidnotworkevenwiththenewcommandsimplemented.
TheHC05firmwareassendingaresponsebackinlessthan300ms,whiletheHC06
firmwareneedsmorethan500msuntilthereisaresponse:
DelaybetweenCommandandResponse
SoforthisIhadtointroduceauserconfigurabledelayinthecomponent.
ProcessorExpertComponent
Withthisknowledge,theProcessorExpertBluetoothcomponenthasbeenupdatedto
supportboththeHC05andHC06firmware:
BluetoothComponentSupportingHC05andHC06
FirmwaretoselectbetweenHC05andHC06
ConfigurableResponseTimeifthemoduleneedslongerforcommands
OptionalStateandCMDpins
IftheHC05firmwareisselected,thenthecomponentautomaticallydisablesthe
functionalitymethodsnotpresent/supportedinthefirmware(grayedoutmethods):
BluetoothModuleMethods
CommandLineInterface
TheProcessorExpertcomponentfeaturesanoptionalcommandlineinterface:
HC06ShellCommands
Withthis,Icanchangethepairingpin,devicenameorbaud,besideofsendingAT
commandsorsendingastringoverthewirelessbridge.
Changingthepairing/name/baudwillbeeffectiveafterresettingthedevice.Keepin
mindifyouchangethebaud,thiswillchangethebaudaswellbetweenthemoduleand
themicrocontroller.
ThestatuscommandissuesanATcommandtothedevicetoseeifitresponds,plus
showsthefirmwareversion:
BT1StatuswithModuleFirmware
StatusandATcommandscanonlybeusedifthedeviceisnotpairedyet(means:
whiletheredLEDisblinking).
ConnectingtotheBluetoothModule
TheBluetoothmodulerunstheSPP(SerialProtocoloverBluetooth)protocol.Soany
devicesupportingSPPcanconnecttoit.OnaPCthislookslikeavirtualCOMport.I
showherethestepsforWindows(runningWindows7).
ItseemsthatApple(iPhone,iPAD,etc)does*not*supportSPP,soconnectingwith
aniPhoneisnotpossible.Android(whichIdidnottry)shouldwork,oranyPC
machinewithBluetooth.
Beforeconnecting,makesurethemoduleispoweredandreadytopair.TheredLEDon
themoduleindicatesthestatus:
blinking:readytopair
steadyon:paired
FromtheDeviceManager,selectAddaDevice:
DeviceManagerwithAddaDevice
Thenthenewdeviceshouldshowup:
AddadeviceDialog
thenameofthedeviceshowshereformeblue1,asIhavenameditassuch.Butit
mightshowupforyouaslinvor(default)orother.
SelectthedeviceandpressNext.InthenextdialogselectEnterthedevicespairing
code:
Enterthedevicesparingcode
Thedefaultpairingcodeis1234:
Enterthepairingcodeforthedevice
Pressingnext,anddevicedriverswillbeinstalled:
Installingdevicedrivers
Thenthedeviceisreadytouse:
YourDeviceisreadytouse
Andtheconfirmationdialogshowsup:
Thisdevicehasbeensuccessfullyaddedtothiscomputer
COMPortusedbyDevice
CheckingthepropertiesonthenewlyaddeddeviceshowsthatitsupportsSPP.Andit
showsthevirtualCOMportused:
DeviceServices
NotethatifIchecktheCOMportsinthedevicemanager,thenIseethatactuallytwo
COMportshavebeenadded.OnlytheoneshownabovewiththeSPPprotocolwillwork.
Itisuncleartomewhythereisasecondport?
ConnectingtotheWirelessBluetoothBridge
UsingthatCOMportshownfortheSPPservice,Icanconnectwithaterminalprogram
onthehostPCtomyboard.BasicallythisgivesmeawirelessbridgeoverBluetoothto
myboard.SofrommyPCIcanopenaterminalwindowandtypeinsomecommands,
whichareparsedbytheShellontheFRDMboard,anditrespondsbacktotheterminalon
thePC:
WirelessBluetoothBridgeConnection
MakesureyouusetheCOMportusedfortheSPPservice,andthatitmatchesthe
baudsettingsofthecommunicationbetweenthemicrocontrollerandtheBluetooth
module.Imusingabovethedefaultof9600baud.Itispossibletochange/increasethe
baudasexplainedabove,as9600isnotveryfast.Onlybesurethatyounotexceedthe
baudtoavaluewhichcannotbehandledbyyourPC.Itshouldworkokuptoabaudof
115200.
Onceconnected,theredLEDontheBluetoothmoduleisalwayson.
PairingLED
Whileconnected,themoduleisintransparentmode,anddoesnotacceptAT
commands.BelowisanexamplewhereItrytosendanATcommandfromthe
microcontrollerwhiletheBluetoothmoduleisconnectedtothehostPC:
TryingtosendATcommandsfromthemicrocontrollerwhileconnectedtoPC
Instead,whatIsendtotheUARTendsuptransparentlyonthehostPC:
BluetoothModuleinTransparentMode
WirelessBridge
EverythingIsendtothevirtualCOMportendsupontheBluetoothmodule,whichthen
sendsthecommandstothemicrocontrollerusingtheRXandTXconnectionbetweenthe
microcontrollerandthemodule.Withthis,itisveryeasytosend/receivecommandsusing
theProcessorExpertShellcomponent,andtheimplementationarejustafewlines:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
*\file
*\briefThisistheimplementationmodulefortheshell
*\authorErichStyger
*
*Thisinterfacefileisusedforaconsoleandterminal.
*Thatwaywecaninteractwiththetargetandchangesettingsusingashellim
*/
#include"Shell.h"
#include"CLS1.h"
#include"LEDR.h"
#include"LEDG.h"
#include"LEDB.h"
#include"BT1.h"
staticconstCLS1_ParseCommandCallbackCmdParserTable[]=
{
CLS1_ParseCommand,
#ifLEDR_PARSE_COMMAND_ENABLED
LEDR_ParseCommand,
#endif
#ifLEDG_PARSE_COMMAND_ENABLED
LEDG_ParseCommand,
#endif
#ifLEDB_PARSE_COMMAND_ENABLED
LEDB_ParseCommand,
#endif
#ifBT1_PARSE_COMMAND_ENABLED
BT1_ParseCommand,
#endif
NULL/*sentinel*/
};
/*Bluetoothstdio*/
staticCLS1_ConstStdIOTypeBT_stdio={
(CLS1_StdIO_In_FctType)BT1_StdIOReadChar,/*stdin*/
(CLS1_StdIO_OutErr_FctType)BT1_StdIOSendChar,/*stdout*/
(CLS1_StdIO_OutErr_FctType)BT1_StdIOSendChar,/*stderr*/
BT1_StdIOKeyPressed/*ifinputisnotempty*/
};
voidSHELL_Run(void){
unsignedcharbuf[32];
unsignedcharbTbuf[32];
buf[0]='\0';
bTbuf[0]='\0';
CLS1_ParseWithCommandTable((unsignedchar*)CLS1_CMD_HELP,CLS1_GetStdio(),Cmd
for(;;){
(void)CLS1_ReadAndParseWithCommandTable(buf,sizeof(buf),CLS1_GetStdio(),C
(void)CLS1_ReadAndParseWithCommandTable(bTbuf,sizeof(bTbuf),&BT_stdio,Cmd
}
}
UnbindingandTroubleShooting
Incasethereareissueswithconnectingtothemodule,itisnecessarytounbindandre
bind(connect)tothemodule.IthappenedtomesometimesImabletoconnectonce,but
thennotanymore.Inthatcasethefollowingstepshelp:
1.CloseanyterminalprogrampotentiallyconnectedtotheBluetoothvirtualCOMport.
2.UnpowertheBluetoothmodulesoitisnotvisibleanymoretothePC.
3.RightclickonthedeviceintheWindowsDevicemanager(orDevicesandPrinter
group)andselectRemoveDevice:
UnbindingBluetoothDevice
4.Repowerthemodule:theredLEDshallbeblinkingasnotconnected.
5.Searchforthedeviceinthedevicemanager(asabove),andconnectagaintothe
devicewithapairingpin.
6.ConnecttothemoduleusingtheCOMportspecifiedfortheSPPservice.
ThatwayIwasalwaysabletorecoverconnectiontomymodule.Seeaswellthispost
whichhelpedmetosolvemyproblem.
Sources
AllthecomponentsourcesdiscussedareavailableonGitHub.Additionally,theFRDM
KL25ZBluetoothexampleprojecthasbeenupdatedtosupportboththeHC05andHC06
modules.
HappyBluetoothing
SH A R ETH IS:
Print
Tumblr
Pinterest 2
Facebook 63
LinkedIn 1
Like
6bloggerslikethis.
R ELATED
GettingBluetooth
WorkingwithJYMCU
BT_BOARDV1.06
In"Boards"
Bluetoothwiththe
FreedomBoard
In"Boards"
YetanotherBluetooth
Firmware:BC04
In"Embedded"
ThisentrywaspostedinBoards,Debugging,Eclipse,Embedded,Embedded
Components,KL25ZFreedomBoard,ProcessorExpert,Tips&Tricksandtagged
CodeWarrior,codewarriorproject,Eclipse,EmbeddedComponent,freedomboard,
KL25ZFreedomBoard,opensourceprojects,ProcessorExpert,software,software
project,Tips&TricksbyErichStyger.Bookmarkthepermalink
[http://mcuoneclipse.com/2013/06/19/usingthehc06bluetoothmodule/].
AboutErichStyger
Embeddedismypassion....
ViewallpostsbyErichStyger
139THOUGHTSONUSINGTHEHC06BLUETOOTHMODULE
AlexVecchio
onJune19,2013at21:39said:
HiErich,
Maybeyoucantalkabout24L01+andEthernet
communications?DoyouhavethisBeans?
Thanks,
AlexVecchio
Brasil
Like
ErichStyger
onJune19,2013at21:48said:
HiAlex,
doyoumeanthe24L01fromNordicSemiconductor?No,
Idonothavebeansforthisone.IdohaveanEthernet
Shield,buthadnotmuchtimetoworkonit.Itwillbeone
ofthenextthingsforsure.
Like
AlexVecchio
onJune19,2013at21:58said:
OuchFastestansweri`veeverseen!
Yes.IamtalkingabouttheNordicSemiconductor
24L01.Maybethiscanbeareallycheapsolution
tocontrolafreedomboardfromanotherfreedom
boardwirelessly.
Otherthingistocontrolafreedomboardthrough
theintranet.
Iamwaitingforyournewposts.Thanksforthis
excellentjobyouaredoing.
Like
ErichStyger
onJune19,2013at22:38said:
SometimesIneversleep
yes,thatNordicmoduleisreallyinteresting,
altoughIdonothaveone(yet).TheHC06
Bluetoothone(ortheHC05)arereallycheap:less
then$10,andatleasttheHC05onecanbeused
tocontrolanotherFRDMboard.
Like
AlexVecchio
onJune20,2013at06:32said:
HiErich,
IthinkwecancontrolalotofFreedomboards
simultaneouslywiththe24L01+butwecannotdo
thiswithbluetoothdevices.Right?
Like
ErichStyger
onJune20,2013at08:03said:
Yes,doingthiswiththeHC05probablyisnot
easilypossible.Fortheusecaseyoudescribe
ImusinganIEEE802.15.4modulewhichcan
buildupstarormeshnetworks.
Like
Tom
onJune20,2013at22:57said:
HiErich,
Thesemodulesarereallycheapat
(http://yourduino.com/sunshop2/index.php?
l=product_detail&p=188).
Ihaveboughtfromthemandthepartswerevery
reasonableandshippingwasgoodtoo!
Cheers,
Tom
Like
ErichStyger
onJune21,2013at07:37said:
HiTom,
theyare*increcibly*cheap,thanksforthelink.I
guesswillorderafewtotryitout.OnceconcernI
have:thederiversIhaveseenareallGPL2which
isaconcern.Haveyouseen(orusing)LGPLor
BSDstyledriversorstacks?OtherwiseitlooksI
needtodevelopeverythingfromgroundupwhich
isnotideal.
Like
Tom
onJune21,2013at14:37said:
Erich,
Erich,
NoIhaventseenLGPLorBSDstacksbutI
haventbeenlookingthathard.Thereisalibrary
at(http://arduinoinfo.wikispaces.com/nRF24L01
RF24Examples)whichmaybesomethingyou
canleverage.
Like
ErichStyger
onJune21,2013at14:42said:
HiTom,
yes,Ialreadyfoundthatlibrary,butitisGPL2as
well,sonotveryusableforanythingthantrue
hobbyprojects.
Anyway,Ihaveorderedahandfulofmodules,and
wheneverIfindtime,IllstartwritingaBSDstyle
driver.Contributionsarealwayswelcome
Erich
Like
AlexVecchio
onJune22,2013at04:23said:
Maybeyoucanusethisforanything.
https://code.google.com/p/nrf24l01/
Istarttodiganyreferencefor24L01andBSD.
Like
ErichStyger
onJune22,2013at08:51said:
HiAlex,
thanksforthelink.Goodinformation.
Like
AlexVecchio
onJune23,2013at02:51said:
Ithinkthiscanbeusefultoo.
http://nrqm.ca/nrf24l01/
Like
ErichStyger
onJune23,2013at06:10said:
HiAlex,
yes,thisoneisaboutwhatIwaslookingfor,
thanks!
Like
Dusty
onJune20,2013at01:53said:
HiErich
Igotsomeexperiencewithoneofthesemodulesonaproject.I
thinktheyareallmoreorlessthesame,butforthefirmware(as
youpointout).ThecircuitisaCSRreferencedesign.TheCSR
chipisbasedaroundacorearchitecturedevelopedatCambridge
university.Youcangetthedevelopmenttoolsfromtheirwebsite
(easytofind),anddevelopyourownfirmwareforthemodule.I
nevergotsofarastodownloadallthat,notsureaboutwhatthe
costisetc.Iwouldguessthereisareferencedesignforthe
firmwareaswell,whichiswhatallofthesedifferentfirmware
versionswouldbebasedupon.
Like
ErichStyger
onJune20,2013at05:52said:
HiDusty,
yes,IhavefoundthearticlefromByron
(http://byron76.blogspot.ch/2011/09/hc05firmware.html)
whichpointstotheCSRsite.Ihaveregisteredand
downloadedthetools,butnotdonemuchwithit.Ididnot
knowthatthishasbeendevelopedatCambridge,which
isinteresting.
Like
SurdeanuMihai
onJuly3,2013at10:26said:
Hi,Erich!
Youhavedoneaverygoodjobbycreatingacomponentlikethis.
Twoweeksago,IhaveboughtaBC04bluetoothmodulefrom
ElectroDragon(whichisalittlebitdifferentfromHC05orHC06
asfirmware)andthisthinginvolved,forme,somechangesinto
yourcomponentsourcecode.
Afterimplementingallchanges,IwouldliketoaddanewBC04
firmwareto
Bluetooth_EBGTcomponentproject.Theproblemwiththatis
causedbythefactthatIcannotimportverywellyourproject,
becausewhenItrytoeditthesourcecodeofamethodIgetthe
followingerror:SourceCodemissingindefaultdriver.Itcould
bepresentinaprg..
Anyhelpwouldbegreatlyappreciated.
Thankyou.
Like
ErichStyger
onJuly3,2013at10:40said:
HiSurdeanu,
IdontthinkIhaveseenthaterrormyself,sonotsure
whatiscausingthis?Maybeyoucouldemailmeyour
changes/sourcecodeandImhappytohaveit
incorporatedintotheProcessorExpertcomponent.Send
ittotheemailIhavelistedattheendoftheAboutpage
ofthisblog.
Thanksforcontributingtothatproject!
Like
SurdeanuMihai
onJuly3,2013at10:49said:
Ok.Then,IthinkthatIwillsendittomorrow,
becausetodayIwanttodosomeothertests.
Haveaniceday.
Like
Pingback:YetanotherBluetoothFirmware:BC04|MCUon
Eclipse
Pingback:Tutorial:UltraLowCost2.4GHzWirelessTransceiver
withtheFRDMBoard|MCUonEclipse
Pingback:MiniSumoRobotCompetitionrunningwithFRDM
KL25Z|MCUonEclipse
jamejon
onSeptember9,2013at00:12said:
hicanupleasegivemeahelponaEclipsecodetocontrol
Bluetoothmodule
Like
ErichStyger
onSeptember9,2013at06:07said:
havealookattheexamplehere:
https://github.com/ErichStyger/mcuoneclipse/tree/master/
Examples/FRDMKL25Z/Freedom_Blue
Like
Pingback:ZumoRobotChassisPCBarrived!|MCUonEclipse
tom
onOctober2,2013at10:32said:
HiErich,
thxalotforshowingthedifferencesbetweenHC05andHC06
module!
IhappenedtogetmyHC06workwithaTrustUSBBTdongle
andWinXP32.
JustshortcuttheTx/RxonthemoduleandusedComportToolkit
asaterminaltoseetheloopedbackchars.
Iflongerblocksofdataaresentthedelaydecreasesto
somewhat90msecs.Butthatsallforthegoodnews.
TheHC06doesnotestablishworkingmode(steadyLED)when
IusemylenovoT500withwin764.Icanconnectthedevice,
sendpairingpinandtwosuccessiveCOMxyportsareshownin
devicemanager.ButthefirstwheretheSPPisassignedtocan
notbeaccessedbymyterminalprogramsandtheLEDonthe
HC06keepsflashingindicatingATmode
SamesituationwithmyGalaxyS2GTi9100,itfindsit,pairing
pininputbutHC06staysinATmode.
Hasanyoneanideaorsolutionaboutthat???
Allthebest,Tom.
Like
ErichStyger
onOctober2,2013at10:36said:
HiTom,
Ihadsomeproblemswithanothernotebook,whereIwas
notabletoestablishconnection:hereithelpedtore
installthedriversonthenotebookasexplainedinthe
article.
OnanothernotebookIusedacheapbluetoothdongle
(underWindows764bit).Inevergotitworkingtoconnect
tothebluetoothmodule,whileitworkedonanother
machinewithXP.
SoIjustmaketheguessthattheremightbeasimilar
probleminyourcase,butwiththeinternalbluetooth
module?Itmightbeworthwiletotryanexternalbluetooth
module?
Like
Tom
onOctober7,2013at10:31said:
HiErich,
Thanksforyourcomments.
WithAndroidIvegotitwork.Afterinputtingthe
pairingsequenceonthephonetheHC06staysin
ATmodebutifmyapprunsitconnectsand
switchestoSPPmode
Illtrytoreinstallthewin7BTdriversandsee
whatwillhappen
Goodluck,Tom.
Like
ErichStyger
onOctober7,2013at20:17said:
Hmm,yes,thisistrueonWindowstoo:onlyifI
connecttotheCOMportwithmyterminal,it
changesfromATtotransparentmode.IthoughtI
hadmentionedthis,butprobablynotbold
enough..
Sohereagain:theconnectiononlyhappensif
actuallyconnectedonthehosttothevirtualCOM
Port
Like
tom
onOctober8,2013at12:42said:
yepp,
Butwithmywin764IseebothvirtualCOMports
createdbytheBTinthedevicemanagerbutcan
notaccessthelowernumberedonewithany
terminalprogram
ThisworkswithXP32.
Like
ErichStyger
onOctober8,2013at12:51said:
Yes,Ihavethesame:oneoftheportsisdead,
notsurewhy.Butworksontheotherone.
Like
Pingback:ZumoRobotassembled|MCUonEclipse
tharindulakshantha
onOctober31,2013at16:22said:
heycanyoutellmecanwepair2hc06moduleatthesametime
.???
Like
ErichStyger
onOctober31,2013at17:01said:
youmeantohaveaconnectionfromthehostPCtotwo
modulesthesametime?yes.
TopairtwoHC06modulestoeachother:no.
Like
DIEGOEDUARDOLOPEZRUBIO
onDecember4,2013at22:58said:
IhaveaproblemwhenIcompilethefilebth1.hgivesmeanerror
online331:byteBT1_ParseCommand(constunsignedchar*
cmd,bool*handled,CLS1_StdIOTypeconst*io)
Like
ErichStyger
onDecember5,2013at18:34said:
HiDiego,
whatkindoferrormessagedoyouget?Itriedagainmy
exampleonGitHubanditworksfineforme.Haveyou
loadedthelatestProcessorExpertcomponentsfrom
GitHubtoo?Itlookslikeitisanissuewiththeshell,and
maybeyouareusinganolderversionofthe
code/components?
Erich
Like
DIEGOEDUARDOLOPEZRUBIO
onDecember8,2013at06:21said:
fixtheerror,Iwantedtoaskyouforhelpwiththe
commandlineinterface,asyoudotogetthe
settings?becauseitrecognizestheportbutwhen
writingATcommandsnothinghappens.Ifyou
couldhelpmeorpassmeyourmail.Thanksin
advance.
Like
ErichStyger
onDecember8,2013at16:12said:
IfnothinghappensifyouwriteATcommands,
thistypicallymeansthattheBluetoothmodule
alreadyhasbeenconnectedtothePChost.Ifthe
moduleisconnected,thentheLEDison
(comparedtobeinblinkingmodeifnotpaired,
whereitacceptsATcommands).Anotherreason
fortheATcommandsnotworkingisawrong
UARTbaudconfiguration.Bydefaultthemodules
operatewith9600baud.Pleaseverifywithalogic
analyzerifthatbaudisused.Ihopethishelps?
Like
nikhilgupta
onDecember12,2013at09:21said:
HI
iampresentlyworkingonaprojectthatrequiresmicrocontroller
tomicrocontrollerwirelesscommunication.iwaswonderingifwe
coulddothisusing2BLUETOOTHhc06orhc05,bysimply
interfacing1ofthemoduleswiththetransmittingmicrocontroller
andinterfacingthesecondwiththereceivingmicrocontroller.
ihavebeenabletopairmyHC06modulewithlaptopandmobile.
wheniusealaptopon1endisimplyhaveanoptiontoenterthe
pairingcodeintomylaptopbutwhileworkingwith2bluetooth
modulestheproblemiamfacingishowdoienterthepairing
code.
Like
ErichStyger
onDecember12,2013at18:13said:
Hi,
theHC06onlycanbeslave,soyoucannotconnecttwo
HC06witheachother.Itshouldbepossibletoconnecta
HC06withaHC05inmastermode,butIhavenottried
thisyet.
Like
Paulius
onDecember12,2013at11:11said:
Hello,
IhaveHC06,andIneedtochangedatabits8to7(requiredfor
myapplication).Icantfindanyinfoaboutsettingdatabits.
Maybeyouknowsomethingaboutthat..isitpossible?
Like
ErichStyger
onDecember12,2013at18:15said:
Yes,somemicrocontrollerscanconfiguretheUARTto
differentthan8bits(e.g.to7bits).
TomyknowledgethisisnotpossiblewithKinetis.ButI
havenotcheckeddeeplyonthis.
Like
DIEGOEDUARDOLOPEZRUBIO
onDecember15,2013at03:16said:
hello,heywhenIruntheprogramtheterminalgivesmethis
MyProjectName
CLS1GroupofCLS1commands
help|statusPrintstatusinformationorhelp
CMD>
ATwritethecodesandnothinghappens
Like
ErichStyger
onDecember15,2013at09:54said:
HiDiego,
areyouusingmyexamplefromGitHub?Fromtheshell
outputitlookslikeyouhavenotaddedthecommandline
interfacetotheBluetoothmodule,asitdoesnotshowup
withhelp.BeawarethatiftheHC06LEDisnotblinking,
themodulealreadyconnectedtoahost,anditdoesnot
acceptanyATcommands(theATcommandsaresentto
thehost).
Like
logicchild
onJanuary13,2014at11:16said:
Hi,
Thatwasgreat,butIhaveaquestion,CanmyPCconnectto
morethanonemodule.
IwanttocreateanappinthePCthatmonitormanybluetooth
modulesatthesametime.
Isthatpossible?
Thanks
Like
ErichStyger
onJanuary13,2014at11:22said:
Hi,
yes,youcanconnecttomanymoduleswithyourPC.
TheywillshowupwithdifferentCOMports.
Like
Wastekinggarbagedisposalwarranty
onJanuary18,2014at04:03said:
IllimmediatelysnatchyourrssfeedasIcannottofindyoure
mail
subscriptionhyperlinkorenewsletterservice.Doyouve
any?KindlyletmerecognizeinorderthatIcouldsubscribe.
Thanks.
Like
ErichStyger
onJanuary18,2014at07:54said:
ItistheFollowbuttonbelowtheRSSfeedlinkonthe
rightsideofthepage.
Like
Jami
onFebruary2,2014at16:14said:
HiErich,
Thanksforsharingtheresultwithsuchgreatdetail.
ImplanningtousethisbluetoothmodulewithArduinoProMini
3.3Vmodelinthiscase,thelogiclevelwouldbeneedless,
right?
Bestreagards,
Jami
Like
ErichStyger
onFebruary2,2014at18:46said:
HiJami,
yes,themoduleoperateswith3.3Vlogiclevels.Youjust
needtobecarefulaboutthesupplyvoltage.Mymodules
say3.6V6V,butIwasabletousethemwith3.3V
withoutproblems.Thatmightdependonthemodule.
Erich
Like
Jami
onFebruary3,2014at00:20said:
HiErich,
Thanksforthereply.
IstillhaventgotHC06butquicklytestedanHC
05(alsomarkedwith3.6V6V)withtheArduino.
Theybotharewellintegrated.
Jami
Like
Alan
onFebruary7,2014at23:05said:
Excellentsite,thanks,lotsofgoodinfo,
Iwonderifyoucanassistwithmylittlechallenge?
Myprojectistoprovideawirelessconnectionbetweenaracing
yachtsNavcomputer(aB&GHerculesPerformanceUnit)and
myAndroidphoneusingmyHT06(Ver1.06).
Tobuildupsomeexpertise,Impracticingathomebytryingto
gettheconnectiongoingbyconnectingtheHT06tomyGarmin
GPS72handheldGPSreceiver.ImbluetoothingtotheHT06
withmylaptopandacheapUSBdongleusingagoodterminal
emulator(Reflection).
WhenconnectingtheGPS72tothelaptopwithacable,itcomes
inonUSBatCOM04andmyterminalemulatorhappilytalkstoit
at48008/None.
However,whentryingtogetthelaptoptotalktotheGPS72with
theHT05,Igettheconnectionupandrunning(solidled)andIm
receivingdatafromtheGPS72,butontheterminalseethe
pulsesofdata,butinsteadofgettinginterpretabledata,thereare
stringsof,like~f~~
IknowitsbecauseIhaveanincompatibilityincommsprotocols
andhavetweakedtheterminalthroughspeedsandparitywithno
joy.
IsuspectIhavetoconfiguretheHT06touse48008/N,butnot
havingtheconnectorstoconnectthelaptoptotheHT05Imnot
abletotweakthecomsspeedsfromthelaptop,soImwondering
ifitisatallpossibletosendATcommandsfromthelaptoptothe
HT06overBT?
Like
ErichStyger
onFebruary8,2014at10:12said:
HiAlan,
thanksforyourkindwords
Asforyourquestion:youcannotsendATcommands
overtheairtotheBluetoothmodule:ifitisconnected,it
isintransparentmodeandwillsendtheincomingdatato
theotherside(soyoucannotreachtheBluetooth
controllerwithATcommands).
Asfortheprotocolerrors:canyouhookupalogic
analyzerontheserialsignalstoseewhatisgoingon?
Thatwouldgiveaclueifthebaudissomewhatwrongor
outsidethespec,ifparity/etcisused.
Like
Alan
onFebruary9,2014at01:33said:
Andthanksforyourpromptreply.ItsasIfeared.
Odd,eh,thattheydesignaslavemodule
presumablytoconnecttoadumbdevice,that
cantbeconfiguredbythemaster.
Onemorequestion,ifImay.WhenIdogettoset
thecommsprotocolwithanATcommand,say
AT+BAUD3,doesthatsettingpersistovera
powerreset?i.e.canIsetitinthelab,andthen
relyonitinthefield?
Like
ErichStyger
onFebruary9,2014at07:42said:
Yes,thesettingspersistinthedevice.
Like
Alan
onFebruary14,2014at04:30said:
HiErich,
Backagain,sorry.
IsuspectIhaveafaultydevice(HC06Ver1.06),andbeinga
softwareguy,aclassworldrenownedforunfairlyblamingthe
hardware,Ihavetriedtobethoroughinmytesting.
ThefinalclincherformeisthatwhenIsendATcommandsover
theserialportIgetnoresponseatall.
IhaveabreakoutboardontheseriallineandcanseetheRXline
flashitsled.
TheHC06isflashing.
Iamusing232Analyzertosenddata96008N1andamsending
AT.
IhavereadtheHCSerialBluetoothProductsUserInstructional
Manual,http://www.exptech.de/service/datasheet/HCSerial
BluetoothProducts.pdfwhichseemsquitestraightforwardifa
littleconfusing.
AndImstillreceivingcorruptdataoverthebluetoothconnection
whensendingASCIIat96008N1.
BeforeIsendoffforareplacement,isthereanythingelsethat
youknowthatIcantrytotalktomybaby?
Cheers,andthanksforyourpatience.
Like
ErichStyger
onFebruary14,2014at05:46said:
IftheHC06isflashing,thenitisnotconnectedtothe
PC.YoureallywouldneedalogicanalyzerliketheSalae
onesoyoucaninspectthebitsandbytesontheline.
Maybesomethingiswronglyconfiguredonyourside
(baud?),andonlywithflashingLEDsyouwillnotseeit.
Imasoftwareguytoo,butdevelopingsoftwarefor
hardwaremeansascopeandalogicanalyzeriskey.
Withoutit,itislikeprogrammingwithoutaPCmonitor
Like
LymanAlanConnor
onFebruary19,2014at00:38said:
Imanovicewiththeseboardsaswellbutit
appearsthatyouretryingtosendATcommands
andthechipisnotinthatmode.Myboardhada
pinlabeledKEY.TiethatpintotheVCCsource,
Nowdisruptandreestablishthepowertothe
HC06leavingtheKeytiedtopower.Theunit
willrebootinATmode.ToresettoNormalmode
removeKEYfromVccanddisruptandre
establishpower.Iwasalsoabletoeasilypair
withthisdeviceusing1234asthecode.Once
thatwasdoneIopenedupTeraTermProand
selectedthecommportconfiguredformyBT.I
wastalkingtoaMiniProquitequicklyHopethis
helps
Like
RemiWielandts
onMarch12,2014at08:32said:
HelloErich,
IamusinganHC05board(foundoneBay
http://www.ebay.com/itm/150843209961?
ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649).
IamtryingtoconfigureitusingtheATcommands.Thiscanonly
bedoneusingthephysicalserialconnectiontothePC,isthat
correct?IbelieveImanagedtogettheboardintoconfiguration
modeusingtheKEYpin,sincetheLEDnowblinksdifferently.
However,whenIuseTermitetosendATcommands(simplywith
AT\r\n),theboardresponseswiththingssuchas:x,thenxr\n,
thenAp\p,etceverytimeIresendtheATcommand.Iguessit
couldbesomeproblemwiththecodingofthecommandssuch
aswrongfontButstillIdontunderstandwhyitresponds
differentlytoauniquecommand.
Canyouhelp?Thankyouinadvance!
Remi
Like
ErichStyger
onMarch12,2014at10:50said:
HiRemi,
thisdoesnotsoundlikeafontproblem.Canyouhookup
alogicanalyzertoseewhatthemodulereallyresponds?
ItverywellcouldbethatthismoduleisnotaHC05one,
butadifferentonewithdifferentfirmware?
Erich
Like
Alan
onMarch12,2014at11:34said:
IhaveconcludedthattheHC06devicedoesnot
conformtoRS232standards.
Ihavespent6weeksmessingwithit(well,2
separatelypurchasedboards)connectedtomy
PC(XPandW7)usingsomeprettyclever
terminalemulators(realTerm,Commfront
232Analyser,Reflection)andIhaveconcluded
thatitdoesntgeneratethe10bitpercharacter
(start,8bitdata,stop)syntaxdefinedbyRS232.
IwasunabletogetittorespondtoanAT
command,norcouldIgetittotransmittextatits
defaultspeedof9600,N8,1oranyother
combination.
Allthefolkssuccessfullyusingitareusing
Arduino.Ihaventfoundanyoneusingit
successfullyinconventionalRS232PCmode.
Ihavethrownthemawayandspent$125onan
olderbutfunctionalRS232toBluetothadapter.
Itsprettyclunky,requiringaPCUtilityto
configureit,butitworks!
Like
RemiWielandts
onMarch17,2014at15:48said:
HiErich,
Thanksforthereply.Idonthavealogicanalyzer.
IhavetestedsomewhatfurtherandIhave
noticedthatusingTermite,whenIchangethe
baudratetoalowervalue,Igetaresponse
identicaltowhatIsendtothedevice.IfIputa
higherbaudrate,Istartgettingallthis
nonsenseAlso,IshouldmentionthatIdont
haveaserialconnectiononmycomputer,soI
makeuseofaRS232toUSBconverterfrom
Logilink.SothebaudratewhichIchangeis
probablythebaudbetweenthePCandthe
converter.
Like
ErichStyger
onMarch18,2014at14:51said:
HiRemi,
yes,thebaudisonlyappliedtothephysicalserial
line,notfortheUSBcommunication.foraUSB
CDCconnectionthebaudisprettymuchuseless.
Like
RemiWielandts
onMarch17,2014at16:16said:
JustreadAllanandTomscomments.IfI
understandit,IshouldhaveaRS232toTTL
converterbetweenmyUSBtoRS232converter
andtheHC05modulebecausetheHC05talks
inTTLandnotRS232?
Like
ErichStyger
onMarch18,2014at14:54said:
HiRemi,
TheHC05moduledoesnotuseTTL(05V)
levels,but03.3V.RS232usescompletely
differentvoltagelevels(3to15Vand3to15V,
seehttp://en.wikipedia.org/wiki/RS232),sothey
arenotcompatible.YourPCorRS232USB
converterexpectsthatdifferentvoltage,soifyou
wanttoconnectthebluetoothmoduletoyourPC,
thenyouneedtousealevelshifterlikeaMaxim
3232orsimilar.Thelogiclevelsof03.3Vofthe
moduleareonlytobeusedwithsomethingwhich
hasthesamevoltagelevels,e.g.a
microcontroller.
Like
RemiWielandts
onMarch18,2014at15:18said:
HiErich,thanksfortheanswers.Thedaughter
boardwhichIboughtwiththeHC05module
mountedonithassuchaMAX3232levelshifter
(seeebaylinkabove).
IknowthatIwasabletoswitchtheboardintoAT
mode,atleastfromthedifferentblinkingofthe
LED.Itriedusingdifferentbaudratesforthe
serialcommunicationtothebluetoothmodule,no
success.ImadesuretheTXandRXarecorrect,
useddifferentvoltagelevels(5.0and3.3volts)for
boththeVccandtheKey.Itriedtoresetthe
deviceusingAT+RESETincasethe
transmissiontothedevicewasfunctioning
correctlybutnotthereceptionfromit.Ihave
bought3ofthesedevicesandtestedall,they
givethesameresults.
Iamrunningoutofideas
Btw,whatisthetinypushbuttononthedaughter
boardsfor?
Like
ErichStyger
onMarch18,2014at18:10said:
Ihavenotusedthesemodules.Butitsoundsyou
havenothingthanthemodules?Nousermanual,
schematicsorsomethingyouabsolutelyneedto
understandthismodule.Icheckedthatebay
page,buttherewasnomoreinformationthanthe
pictures.Youevencannotbesurewhatkindof
firmwareisonthemodulewithoutthis
information.Andwithouttherighttools(akalogic
analyzer)itislikefishinginthedark
Like
ErichStyger
onMarch18,2014at18:14said:
Oh,Isee,there*is*indeedadatasheet
.What
theKeydoesdependsonthefirmwareonthe
module.Manyfirmwareareusingittogetback
intothecommandmode.Butnotcleartome
whichfirmwarereallyisonthismodule.
Like
ErichStyger
onMarch18,2014at18:15said:
AndIhavefoundinthedescriptionwhatkeyis
supposedtodo.Keyconnects3.3.VtoPIO11:
3.PIO11,controlthemoduleworkingmode,
High=ATcommandsreceivingmode(Commands
responsemode),Low
orNC=Bluetoothmodulenormallyworking.
Like
Alan
onMarch27,2014at00:48said:
HiRemi,
IcanconfirmthataMaxim3232workslikea
charmwiththeHC06toprovideaninterface
betweenaPCserialCOMportandtheHC06,
notwithstandingthediscrepancybetweentheTTL
andMCUvoltages,asithandlesthevoltage
rangeof3.3to5V.
IhavejusttakendeliveryofmyMaximboardand
amhappilybluetoothingbetweenmyPCandmy
Androidphone.
IhavealsoconnectedmyGarminGPS72,
configuredtoreportusingNMEAat4800tomy
Androidphonewiththisconfiguration.
Youdontneedalogicanalyser.
YoudohavetocrosstheTXDandRXDlines
betweentheHC06andtheMaxim.
Itstakenmealmosteightweekstoworkthisout,
butsuccesscomestothediligent!
Like
tom
onMarch12,2014at14:46said:
Alan,
Sorry,butyouaremissingbasicelectricalskillsandyoudidnot
rtfm.
TheHC05/6aswellasalltheotherBTmodulesfromother
suppliersprovidea3,3Vdigitallogicinterface.Theguysusingan
arduinowirethe3,3VTxD/RxDsignalsofthearduinoUARTto
thecorrespondingpinsontheHC05module,thearduino
providesavirtualCOMportviaUSBtotheconnectedPC/Laptop
sothereisnoRS232withinthatsignalwaytobeused.
YourPC(COM1:)hasastandardRS232interfacewhatis
electricallyonatotaldifferentplanet(usewikipediaandREAD
please)asthe3,3Vor5Vdigitallogicinterface.Oryouusean
USB>RS232convertercablebutthatsthesame
ThatswhyyoucouldnotmakeaworkingconnectionItisan
electricalproblem!
http://www.ebay.de/itm/RS232SerialPorttoTTLDigital
ConverterModuleSP3232EEN5V33VJump
Kables/400676853830?
pt=Wissenschaftliche_Ger%C3%A4te&hash=item5d4a339846
Usesomethinglikethatandeverythingshouldbefineo).
Goodluck,tom.
Like
Alan
onMarch12,2014at23:14said:
AHA!,atlastsomelightinthewilderness.
SillymeWhenIdidRTFM(extensively),thedoco
consistently(ifslightlyincoherently)referredtotheHC05
asaserialBTadapter,andfrommysoftware
background,serialMEANSRS232!
Nowheredidtheysaythattheheadersonthecardtalk
TTLnotRS232.Ihavediscussesmyproblem
extensivelyonforumsandemails,IknewIwasmakinga
simplemistake,butnoonewassmartenoughtospotmy
confusion.
Thetrapsforyoungplayerstryingtoreachacross
technologies!ThanksTom,somuchforyourclarification.
Like
dida
onMarch29,2014at13:30said:
hi..myprojectistosendthedatausingbluetoothmodule.isthat
possibleifiwanttoconnecthc05fromPIC1asatransmitter
andhc06asareceiveratPIC2?
Like
ErichStyger
onMarch29,2014at21:00said:
TheHC06Bluetoothmoduleonlycanbeaslave,butthe
HC05isabletobeamastertoo.SowiththeHC05as
master,youshouldbeabletoconnectfromtehHC06
module.Whatmicrocontroller(PIC,TI,Freescale,STM)
doesnotmatter
Like
HarveyHutama
onMarch30,2014at16:20said:
Hierich
Ihaveamodule(DAQModule)togetdatafromstraingagein
rotatingsensor.ThemoduleuseUSBcablecommunicationto
mycomputer(IthasFt232serialtoUsbICinitsdaughterboard).
Now,IwanttogetthedataviaBluetooth,andIalreadybought
HC05.Unfortunately,Becauseofthemodulearchitecture,I
cantgetitsrxtxtomyHC05.
IntheHC05datasheet,IseetheUSBDpandDmport,and
theysaiditcantransferdataviausbprotocol(v1.1).Afterthat,I
connectmymodulesUSBport(USBtypeB)totheDpandthe
Dmport,andIconnecttheVccandGndtomypowerbank.The
HC05isconnectedtomycomp,butitisconnectedtomySerial
ComovertheBluetooth,notasthemoduleitself.Andicant
connectthemoduletomyLabview(becausethemoduleisused
toconnectviaUSBcable)
Iwanttoaskseveralquestions:
CanIconnectHC05viaUSBProtocol,insteadofUART
SerialCommunication?
WhatshouldIdoifIwanttoconnectviaUSBprotocol?Install
anotherdriver(inwindowsdevicemanager)formyHC05,or
else?
Imsorryformylongpostandmyenglish.Hopetogetyour
responsesoon
Thankyou
Like
ErichStyger
onMarch30,2014at17:21said:
HiHarvey,
Tomyknowledge,onlytheSPIport
(http://byron76.blogspot.ch/2011/09/upgradeyour
bluetoothmodule.html)isactivefortheHC05module.I
dontthinkitisabletotalktheUSBprotocolunlessyou
haveadifferentfirmwareonit.Andifyourmodulewould
indeedhavethefirmwareforUSBonit:whichdevice
classwoulditimplement?Moreover,toconnectitto
USB,itwouldneedtheproperprotection/etcwhichIdo
notseeimplementedonthemodule?Somythinkingis
thatyoucannotconnectthemoduledirectlytoUSB:to
connectittoUSByouneedtohaveaSCItoUSB
converter.LikethatFT232orsimplyusetheFRDM
KL25ZboardwithanUSBfirmwaretoimplementaUSB
CDCbridge(http://mcuoneclipse.com/2012/10/07/tutorial
usbcdcwiththekl25zfreedomboard/).
Ihopethishelps?
Like
Pingback:GettingBluetoothWorkingwithJYMCUBT_BOARD
V1.06|MCUonEclipse
akselsmandel
onMarch30,2014at18:22said:
HiErich
Thankyouforyourkindnesstoanswerme.
Imsorry,maybemyexplanationaboutmymoduleisnotgood
enoughyet
MymoduleisEmant300.Itisusedtobeconnectedtocomputer
physicallywithusbcable,butactuallycommunicatewiththe
computerusingUART.SothatswhythereisconverterofUSB
TTL(FT232)inmymodule.
Youcanseeitinthislinkhttp://www.emant.com/251004.page
Ihavetriedtoconnectmymoduleviausbcable,anditwas
detected(untilnow,itis,aslongasiconnectitviausbcable).In
WindowsDeviceManager,itsnameisUSBserialport(toproof
itphysicallyconnectviausbcable,buttalkingwithserial
communication).ItconnectedtomyLabview,detectedasemant
300DAQmodule.
Butnow,IwanttochangeusbcablewithbluetoothHC05.Soi
cuttheusbcable,pinDpandDmtoHC05,andpoweritwith
powerbank.ButwhythebluetoothcantconnectasUSB
Protocol?
AboutSCItoUSBconverter,Iwilltrytolearnthat.Maybeitwill
providemeanotheralternatives.Thankyou,Erich
Like
ErichStyger
onMarch30,2014at19:03said:
AreyousayingthatyouconnectedDpandDmtothe
HC05Rx/Txpins?Thisforsuredoesnotwork:USBis
usingacompletelydifferentprotocolthanRS232/SCI.
Notonlythis,itisusingdifferentvoltagelevelstoo.
Like
akselsmandel
onMarch30,2014at19:31said:
No,Iamnot.IconnectedDpanddmtotheHC
05DpandDmpins,sinceithavethosepins.I
wanttocommunicateusbprotocolviabluetooth
butitdoesntwork
Maybethemanufacturermustdeleteitsspec
aboutcanuseusbprotocolv.1,1.Theydoes
nothavetheexplanationaboutthat(andmakeme
confused).HC05Usersininternetdonttalk
aboutthistoo,soitshardtofindanyclueabout
usbprotocoloverbluetoothonit.
Maybeilltrytoconverttheusbprotocoltoserial
protocol,asyousay,andafterthatconnectthat
serialtotheRx/TxpinatHC05
Thankyouverymuch,Erich
Like
radhakrishna
onApril21,2014at08:28said:
whathappenssupposebimistakegndconnectionisremovedor
missed..
Like
ErichStyger
onApril21,2014at08:41said:
ThenthemodulewillnotworkIsuppose.
Like
Pingback:ProcessingandArduinothroughBluetooth
Pingback:AndroidBasedWirelessECG
Pingback:SayyourArduinohowmuchyouloveit|
HELENTRONICA
Danrlei
onJuly16,2014at03:25said:
qualoCiutilizadonoModulobluetoothv1.05?
Like
ErichStyger
onJuly16,2014at06:12said:
CouldyouaskthatquestioninEnglish?
Like
Danrlei
onJuly22,2014at01:01said:
WhatistheCiUsedinModulev1.05Bluetooth?
Like
ErichStyger
onJuly22,2014at07:00said:
NotsurewhatyoumeanwiththatCi?
Like
john
onJuly24,2014at16:59said:
Hi,
SoIgottheHc06module,putitonabreadboard,poweredit
up,paireditwithmypc.ThenIusedTeratermtoopena
connectiontoit,whichitdid(theredlightstayedcontinuously
on),enteredinthecommandATbutIgotnoresponseback.
AmIdoingsomethingwrong?
Like
ErichStyger
onJuly24,2014at19:13said:
HiJohn,
youonlycansendATcommandsfromthemicrocontroller
connectedtotheHC06module,notovertheair.
OncetheLEDofthemoduleison,itisintransparent
mode,meansitissendingthetextovertheairasis,
andthemoduledoes*not*acceptanycommands.
Like
john
onJuly24,2014at21:38said:
Ahok,sotheonlywayIwouldbeabletoseedata
onteraterm/hyperterminalwouldbetoconnectthe
HC06toamicro,thenhavethemicrosenddata
outtotheHC06whichwouldtransmitthattothe
pairedpcwhichcouldbeviewedon
Teraterm,wouldthatbecorrect?
Like
ErichStyger
onJuly25,2014at05:46said:
Yes,correct.
Like
john
onJuly25,2014at15:26said:
Cool,thanks.IthinkIhavea8051microaround
somewhere,anyoneknowwhereIgetsome
examplecodethatIcouldloadontothemicrothat
IcouldsendtotheHC06
Like
AmeyaTipnis
onJuly30,2014at16:52said:
HiErich,
Agreatandinterestingarticleonthebluetoothmodules..!!AndI
mustsay,yourcommentssectionisfulloflostofadditional
info..!!IwouldliketoaskhelpformysmallproblemwiththeHC
06module,whichseemssimilartoTom.
ImonVistawiththedefaultbluetoothstack/drivers.Ihavea
cheapbluetoothdongleadapterasmylaptopdoesnthavenative
BThardware.Ihavefollowedthenumerousproceduresfor
paringpoweruppowercycleunplugreplugdeviceetcetc,but
noneseemtogetthehc06toconnectwithmyPC.
ThecomputerseestheBTdevicefine,itseeminglypairs.
Atleastthewindowsdialogboxshowsthatanddevicedrivers
areinstalled.Icanalsoseethecomportsindeviceproperties
andindevicemanager.ButthestatusLEDonthemodulekeeps
blinkingindicatingATmodeandnevergoessolidon.
TheserialportshowsupintheservicestaboftheBTdevice
properties,butwhenItrytoconnecttotheserialportinany
terminalemulator(Itriedafewofthemtobesure),iteitherstops
respondingortellsportnotfoundorclosedetc.Checkingthe
servicestabagainafterwardsconfirmsthis(theserialporthas
disappearedfromthelistmomentarily).IfIunpair/repair/power
cyclethemodule,samethinghappensoveragain.
Theredoesntseemtobeanythingwrongwiththemoduleitself,
asIcanpairitwith2separatesmartphones.Everythingworks
correctlyasIcanseeserialdatacominginfromthe
microcontroller,andalsoissuecommandstothemicrocontroller
overBT.
Thanksinadvanceforyourhelp.
Kindregards,
Ameya.
Like
ErichStyger
onJuly30,2014at19:11said:
HiAmeya,
thanksforyourkindwords
Aboutyourproblem:justinstallingthedriversonthehost
willnotchangetheblinkingLED.TheblinkingLEDonly
getspermanentlyononceyouhaveaconnectiontothe
modulewithaterminalprogram.Thefactthatyour
terminalemulatorstopsrespondingindicatestomethat
youmightbeusingthewrongCOMport?AtleastIhave
thesameonmymachine(whichhasanativeBT
module).PayattentionthattherearemultipleUSBCOM
portsinstalledbythedriver,butonlyoneworks(theone
whichislistedinthepropertiesofthedevicedriver,
http://mcuoneclipse.files.wordpress.com/2013/06/device
services.png?w=584).Socanyoumakesureyou
connecttotheproperCOMportwithyourterminal
program?
Ihopethishelps.
Like
AmeyaTipnis
onAugust4,2014at11:35said:
HelloErich,
Thanksforyourprompthelp..!!IamsureIam
usingthecorrectportintheterminalemulator.
TheHC06enumerateswith2ports,onlyoneis
availableinSPPmodeandthatstheoneIuseto
connect.HereissomemoresurprisingbehaviorI
cameacross.
1.Firstly,sometimesIamabletosuccessfully
connectandsendreceivedata..!!
2.Butthenmajorityofthetimes,itrefusesto
connectafterparing.Whenthathappens,LEDis
blinking,terminalemulatorreportsportclosedor
stopsresponding,andSPPdevicedisappears
fromtheBluetoothdeviceproperties.
3.Ithenhavetoremovedevice,powercycleHC
06module,repairandtrytoreconnectagain.But
90%ofthetimesitneverworks.Ijustgetplain
luckytheremaining10%times,andproceedwith
myactualwork.
4.ImaygetgoingagainafterarestartofthePC,
butthatalsoisnotconsistent.YesterdayItried
installingotherBTdriversPCside,butofnouse.
5.Also,allthesetimesIkeepcheckingthe
modulefunctionalityperiodically,bysuccessfully
pairingandconnectingwithanandroidsmart
phone,whichworksasexpected.
IstronglyfeelitsthePCsideBTstackwhichis
messingthingsup.Canyousuggestsomething
here..??
Kindregards,
Ameya.
Like
ErichStyger
onAugust4,2014at20:27said:
HiAmeya,
yes,thiscouldbeaPCBTstackissuetoo.You
mighttrytouninstallthedevicedriverforitinthe
devicemanager,maybethishelps.Butnotsure.
Erich
Like
BenKuper
onFebruary12,2015at14:01said:
Hi,
thankyouforthisarticle!
IhavethesameproblemasAmeya,icanpairtheHC06
tomycomputer(Windows8.1x64,QualcommAtheros
AR3012Bluetoothmodule),icanseetheSPPprofileat
first,butitdoesntgettoconnectwithanysoftware,and
whenitriedoncetoconnect,theSPPprofiledisappear
fromthelistofservices
Didyoufindasolution?
Thanks
Ben
Like
ErichStyger
onFebruary12,2015at14:03said:
HiBen,
ImusingWindows764bit,soImnotsureifthis
isaWindows8.xissue?Icantellthatonmy
machineitshowstwodifferentCOMports,but
onlyoneisworking.UsingtheotherCOMport
fails.MaybeyouhavetwoCOMportslistedtoo
andyouareusingthewrongone?Justaguess.
Like
BenKuper
onFebruary12,2015at14:22said:
Hi,
itmaybeaWin8.xissueyes..
ImusedtodealwithBTVirtualserialportson
windows(withotherchips,notLowEnergy),i
knowaboutthe2COMportscreationandthat
onlyoneisok.
Thisisreallystrangebecausetheserviceisthere
atfirstandthen,poof!nothinglistedanymore
Onasmartphone,thisworksjustfine.
Like
RemiWielandts
onAugust5,2014at09:34said:
HelloErich,
IhaveboughtanHC05mountedonadaughterboardthatallows
metocommunicateinRS232withthemoduleinsteadofTTL(it
hastheMAX3232chip).
IusethemoduletocommunicatebetweenaPCandamotion
controller(Elmo)inRS232.Iwasabletochangethe
communicationparameterstosuitme(baudrate,flowcontrol
andparity).Iwasabletoestablishaconnectionwiththe
controllerthroughthesoftwarethatwasdeliveredwithit.
OnlyInoticedthattheconnectionisveryunstable:Iameither
unabletoestablishaconnectionatthefirstattemptorthe
connectiondropsafterbetween5and60seconds.Idecidedto
analyzethecommunicationbetweenthePCandthecontrollerby
usingTermite.IlookatwhatistransmittedbythePCwhena
connectionisattemptedandwhatthecontrollerresponds.
Inoticedthattheconnectionfailsordropswhenthecontrollers
responsecontainserrors.Thesearesortsoftyposinthe
answersfromthecontroller.Doyouthinkthiscouldcomefrom
themodule?Ordoesitlookmorelikenoise,orabadconnection
toearthlevel?Anyideas?
Thanks!
Like
ErichStyger
onAugust5,2014at10:12said:
HiRemi,
Iwouldfirstverifythepowerconnectiontothemodule.Is
itwithinspecs?5V?Then:maybetheUARTconnection
fromthemicrocontrolleistheproblem:ifyourclockis
drifting,ornotstableenough,youwillgetgarbageonthe
serialline.youwouldneedtocheckthiswithascopeor
logicanalyzer.Andyoumightneedtousealowerbaud
rate(Iuseallmymoduleswiththedefaultbaudrateof
9600or38400(dependsonmodule)).
Like
RemiWielandts
onAugust5,2014at11:02said:
HiErich,
IuseaUSBportforthe5Vsupply,justfor
convenience.Maybethisisnotthebestthingto
do.IwillhaveatrywithmyDCcontrolledpower
supplyinstead.
Idonothavealogicanalyzeravailablebutwill
lookforoneincasethisdoesnotfixtheproblem.
Also,Ihadthemodulesettoabaudrateof
115200sincethisisthedefaultbaudofthe
controller.Ihavenowlowereditbackto9600and
atfirstsight,theconnectionlooksmorestable
thanbefore.Itwillneedsomemoretestingbutit
looksbetteralready!
Thanksalot!
Like
Ramiro
onSeptember27,2014at03:16said:
canihave2livebluetoothdevicesconnectedwiththeHC05/06
atthesametime?
Like
ErichStyger
onSeptember27,2014at08:17said:
No,youonlycanhaveoneconnectionatatime.
Like
Pingback:InterfacingAndroidWithMicrocontroller|AdhityaReza
Pingback:1000DaysofBlogging:NumbersandTipsforYou|
MCUonEclipse
user
onNovember9,2014at18:33said:
Hi.IhavehugeproblemwithHC06.Ichangedname,pinand
baudratewithATcommandsbutthenthemoduleisnot
workingItdoesntrespondtoanyATcommandsandwhenI
amconnectedtomodulewith..forexample..androiddeviceandI
trytosendsomeATcommandsItdoesntreadany
characters.Please..helpme
thanks
Like
ErichStyger
onNovember9,2014at18:38said:
Youneedtouseamicrocontrollerboard(liketheFRDM
KL25ZIused)toregainaccesstothemodule.
Usethesamebaudasyouhavespecified.Ifthatdoes
notwork,itcouldbethatthebaudsettingsareincorrect:
trywiththemicrocontrolleralldefinedbaudratesofthe
module,andusealogicanalyzertoinspecttheresult.
Thenyoushouldbeabletorecoverthemodule.
goodluck!
Like
user
onNovember10,2014at15:32said:
Thanksforreply.Pleasecanyoumakesome
tutorial?IhavejustArduinoMegaIdonthave
logicanalyzerIambeginnerinprogramming.
Please
Like
ErichStyger
onNovember10,2014at17:48said:
Imaffraid,thatwithoutalogicanalyzer,youwill
notbeabletogofarinyourdevelopmentand
programming.
Alogicanalyzerisasimportantasyourscreen
forprogramming:withoutit,youcannotseewhat
isgoingon.
Iwroteatutorialhowyoucouldbuildyourown
logicanalyzer:
http://mcuoneclipse.com/2013/02/03/turningthe
freedomboardintoalogicanalyzer/
Like
user
onNovember12,2014at13:29said:
Ok,thanks
IorderedalogicanalyzerBut
whatarethestepsinrepairingmyBT?
Like
ErichStyger
onNovember12,2014at22:19said:
Youneedsoinspectthesignalsyousendonthe
TxlineandwhatyoureceiveontheRxline.I
hopeyoulogicanalyzerhasanserial/RS232
protocolinterpreter?
Like
AmalSyriac
onDecember4,2014at11:49said:
hiErich
canyouprovidecodingforsentingsignalviabluetoothmodule
fromadriunotoantroidphone.inputcanbesignalfroma
pushbutton.likenotificationinphoneweneverthebuttonis
pushed.
Like
ErichStyger
onDecember4,2014at17:31said:
Hi,thereisreallynomagicbehinddoingsomethinglike
this:
a)checkthatbuttonispressed(severalwaystodothis)
b)sendamessage/string/commandtotheUARTtothe
Bluetoothmodule
c)thatmessage/string/commandwillenduponthe
Androidphoneconnectedtothebluetoothmodule
d)itisuptoyouwhatyoudowiththismessageonthe
Androidside.
Ihopethishelps,
Erich
Like
Ct
onJanuary18,2015at23:00said:
Haveyoutriedworkingwithitatabaudrateof1382400?
Like
ErichStyger
onJanuary19,2015at08:05said:
No,Ihavenot.Actuallythismightbeverydangerousas
ifyousetittothatmode,youmightnotbeabletore
configureitfromaPChostmachine.
Like
AbdallahBarhoom
onMarch27,2015at23:35said:
HiErich
IwanttoconnecttwoBluetoothmodulesHC05:onewitha
microprocessor(IwilluseraspberryPiB+)andtheotherwitha
suitablemicrocontrollerthatwillcontrolarelayfor220vdevices
1.Whatisthemicrocontrollerthatyourecommenditforthis
job??
2.Isthisprocesspossibleandeasyfor100(ormore)slavesand
onemaster??
3.OnwhatversionistheHC05BluetoothModulework??
Bestwishes,andthanksalot
AbdallahBarhoom
Palestine
Like
ErichStyger
onMarch28,2015at08:25said:
HiAbdallah,
1.Youcanuseprettymuchanymicrocontrollerwhich
hasaSCI/UART.ImusingtheFreescaleKinetisKL
familyformostofmyprojects,liketheoneinthispost
(FRDMKL25Z).
2.Ihavenotusedsuchaconfiguration,butforsurethe
masterwillbelimitedinthenumberofconnectionsitcan
maintain.Ithink100isfartoomuch.Probablyyoucan
haveonlyupto8connections.Thismightbespecifiedin
theBluetoothstandard.
3.Notsureaboutthisquestion?Ihavenotusedthe
HC05inmastermode.
Ihopethishelps,
Erich
Like
AbdallahBarhoom
onMarch28,2015at22:54said:
ThankyouverymuchErich..mylastquestionis
abouttheBluetoothversions(likeinmobile
phone)fromversion1.0to4.2currentlyandyou
knowthemcertainlyIsanyBluetoothmodule
limitmeinaspecificversion?
Like
ErichStyger
onMarch29,2015at08:58said:
Imsorry,Icannotanswerthat.Youwouldhave
toreadtheBluetoothconsortiumspecification
aboutsuchthings.
Like
NK2020
onApril5,2015at08:54said:
HiErich,
Thanksfortheveryusefulwriteup.Iamcurrently,stuckata
problemIhaveanHC05andconfigureittobeaslaveinserial
profile.However,themodulethatisfeedingthedatatoHC05(to
betransmitted)doesNOTsendanewlinecharacter(\n)atthe
endofitspayload.Asaresult,theHC05doesnottransmitthe
data!DoyouthinktheremightbeawayaroundthisifIneeded
to,couldIupdatethefirmwareonHC05tosupportthis?Or
maybetheHC06doesnotwaitforanewlinecharacterbefore
transmittingandIcouldshifttoanHC06?
Thanks,
NK2020
Like
ErichStyger
onApril5,2015at11:23said:
HiNK2020,
youneedthat\n,otherwiseitwillnotwork.Andyou
cannotconfigurethis.Thereisawaytoupdatethe
firmware(see
http://byron76.blogspot.ch/2011/09/upgradeyour
bluetoothmodule.html),butinyourcaseyouwouldneed
tochangethefirmwarewhichitselfisnotopen/available.
Sobetterifyouchangethethingsonyourendandmake
surethat\nisused.HC05andHC06bothneed\n
Like
narsimh
onApril5,2015at11:39said:
Thankyouverymuchforyourresponse,Erich.I
aminterfacinganEM18RFIDcardreadertoHC
05,andthetragedyisthattheEM18doesnot
send\naftereverycardIDthatittransmits(over
UARTtotheHC05).TheonlyoptionIsee(ifI
wanttosticktothesetwomodules)istohavea
smalluCinbetween.AArrghh
Thanksagainforyourhelp.
NK2020.
Like
ErichStyger
onApril5,2015at12:59said:
Yes,Iwoulduseasmallmicrocontrollertomake
thatconversiontoo.
Like
narsimh
onApril5,2015at13:13said:
Thanks.
Like
Manish
onMay18,2015at00:48said:
Hii.
IamtryingtomakecommunicationbetweentwoUnoboardsvia
HC05..
Ihaveestablishedtheconnectionbetweenthemnhc05are
pairedproperly.
ButwhenIsendthedatafromanyofthedeviceitdisplaythe
garbagevalue.
Ididntgetit..
PlzhelpmeoutsothatIcanmakepropertransferofdata.
Like
ErichStyger
onMay18,2015at05:18said:
Haveyoucheckedthecommunciationbetweenthe
HC05andthemicrcontrollerwithalogicanalyzer?Are
thesignalsandbytestransmittedlookinggood?
Like
mehmetkarakaya
onMay25,2015at13:10said:
helloErich,
youhelpedmanypeoplepleasehelpmetoo
IhaveconnectedHC06tomyexistingSTM32microcontroler
board
Ihaveboughtbluetoothdongleandinstalledittomycomputer
itshowedHC06asbluetoothdevicesandenteredpinand
connectedtoitsoon
IdidnotgiveanyATcommandfrommySTM32andusedmy
sameoldcomunicationsoftwarebetweenmyPC(XP)and
STM32(96008N1)
thecontrolcenterofthePCshows3serialportsCOM8COM9
andCOM10added
IchoosedCOM10andwhenmysoftwarestartedtheredLEDon
theHC08stopblinkingandalwaysONsoIsuccesfully
connectedtoHC06
nowIsend10bytepackettomySTM32withchecksumtorun
theSTM32itrunsitsgreenLEDisblinkingwhenIsendstop
packetitstopsitsgreenLEDalwasyON
thisfareverythinggood
howevermyPCsoftwareisexpectingareplyfromSTM32and
thisdoesnotcomethePCsoftwaresaysnocomunication
Iamsuremy10bytepacketreceivedbytheSTM32becouseit
runsorstopsaccordingtothecommandpacket
andmySTM32ispreparingareplypackettoPCin2030
microsecondsafterthePCcommandreceived
Icouldnotfindanyanswertothisproblemisthereadelayof
HC06fromreceivingtosendingorviceversa?
IdidnotchangedanyATcommandregardingbaudrateisnot
HC0696008N1bydefault?
howcanyouhelp?
thankyou
Like
ErichStyger
onMay25,2015at16:19said:
HiMehmet,
afewtips:
makesureyouhaveRX/TXlinescorrectlyconnected:
maybeyouhavemixedthemup?
thedefaultfirmwareonmyHC06moduleisusing9600
baud.BUT:itcouldbethatyouhaveonewithadifferent
firmware.
usealogicanalyzertoseewhatthemoduleresponse
is(ifany).Youmighttrywithdifferentbaudratestoo.
haveyoudebuggedthecodeontheSTM32?Ifearyou
areusingLEDdebuggingonlywhichwillnothelpyou
much.Useadebuggertoseeifyoureallyreceivedata
properly.
yousayyouhaveCOM8,COM9andCOM10:make
sureyouusethatportlistedintheBluetoothdriver
propertiesonyourPCasoutlinedinthisblogpost.
Youcanchangethebaudrateofthemodule,butonlyif
youhaveaworkingconnectiontothebluetoothmodule.
Ihopethishelps,
Erich
Like
Pingback:JYMCUBluetoothModule|ChallengerSwan
Arden
onNovember13,2015at10:42said:
HC06boardprovidesTorqueProOBDIIguagesforprojects.I
useEVDisplayonAndroidphoneeasily.WhenItryinwindows
8.1topairIsucceed.Icanalsoaccessoneofthetwocomports
andissueATCommandslike:
AT+SETUP
AT+AH
Andcansetvariablesaccordingly:
AT+AH=384
AT+END
WhatIwashopingIcouldusetheterminalforwastoviewthe
datathatmustbegettingsentoverbluetooththetorqueproapk.
IamrunninganadroidemulatorandofcourseIlearnafterIran
thetrialforafewdaysanddecideditwascoolandpurchased
thatintheendtheydonthavebluetoothandprobablywontever.
Saddaytospend$30.00onappsandnoneprovidethe
functionality.Wouldratherhavekickedintoakickstarterforthe
emulatorproblemthanhaveitbuycigsandbeerforsomeone
etc
Ihaveeveryterminalprogramavailableandwouldliketoseethe
dataifitispossilbeotherwisepleaseadviseandwillhavetofind
anothersolutionformarinestateofchargeguagesforwindows
computers.
Arden
Like
Pingback:VixenSuperPolarisGoTo|
REIMINGTON
onMarch5,2016at07:30said:
higuyshowcanoneconfigurethehc06toconnecttotwo
devicesatthesametime?.whybecauseiwantistogetdata
fromsomeoneonhiscellphonewhileimalsoconnectedwithmy
cellphone.imtryingtobuildasmartfanthatcanbecontrolledvia
Bluetooth.
Like
ErichStyger
onMarch5,2016at16:26said:
Tomyknowledgethisisnotpossible.
Like
REIMMY
onMarch26,2016at09:09said:
HiErich
Canthehc05connecttotwodevicesatthe
sametime?..
Like
ErichStyger
onMarch26,2016at10:14said:
HiReimmy,
no,thatsnotpossiblewiththedefaultfirmware
ontheHC05.
Erich
Like
Reimington
onMarch26,2016at09:13said:
Canthehc05connecttotwodevicesatthe
sametime?ifpossiblethenImgoingforittoo
Like