-
Notifications
You must be signed in to change notification settings - Fork 7.6k
using ESP32 - master mode bluetooth connect to HC-06 - slave mode #3916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, However, with the help of the real experts I think I had to modify the BluetoothSerial Library. As I say, I cant remember where or why now. However, if it should be any help, I have attached my project which I did get working to my satisfaction (an OBD reader). I have also attach the BluetoothSerial library. I think it is formally known as v1.0.4. But as I said, I can't remember how I updated it. I can only assume I must have done it by hand, as I can't see it in the Arduino Library Manager? |
Hello, |
Hello, Maybe I do something wrong? The code is bellow with your version of BluetoothSerial: if(connected) { // disconnect() may take upto 10 secs max |
@mprowe can you give me more details please? |
@j0r9e74 "Should I pair the devices first?" If you had taken the time to look at my code, you would see that the first thing I did was to remove any previous bonding. |
I was having a similar problem to you (not being able to connect to HC-05 modules, and always saying connection was successful even when it wasn't). Basically, there are two problems:
The fix (for me) was to go down to version 1.0.2, then manually change the BluetoothSerial.cpp file with this one (which fixes the successful connection bug above). I suspect this was @mprowe's fix as well, as he was a participant in the discussion on the pull request where I finally found the solution, and the BluetoothSerial.cpp he shared has the fix for the |
I have similar problem. edit: |
I saw your comment after having found the same bug and opened a new issue for this: #4081 |
Haven't encountered that, no. I guess check that you properly uninstalled 1.0.4 and downgraded to 1.0.2? I only say that because the SerialToSerialBTM example wasn't included until 1.0.4. |
@zjay1995 i found you also need to replace the .h file with https://raw.githubusercontent.com/espressif/arduino-esp32/f0e2e2a62fe98ec9657f3935c41c88a0fd0e7acd/libraries/BluetoothSerial/src/BluetoothSerial.h regardless, i still can't get it to connect, even after downgrading to 1.0.2. 1.0.4 crashes with fwiw, i'm trying to connect to a UM25C usb multimeter, which apparently has a DX-BT18 module that is similar to the HC-06. using a "DEVKIT1" board. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
brownby's fix made it work for me. Tx. |
Hi, how can I downgrade from version 1.0.4 to version 1.0.2? |
I've been struggling to get this to work, none of the fixes above seem to be doing the trick? Anyone have any updated recs to get this working in 2022? In particular, I am using platform.io so, like @InrouteInnovacion, I am a bit perplexed as to how to downgrade to 1.0.2. In addition, it looks like we're now up to version 2.x, so I'm wondering if this has been somehow fixed in the meantime? Thanks! |
Hi, I'm new to all this world and may be I'm wrong, but after struggling a lot and read a lot of docs and forums, I've finally found an issue. Don't know if this'll be helpful to all of you, but works for me. I'm working with a Heltec Wifi Kit 32 and trying to connect to a HC-05 in slave mode classical Bluetooth ( several HC-05, in fact ). The module bonds, pairs and link only after a UART Baud rate change. Default HC-05 baudrate is 4800, so I change this to 115200 ( with AT+UART = 115200 in AT mode ) and the example code for Master works like a charm. It was so simple that I'm both happy and angry. Was tested also with a Nodemcu Esp32s Wifi + Bluetooth 4.2 Iot Wroom, same results, the HC-05 connects. 15:24:43.630 -> rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) |
It is possible to use ESP32 - master mode bluetooth connect to HC-06 (with arduino nano) - slave mode?
The usecase is to send/receive some control strings
I tried the different modified BluetoothSerial sources from github and got only two types of results:
- always saying "Connected succesfully!", no matter what name or address I used; tried also to communicate in this state but without success
- "Failed to connect" forever
It is not a matter of HC-06 bt connection as slave because I can use a phone to connect at it and send/receive strings.
The text was updated successfully, but these errors were encountered: