tomaskovacik / BK3254

arduino library for A2DP bluetooth module based on BK3254 chip from Beken Corp (F-6888) and BK3266 based module F-6988 from HYT named HY5066 (not HY5066SR)
GNU General Public License v3.0
54 stars 18 forks source link

BK3266 and other BK3254 compatible modules #13

Closed MCUdude closed 2 years ago

MCUdude commented 3 years ago

Hi!

I stumbled across this repo, and it was something very familiar with your user name 😉

I'm working on a PCB where an Audio Bluetooth module will be used. It's going to be controlled by a microcontroller over UART, and I bought several BK3266 modules. One on a large PCB, one on a small breakout PCB and two modules without any breakout boards URL here and here.

As an FYI, the board I'm working on is for a commercial application, so several hundred boards will be manufactured.

When I tested the four modules I ordered, the module on the large and small breakout boards worked exactly the same. None of them accept AT commands, but I'm able to rename the BT name, disconnect BT, force pair, etc. everything I'm looking for really.

What worries me is that the two bare modules behaved differently. The first one I tried outputted some garbage when I powered it on, but it didn't respond to any commands. The other bare module did work. But the only command I got to work was the COM+SNAME command. All other commands returned EER.

I'm just looking for a module I can buy that I know will work out of the box (just like the two on breakout boards) without having to worry about using Bekens Toolkit with a JTAG programmer.

This leads to the following questions:

I was hoping to settle on a module that "just works" without having to get out the JTAG programmer...

Thanks!

tomaskovacik commented 3 years ago

hello, hello

Have you ever experienced that some modules work with basic and known commands, while others don't?

you cannot be sure, I make wiki page for bk3254 modules, bought few modules and tested them: https://github.com/tomaskovacik/BK3254/wiki/modules-from-ali just to know what should people order

If yes, is this a common thing? Can we expect that modules from Aliexpress (or wherever you buy modules) work as intended, or do the majority have to be programmed?

I cannot tell, if I gonna design something commercial I go for BM20 from the microchip or I would try to source modules from taobao shop named HYT, their docs are good and look like they sell only BT modules: https://shop110280715.world.taobao.com/ (google translate works ... ). I sourced a lot of docs from their store and then translate them (docs: https://github.com/tomaskovacik/kicad-library/tree/master/library/datasheet/F-6888_bk3254)

If you find datasheet at HYT store this item should be fine: https://www.aliexpress.com/item/4000001983890.html

Is there any reason to use/not use BK3266? it looks to me like BK3254, BK3266 and BK8002 are pin-compatible. Is the BK3254 considered "safer", i.e basic functionality like the BT+ command will work out of the box?

I selected bk8000k because it was cheap, and bk3254 because of sdcard, USB, aux support and of course UART control capability, nothing else, no audio quality or something, I just wanna try them so I order them then designed boards and wrote this crude library ...

tomaskovacik commented 3 years ago

ok, so I found webdisk at baidu with data,

https://pan.baidu.com/s/1F0h-kHPM5qmM3bra4lTkjA

password 92pw

there are 2 folders with BK3266 in name, inside are 2 pdfs, one is 1.0 second is 1.1, I cannot download them, but web preview is possible, based on what I see version 1.0 supports fewer commands then 1.1 take look if something looks similar with your modules, and then you can try order some HYT modules. It is best I can give you ...

and then I try to find file "BK3266发射接收一体串口调试.rar" with google and found this repository at github which I have "stared" many months ago :)

https://github.com/bondango/Bluetooth-Audio https://github.com/bondango/China-Blue-tooth-Audio-Devices

for translation I use https://www.onlinedoctranslator.com/en/

in one of these repositories are excel files with bk3266 in name and one is "13618 BK3266SR Commands.xls" so one of your modules can be this BK3266SR module, so with serial but not ascii serial interface

tomaskovacik commented 3 years ago

Bluetooth Audio Module BK3266 Manual V1.0_Infrared Remote Control_HYT.zh-CN.en.pdf Bluetooth Audio Module BK3266 Manual V1.0_RGB Light_HYT.zh-CN.en.pdf Bluetooth transmitter and receiver integrated audio module BK3266SR manual V1.0_HYT.zh-CN.en.pdf

MCUdude commented 3 years ago

... I would try to source modules from taobao shop named HYT, their docs are good and look like they sell only BT modules: https://shop110280715.world.taobao.com/ (google translate works ... ). I sourced a lot of docs from their store and then translate them (docs: https://github.com/tomaskovacik/kicad-library/tree/master/library/datasheet/F-6888_bk3254)

This is GOLD!! A trusty source that provides documentation and (most likely) modules with firmware that just works. Thank you for providing the Taobao link!

Bluetooth Audio Module BK3266 Manual V1.0_Infrared Remote Control_HYT.zh-CN.en.pdf Bluetooth Audio Module BK3266 Manual V1.0_RGB Light_HYT.zh-CN.en.pdf Bluetooth transmitter and receiver integrated audio module BK3266SR manual V1.0_HYT.zh-CN.en.pdf

Thank you for providing so much documentation!

I'm so fortunate that I have a contact in Shenzhen China that helps me out with tricky stuff like this. She can order the modules from Taobao and get me some samples just to make sure the ones from HYT are the real deal. And I'm pretty sure they are, because the two boards I bought were labeled HYT, and both worked exactly the same, while the "unlabeled modules" did not.

Do you know if it is possible to increase the baud rate to, say 115200 baud? I have to use SoftwareSerial to communicate with the module since the two serial ports (on the ATmega1284P) is occupied. And for a very busy microcontroller, a blocking 9600 baud transmission isn't the best...

MCUdude commented 3 years ago

Even though the BK3266 and the BK3254 are very similarly priced, the BK3254 is waaaay more popular than the BK3266. Maybe the 3254 have been on the market for a longer period of time? Anyways, I'll get both so I can figure out what model that works the best!

tomaskovacik commented 3 years ago

... I would try to source modules from taobao shop named HYT, their docs are good and look like they sell only BT modules: https://shop110280715.world.taobao.com/ (google translate works ... ). I sourced a lot of docs from their store and then translate them (docs: https://github.com/tomaskovacik/kicad-library/tree/master/library/datasheet/F-6888_bk3254)

This is GOLD!! A trusty source that provides documentation and (most likely) modules with firmware that just works. Thank you for providing the Taobao link!

Bluetooth Audio Module BK3266 Manual V1.0_Infrared Remote Control_HYT.zh-CN.en.pdf Bluetooth Audio Module BK3266 Manual V1.0_RGB Light_HYT.zh-CN.en.pdf Bluetooth transmitter and receiver integrated audio module BK3266SR manual V1.0_HYT.zh-CN.en.pdf

Thank you for providing so much documentation!

no problem, I just put it into translator :)

I'm so fortunate that I have a contact in Shenzhen China that helps me out with tricky stuff like this. She can order the modules from Taobao and get me some samples just to make sure the ones from HYT are the real deal. And I'm pretty sure they are, because the two boards I bought were labeled HYT, and both worked exactly the same, while the "unlabeled modules" did not.

ask your source if she would be so nice and ask guyes at HYT store if they have aliexpress store or which store take modules from them,

Do you know if it is possible to increase the baud rate to, say 115200 baud? I have to use SoftwareSerial to communicate with the module since the two serial ports (on the ATmega1284P) is occupied. And for a very busy microcontroller, a blocking 9600 baud transmission isn't the best...

I do not know about such option but take look at this config tool (but I did not see it there ), it is highly possible that any option in config tool can be customised prior shipping to you if you buy high quantity, you have to ask guys at HYT store, what they are willing to do and most importantly what they can do https://github.com/tomaskovacik/kicad-library/blob/master/library/datasheet/F-6888_bk3254/BEKEN_JTAG_bk3254/3254_ToolKit2.6.exe

Even though the BK3266 and the BK3254 are very similarly priced, the BK3254 is waaaay more popular than the BK3266. Maybe the 3254 have been on the market for a longer period of time? Anyways, I'll get both so I can figure out what model that works the best!

BK3266 is listed as BT5.0 but the datasheet for BK3266 silicon stated that it is BT 4.2 so probably it is BT5.0 only because 5.0 is compatible with 4.2 but I do not think that silicon was updated and it supports double speed and range ... BK3266 silicon datasheet: http://c-chip.com.cn/userfile/productPic/20181201113141.pdf https://www.semiconductorstore.com/blog/2017/Bluetooth-5-versus-Bluetooth-4-2-whats-the-difference/2080/

BK3254 is BT4.1

I can send you module on my breakout board if you like, it will be probably faster then from china :) if you want one drop me your address to tomas.kovacik at googleemail or at tindie

tomaskovacik commented 3 years ago

Do you know if it is possible to increase the baud rate to, say 115200 baud? I have to use SoftwareSerial to communicate with the module since the two serial ports (on the ATmega1284P) is occupied. And for a very busy microcontroller, a blocking 9600 baud transmission isn't the best...

https://www.microchip.com/wwwproducts/en/AVR128DA32 ;) $1.44 at microchip not bad for such beast :)

MCUdude commented 3 years ago

I can send you module on my breakout board if you like, it will be probably faster then from china :) if you want one drop me your address to tomas.kovacik at googleemail or at tindie

Wow, that's very kind of you! I'll send you an email soon.

https://www.microchip.com/wwwproducts/en/AVR128DA32 ;) $1.44 at microchip not bad for such beast :)

Initially, it is a good idea. But since there is a DSP involved here, I need LOADS of EEPROM. And if there is something the megaAVR-0 and AVR-DA/DB lacks, it is EEPROM 😞 I also need PlatformIO support, and there are some libraries I depend on that only works with "classic" AVRs for now.

tomaskovacik commented 3 years ago

Initially, it is a good idea. But since there is a DSP involved here, I need LOADS of EEPROM. And if there is something the megaAVR-0 and AVR-DA/DB lacks, it is EEPROM disappointed I also need PlatformIO support, and there are some libraries I depend on that only works with "classic" AVRs for now.

hmm, then only SW serial or 1280/2560 ... but that is total overkill with its package almost for everything, but if there is no other way ....

MCUdude commented 3 years ago

hmm, then only SW serial or 1280/2560 ... but that is total overkill with its package almost for everything, but if there is no other way

hopefully, the microcontroller will very rarely send commands to the Bluetooth module. There will be an initialization routine to setup BT name and other settings, and an interaction to end BT connection to allow other to connect their phone. I'll figure it out somehow 🙂