Hi, for a project I'm trying to get my hc-05 zs-040 bluetooth module talking with a laptop.
It shows up on my laptop between BT devices but I'm unable to connect with either password '1234' or '0000'.
To check if there is something wrong with the hc-05, I tried booting it up in AT command mode. I tried both the method with button and the method with setting the EN pin (STATE) to 3.3V.
Both of them don't seem to get the hc-05 in AT-command mode (the led blinks faster than in other videos). Also the hc-05 is constantly communicating at 9600 baud, not in 38400 like it should in AT-command mode.
At the 9600 baud, the device is answering 'OK' to the 'AT' command, but 'ERROR' to everything else (I tried 'AT+ROLE?', 'AT+VERSION?', ...).
The pin configuration:
BT hc05 --------- arduino
VCC --- 5V
EN --- 3.3V
GND --- 0V
TX --- RX
RX --- V lowered by R circuit --- TX
Post the code that you use for testing. Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum. Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
Describe the process that you use to put the HC05 in AT mode.
This suggests you are talking to an HC-06, or an HM-10, not HC-05. I rather suspect the latter. HC-06 is visually indistinguishable from HC-05. HM-10 has one large chip and uses a six-digit password.
Neither use the EN pin, both are in AT mode by default and use 9600 baud for it.
For code I simply use the default emtpy .ino sketch:
void setup(){}
void loop(){}
The chematic is added in the picture below:
Here you can see the arduino on the left and the bt module on the right.
The EN pin is connected to 3.3V in the picture, this is sometimes disconnected to get it into AT command mode. The way this happens is described below.
The way I tried to set the HM-10 to AT command mode:
Neither of them worked, I get the result like I described in my previous post.
With button: pull out the VCC 5V power to the HM-10, press the button on the HM-10, set the VCC of the HM-10 back to 5V, then release the button after the LED turns on.
With EN: pull out the VCC 5V power to the HM-10, set the EN pin to 3.3V, set the VCC of the HM-10 back to 5V.
You are right!! it is an HM-10 module,
I will soon try to connect to it using the 6-digit 000000 password.
When I look online I see that the commands for AT mode are practically the same. Correct me if I'm wrong but I think this still means that there is something going wrong becoase it is giving ERROR to the AT+ROLE? command.
I'm afraid I don't know much about HM-10, and there are different versions. It could be that you simply a have a cr/lf problem.
You would reckon AT+ROLE? would work with anything but it does not appear to be a legitimate command for the Bolutek BLE-CC41-A, and so I guess it would return an error. The Bolutek seems to be a slave-only device.
Update:
I figured out that I have a specific version of the HM10 with different commands (the mlt-bt05).
Now I can succesfully talk to it using the AT commands. One problem remains though, I'm not able to connect to it using my laptop bluetooth. I assured the password is '123456' via AT commands, but when I try to connect, I get this: (I'm sorry it's in dutch, I translated the text below the images.)
Translation:
Add a device
Make sure the device is activated and can be detected. Select a device from below to make a connection.
BTSolarCar
Establishing connection
Enter pincode for BTSolarCar
Translation:
Add a device
Make sure the device is activated and can be detected. Select a device from below to make a connection.
BTSolarCar
Try again to connect with your device.
This is amazingly annoying, because it is the very last step to get it working, the code on my laptop is already written and tested.
The device is in slave mode, the pincode is checked via serial commands and the internet doesn't seem to have a concrete answer.
During the first photo (Takes about 30sec), the indicator LED is burning continuously, indicating a connection. After this however (2nd photo), the LED somethimes starts blinking again, meaning it is waiting for connection. My pc never gives any indication of a succesfull connection, not in the BT settings nor in the device manager.
Any ideas?
HC-05 is a common SPP bluetooth module. HM-10 is a BLE (Bluetooth Low Energy) module. The two technologies are different form each other. Are you taking this into account?
The AT command should work with the MLT-BT05
although it isn't clear that you actually need it. Your laptop problem rather suggests that it isn't BLE compatible, so you might check that.