All,
I have bought several HC-05 at ATDelivery distributor.
All of them operate fine using Softserial and my Arduino Uno.
I can transmit data in both directions between PC/Windows and Arduino Uno via bluetooth with 9600 baud.
I would like to change HC-05 configuration (e.g. bitrate) via AT commands.
I am following the documentation from AzDelivery. However, there is no communication to HC-05 possible.
Good job getting the AT mode figured out. At mode communication to the module is always at 38400 baud.
115000 seems to be maximum. Is there an drawback against 115000?
What is a good setting for stop/parity bit?
The answers to these questions depend on what the HC05 is connected with. Many people use the HC05 connected to an Arduino through Software Serial which is best below 38400 and in that case 9600 is often used. If the module is connected through a hardware serial port to an Arduino then 115200 is good.
The stop/parity is also dependent upon what is connected to the module. The default values for Arduino serial are 8,N,1 that is 8 data bits, no parity, one stop bit. The HC05 AT+UART parameter arrangement is not in the 8-N-1 order typically referenced but the parity and stop bit order is reversed.
I understand the HC-05 maximum rate is 1382400, but I also understand that 115200 is/was the limit if you use it on a Windows PC, i.e. it's a Windows problem, not Arduino but, in your case, and if the windows limit is true, I guess there is no point in using the a faster rate at the Arduino end.
There is no drawback whatsoever with using 115200, so long as you use HC-05 on hardware serial. With a UNO, hardware serial pins 0,1 share the UART with the serial mionitor. If you are not using the serial monitor to communicate in the same programme, this is not a problem. All you need do is ensure Bluetooth is disconnected when you upload it.
I have never heard of anybody needing to change the parity and stop bits.
All,
thank you very much for your comprehensive feedback.
Based on your feedback I did additonal internet research and my own testing.
I am now using AltSoftserial with 19200 Baud. There are no bit errors with this speed.
up to 57600 Baud was possible - however with bit errors.
In my project I am using bluetooth to transmit telemetry/control data between my robot and my "cockpit" (Windows PC). I would like to achieve high sample rates.
With the current setup I can achieve about 4 TX/RX sessions per second.
My feeling is that WIFI would be more appropriate .> higher bitrates possible.
Looking at your photo, I don' see any reason why the HC05 can not be connected to hardware serial on pins 0/1 and run at 115200 or whatever the PC can take from the Arduino. You will need to disconnect the serial connection when you load new code but in my opinion it is a small price to pay for reliable high speed.
You actually can use usb serial for debugging while the HC05 is connected to hardware serial, you will only be able to output to the monitor and not receive input from the monitor.
whenever I disconnect my bluetooth I have big trouble to reactive it. I need to pair the bluetooth again...
This costs a lot of time.
This is the reason, why I want to have a stabile bluetooth connection. The HW Serial I need to upload new code...
Any ideas how I can rapidly reactive bluetooth.
My exact config is the following:
Node-Red is running on a VM / virtualbox on a windows PC.
I'm not certain I understand. Are you disconnecting power from the HC05 when you disconnect the RX and TX to load new code? You don't need to do that.
In my experience with a phone, you can disconnect RX TX and load a new program to the Arduino and the HC05 stays connected to the phone all the time if it is powered. Connection is independent from communication. Everything is ready to go when reconnecting RX TX.
You may have some issues that I don't understand with your environment.
Node-Red is running on a VM / virtualbox on a windows PC.
I can't imagine it worth the effort to try, even if it were possible. More to the point, I think it takes some serious abuse to kill these things.
This may be meaningless and/or a matter of language. I think you can only prove that by unpairing and pairing again. it says nothing about the serial connection anyway.
This is about the best proof that the serial is kosher. IF you are configuring Bluetooth with Arduino as the programmer i.e. wired Rx < Tx and Tx > RX, then the problem must surely lie somewhere else. If you are using Arduino as a pass-through device, i.e. wired Tx>Tx, it might be time to make sure your wiring is appropriate for communications mode.