Giter VIP home page Giter VIP logo

Comments (14)

tomaskovacik avatar tomaskovacik commented on July 1, 2024 1

from bk8000l.

Apodasch avatar Apodasch commented on July 1, 2024 1

from bk8000l.

tomaskovacik avatar tomaskovacik commented on July 1, 2024

from bk8000l.

Apodasch avatar Apodasch commented on July 1, 2024

Ok, thank you for quick response.
Do you know how to enable uart on BK8000L? And Why it reacts to command "1" and its reply seems to be correct - it replies "Bluetooth is in paring mode."

from bk8000l.

Apodasch avatar Apodasch commented on July 1, 2024

Example:

..........
16:28:38.670 -> getName s
16:28:38.670 -> getConnectioStatus t
16:28:38.670 -> getPinCode u
16:28:38.670 -> getAddress v
16:28:38.670 -> getSoftwareVersion w
16:28:38.670 -> MusicGetStatus x
16:28:38.670 -> getHFPstatus y
16:28:38.670 -> StartModule z
16:28:38.670 -> send APT data A+data
16:28:38.670 -> APT login B
16:28:38.772 -> Command: h
16:28:38.772 -> Done! Waiting for new command...
16:28:44.395 -> Command: 2
16:28:44.395 -> Done! Waiting for new command...
16:28:47.804 -> Command: 3
16:28:47.804 -> Done! Waiting for new command...
16:28:50.002 -> Command: 5
16:28:50.002 -> Done! Waiting for new command...
16:28:53.005 -> Command: 4
16:28:53.005 -> Done! Waiting for new command...
16:29:04.224 -> Command: 1
16:29:04.224 -> Done! Waiting for new command...
16:29:04.444 -> Bluetooth in pairing mode

from bk8000l.

tomaskovacik avatar tomaskovacik commented on July 1, 2024

from bk8000l.

Apodasch avatar Apodasch commented on July 1, 2024

Thanks a lot!
I followed all the instructions and I have succesfully flashed the module and also changed it's name.
It is working nearly perfectly now.
The only thing that is not working is pairing detection or pairing state change.
I would like to prevent the module to be in a paring mode while it is disconnected, until some button/switch is pressed (so that no strangers can connect, only a person who has already paired last time, or you have to push a button to re-pair).

Please check this code:

void loop(){

//should be call periodically, to get notifications from module, for example if someone calling...
BT.getNextEventFromBT();

if (BTState != BT.BTState) {
BTState = BT.BTState;
switch (BT.BTState) {
case BT.Connected:
Serial.println(F("Bluetooth connected"));
break;
case BT.Disconnected:
Serial.println(F("Bluetooth disconnected"));
BT.pairingExit();
break;
case BT.Pairing:
Serial.println("BT is in pairing mode! Exitting pairing mode...");
BT.pairingExit();
break;
}
}

if (BTState != BT.Connected and !(digitalRead(some_switch))) {
BT.pairingExit();
}

}

It seems to me that the BT.pairingExit() function (command) does nothing, because the module stays in the paring mode while it is disconnected.

Do you have any idea how to prepare tihs functionality?

Thank you very much once more!

Bye
Adam

from bk8000l.

tomaskovacik avatar tomaskovacik commented on July 1, 2024

from bk8000l.

Apodasch avatar Apodasch commented on July 1, 2024

You already helped a lot. No problem.
Or if you have another idea how to secure the bt receiver somehow? Did you already did some project where you have implemented this? Are there any other usefull tools for flashing or customizing the BK8000L? If something comes to your mind, just leave me a comment here.
Thank you once more.
Adam

from bk8000l.

tomaskovacik avatar tomaskovacik commented on July 1, 2024

from bk8000l.

Apodasch avatar Apodasch commented on July 1, 2024

Hi,
that is not actually what I need. If I pull reset to ground, module resets and I suppose stays in preboot state until reset is released.

Imagine my situation:
I would like to use this module for my home stereo speakers. I would like to connect my personal mobile phone so that I can play music. When I leave home i do not power off my home speakers and I do not want to power off the bluetooth module too. If my mobile disconnects, the module goes to pairing mode and anybody else can connect (neighbors) while I am not home. I wish that the module stay in diconnected state but not come to pairing mode automatically.
Then, if you come back from work you can simply reconnect with your personal mobile, because the module is still on, diconnected and you are already paired and you do not need to repair and you simply connect - no need to press any button or to power on the module again when already paired device try to connect - that is why the reset solution is not suitable for me.
Paring should only be possible when some button is pressed or something like this.

As I already said I am using ESP8266 (Wemos D1) as controller - will communicate with BT module, and possibly handle pairing button.

Any idea now?
Thank you

Adam

from bk8000l.

tomaskovacik avatar tomaskovacik commented on July 1, 2024

ok, that situation is totally different from the one you previously mentioned:

"I would like to prevent the module to be in a paring mode while it is disconnected, until some button/switch is pressed (so that no strangers can connect, only a person who has already paired last time, or you have to push a button to re-pair)." 👍

in this case, try to investigate if AT+CB make module undiscoverable. if not, then there is probably nothing we can do.

but you can try to investigate if the configuration of bk8000l chip can be changed, take look at this thread on google groups: https://groups.google.com/forum/#!topic/bk8000l/1WuboNBVpnY

t.

from bk8000l.

Apodasch avatar Apodasch commented on July 1, 2024

Hello, I did some more investigation and I came to at least some solution.
First of all I found very useful information on the site you have provided. Thank you very much for that.
Next thing is that AT command AT+CB either does not work at all, or it works, but the module itself switches back to pairing immediately after exitting pairing, when there is no device connected. So, not useful for me...
I checked the configuration and I tried to reconfigure the module, but I did not find any configuration bit to prevent the module from entering pairing mode automatically.
I found a workaround which is somehow working (better than nothing).
After that the module starts, I use BT.connectLastDevice() every 500ms to force the module to connect to the last device. Even if last connected device is not reachable and it fails, it results in ignoring incomming pairing request. The only problem I found is that after some time of this AT command attack to the module, the module gets frozen and you can not communicate anymore and you cannot even connect with bt client. To avoid this I reboot the BT module with its reset pin every 5 minutes while in disconnect mode. If I wish to pair with another device I switch to pairing mode with BT.pairingInit(); which works fine.
It is not the best solution, but it is a solution that meets the expected behavior from the user.

Thank you very much for all the help.
I think we can close the issue.

Farewell
Adam

from bk8000l.

tomaskovacik avatar tomaskovacik commented on July 1, 2024

A preco sme si pisali po anglicky? :D zatvaram

from bk8000l.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.