I was thinking that these common and cheap bluetooth modules have either HC-05 or HC-06 firmware (see this post). Well, I was wrong: there are more! Obviously there many more firmware images available on that British CSR BlueCore4-Ext chip. Mihai Surdeanu contacted me with an updated firmware for a module which has the “BC04” firmware on it. He was so gentle and has sent me an updated Processor Expert component which works with that BC04 firmware🙂.
I have found that BC04 on ebay here. Even Farnell has it its store for incredible $60 (!!) while you can get it on eBay for about $10. The ebay link lists as well the available commands (not sure how official this is?). It looks like the BC04 is somewhat between the HC-06 and HC-05: less commands than the HC-05, but master/slave capable as the HC-05. And the BC04 is priced about the same as the HC-05, as both are master and slave capable, while the less expensive HC-06 is ‘slave only’.
Mihai identified several functions which are not available on the BC04, but are are availble on the HC-05. He disabled them in the .chg file of the component:
%if %Firmware='HC06' %- HC06 firmware is very limited %set btResetDevice Selection never ... %elif %Firmware='BC04' %set btQueryLEDOutputPolarityStr Selection never %set btSetLEDOutputPolarityStr Selection never %set btSetUserPinIO Selection never %set btSetUserPinIO Selection never %set btSetMultipleUserIOPins Selection never %set btQueryMultipleUserIOPinsStr Selection never %set btQueryMultipleUserIOPins Selection never %set btFindDeviceFromAuthenticatedDeviceListStr Selection never %else %- HC-05 firmware ... %endif
He added a new entry to the firmware selection. So now you can choose from HC-05, HC-06 or BC04:
The firmware responds as “BOLUTEK”:
Because the maximum response string is so long, the define in the driver had to be adopted to reflect the increased length:
%if %Firmware='BC04' /* Note: BC04 firmware responds on AT+VERSION with "BOLUTEK Firmware V2.43, Bluetooth V2.0, HCI V2.1, HCI Rev37, LMPV4,LMP SubV327" */ #define %'ModuleName'%.MAX_RESPONSE_SIZE 96 /* maximum response size, e.g. "+NAME:abcdef\r\nOK\r\n" */ %else #define %'ModuleName'%.MAX_RESPONSE_SIZE 42 /* maximum response size, e.g. "+NAME:abcdef\r\nOK\r\n" */ %endif
❗ That MAX_RESPONSE_SIZE is used in the driver as local variable on the stack. That was ok with up to 42 characters, but now with 96 this uses a lot of stack space. Until this gets improved, I suggest that you allocate enough stack space to work with this increased stack usage.
Beside of this, several commands are different, like instead of “AT+ADDR” it uses “AT+LADDR”, or instead of “AT+NAME?” it uses “AT+NAME”. You get all the differences if you search for “BC04” in the Processor Expert driver file on GitHub.
Yet another and different firmware. So if you buy such a bluetooth module, be aware that they are not all the same: different firmware means different commands and different capabilites. But with the Processor Expert Bluetooth component it is easy to switch between different modules. “Multumesc mult” to Mihai for his contribution!
The updated component is available on GitHub.