Тёмный

Using AT Commands to Set Up Your Bluetooth Module : HC-05 and HC-06 

Bytes N Bits
Подписаться 34 тыс.
Просмотров 22 тыс.
50% 1

Опубликовано:

 

16 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 51   
@AndrewBarber-Hobart
@AndrewBarber-Hobart Год назад
This is a great tutorial. Very clear and easy to follow. Thanks heaps.
@BytesNBits
@BytesNBits Год назад
Glad it was helpful!
@nara49veera12
@nara49veera12 9 месяцев назад
Thank you for your clear description of each step and its purpose
@BytesNBits
@BytesNBits 9 месяцев назад
You are welcome!
@TheDemonking82
@TheDemonking82 3 года назад
All this time I’ve been ripping my brains to shreds and there was a button. Thank you your so far the only one I found that points this out. And love the video.
@BytesNBits
@BytesNBits 3 года назад
Hi. There's always a 'make it work' button that no one tells you about. Glad it helped.
@michaelodonnell4467
@michaelodonnell4467 2 года назад
Great video's, I have been able to programme a HC-06, but can't get the HC-05 to respond to AT commands. Yes, it is in program mode ( pressed the button) and yes I have wired it as per instruction. I have tried two other HC-05, but none of them will respond. I have tried other baud rates but nothing. Any other suggestions are welcome. I have ordered some more HC-06 as I know they work. I need to increase the baud rate for a GPS-RTK project.
@BytesNBits
@BytesNBits 2 года назад
Hi. That's strange. Are you running the basic terminal code to send your commands directly to the HC05? Is anything coming out of it? Have a look at the data sheet for your device to make sure you've got the right baud rate, stop and parity bit settings. If these are off it might not be able to read your commands. Good Luck!
@michaelodonnell4467
@michaelodonnell4467 2 года назад
@@BytesNBits thanks. Yes have tried everything. I'll just stick to to the hc06 as they work
@robinarmstrong8886
@robinarmstrong8886 Год назад
Same problem and seems a common one but no one has any good answers other than replace the bluetooth module which I'm sure is not the problem.
@magwitch
@magwitch 2 года назад
Hi, thanks for the HC-05 tutorials. I've tried to follow this tutorial exactly and don't get any response when I enter AT commands, I just stare at a blank serial monitor. Can anyone suggest what might be wrong?
@BytesNBits
@BytesNBits 2 года назад
Have you checked your serial terminal baud rate? Try a few different settings to see if the speed on the HC-05 has been set to something different. Other than that, check your wiring, try a different HC-05 and Arduino if you have one. I hope you get it working.
@magwitch
@magwitch 2 года назад
@@BytesNBits turns out you're supposed to short circuit two points together. Not sure how but that's how my teacher said they did it.
@BytesNBits
@BytesNBits 2 года назад
@@magwitch Hi. Your teacher is correct - sorry forgot the HC-05 works differently to my HC-06. There should be a small button on the HC-05 unit. You need to hold this in as you turn on the power. This will put it into AT mode so it will talk to you. Set it up as you want and then power off and on again to get it back to normal mode. I hope this works!
@TheAakoo123
@TheAakoo123 Год назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ykgt4v7_4y4.html
@TheAakoo123
@TheAakoo123 Год назад
Serial speed is by default 38400 in AT mode and you need to connect the key pin also on HC-05.
@jack-haywood
@jack-haywood Год назад
I followed along with you first video and everything worked, not changing any hardware settings I uploaded your code from this video and it does not work. Any suggestions?
@BytesNBits
@BytesNBits Год назад
If you've copied from the web page the top line has gotten corrupted by the editor #include <SoftwareSerial.h> should be #include ;
@davidclarke92
@davidclarke92 3 года назад
Hi. Is there an AT command to stop the Bluetooth device from broadcasting itself for new connections? Too add more security after changing the pin.
@BytesNBits
@BytesNBits 3 года назад
Hi David. You can use the AT+CMODE=0 and then AT+BIND=??? to restrict the module to a specific bluetooth device connection. You'll need to use some of the other commands (have a look at this list content.instructables.com/ORIG/FI9/7NJR/IRXT0JIG/FI97NJRIRXT0JIG.pdf) to get the addresses of paired modules. I've not tried it or worked out exactly what to do but the commands seem to be there. I hope this helps.
@djdndhilo5440
@djdndhilo5440 9 месяцев назад
i did the same exact things as in the video and the same code and when I try the AT commands but it doesnt work I have tried other BAUD rates and everything and I have tired HC-05 and HC-06 what should I do
@BytesNBits
@BytesNBits 9 месяцев назад
That's a strange one. I'd go back to basics first. Check you've got the wiring correct. Check your resistors in the voltage divider are giving the right output voltage. Maybe swap them for a logic level converter. Make sure the sketch is using the right pin assignments. If this all checks out add a line in the Serial.available block to send the input character back to the serial terminal to check your key presses are getting through. If that's all Ok try sending actual commands to the BT module in code and see if it responds.
@tinkerer-fc3zv
@tinkerer-fc3zv 6 месяцев назад
@@BytesNBits From my investigations today, I am guessing that the software serial port is too far off from 38400 baud to communicate with the HC-05 reliably. When I just sent AT, I could see on an oscilloscope that the HC-05 was responding with the correct bit sequence, but the Arduino was not correctly interpreting the bits. To test my hypothesis, I created the program below that uses the HW serial port. I used a cheap ~$10 logic analyzer and pulseview to view the data going in both directions. I could see that the HC-05 was replying properly. I put the 10 second wait at the start since I had to reattach the wires from pins 1 and 0 after downloading the code, and I also needed to start the logic analyzer capture after I started the program. I noticed that the HC-05 replied with an error code at the first "AT ", but it responded properly to the rest of the commands. For me, the software serial port did communicate correctly with the HC-05 at 9600 baud, but it garbled a few characters at 19200. #include "Arduino.h" void setup() { Serial.begin(38400); } void loop() { delay(10000); Serial.write("AT "); delay(50); Serial.write("AT+UART=19200,0,0 "); delay(50); Serial.write("AT+UART? "); delay(100); Serial.write("AT "); while(1); } So, for the HC-05, if you only need to make infrequent changes like password, name, and baud rate, you could just use a program like the above to make the changes.
@fernandohood5542
@fernandohood5542 Год назад
How do you send data from the device to another device after you connected?
@BytesNBits
@BytesNBits Год назад
You'll need one arduino with an HC-05 module that can run as a master. This can then connect and disconnect to other devices.
@robinarmstrong8886
@robinarmstrong8886 Год назад
Can someone explain why some tutorials connect to the TX/RX pins for programming and others use the Digital serial pins? Also every time I try this I get no output on the serial monitor...All these tutorials have comments from people with similar problems but no one seems to know the true reason why, and how to fix it?
@BytesNBits
@BytesNBits Год назад
Hi. On some Arduino models (Uno and Nano) the digital serial port is shared with the serial port used to talk to your PC. If you use these pins for your project you then can't communicate with your PC whilst your code is running. This may be why you're not getting anything on the serial port. Using the software serial port gets around this issue. On boards with 2 hardware ports this isn't a problem.
@bencypg
@bencypg 3 года назад
Not able to set AT+POLAR,1,0 using USB to serial convertor. All other command works fine. Tried 3 different HC05 and also different USB to serial convertor but only this command does not work. Please help
@BytesNBits
@BytesNBits 3 года назад
Hi. Try AT+POLAR=1,0. I think it needs an = rather than the first comma.
@bencypg
@bencypg 3 года назад
@@BytesNBits right, my command is same as you said. Tried with upper case and lower case. No luck
@BytesNBits
@BytesNBits 3 года назад
@@bencypg Does it respond to the polar query command - "AT+POLAR?"
@bencypg
@bencypg 3 года назад
@@BytesNBits No.
@BytesNBits
@BytesNBits 3 года назад
@@bencypg I'm not sure what to try next?? It looks like that command is just missing from the firmware on your devices. I only have HC06s here so can't confirm it. All the datasheets confirm the command should be there. Are all your devices from the same manufacturer? Is there a datasheet specifically from that supplier? Sorry I can't give you an answer.
@HabibShaikh-l4j
@HabibShaikh-l4j 9 дней назад
Bro my my Arduino doesn't give command how to troubleshoot it
@BytesNBits
@BytesNBits 5 дней назад
Make sure the Arduino can talk to the hc05 first. Then make sure the hc05 is transmitting and you can see it to pair with it.
@felipe_ramos
@felipe_ramos 3 года назад
Do you know how to add service and characteristics ?
@BytesNBits
@BytesNBits 3 года назад
Hi. You'd need to have a look the the data sheet for your device and see what commands or hardware setup options there are. I know the HC05 has more set up features but I tend to only use them as plug and play connections to a mobile phone.
@felipe_ramos
@felipe_ramos 3 года назад
@@BytesNBits Hi. thanks for the reply. I'm working on a project which consists in send data to a hc-05 bluetooth module from a react native app. In the app, I'm using a react-native-ble-plx plugin to handle with bluetooth communication. But this plugin doesn't find the hc-05 module, I don't know why but, I presume tha this module doesn't work with BLE. And thats why I trying to setup a BLE service and characteristc. Maybe it's the reason to hc-05 never get found. I don't know if it's possible, but, thanks for the tip. I will look in the data sheet to see if find a solution.
@BytesNBits
@BytesNBits 3 года назад
@@felipe_ramos Hi. The HC05 and HC06 are not BLE compatible. You'll need a different module. If you do a search on Amazon or eBay for 'ble module' you should find what you're looking for.
@felipe_ramos
@felipe_ramos 3 года назад
@@BytesNBits I was already suspecting about that, but then I found a stack overflow post saying that this it's possible. I spent the whole weekend trying to do this, lol. Today, I was about to give up, and now that you say me this, definitly I will search for another module. thanks man, you earned a subscriber.
@junilojbwahab8899
@junilojbwahab8899 2 года назад
I have the same problem as @MAGWITCH and i still dont know what to do.
@BytesNBits
@BytesNBits 2 года назад
Hi. The HC-05 works differently to my HC-06. There should be a small button on the HC-05 unit. You need to hold this in as you turn on the power. This will put it into AT mode so it will talk to you. Set it up as you want and then power off and on again to get it back to normal mode. I hope this works!
@RetroEcoChicken
@RetroEcoChicken Год назад
Command Responce Result (AT Code for 06 bluetooth Moudle) AT+NAMExyz = OKsetname Sets the module name to “xyz” AT+PIN1234 = OKsetPIN Sets the module PIN to 1234 AT+BAUD1 = OK1200 Sets the baud rate to 1200 AT+BAUD2 = OK2400 Sets the baud rate to 2400
@BytesNBits
@BytesNBits Год назад
Thanks for the codes.
@HabibShaikh-l4j
@HabibShaikh-l4j 9 дней назад
Sorry bluetooth module HC-05
Далее
Million jamoasi - Amerikaga sayohat
12:37
Просмотров 466 тыс.
Arduino Bluetooth AT commands HC 05 HC 06
7:20
Просмотров 62 тыс.
Optimizing Arduino Code: no setup(), no loop() ⛔
9:27
How to Pair HC-05 Bluetooth Modules
5:07
Просмотров 251 тыс.