I’ve been successful in making PC Bluetooth communicate with HC-05, using processing in creating the graphic user interface making it communicate via Bluetooth pairing it. Though I am not sure what is causing the response delay in the communication, is it the Baudrate, though the default baudrate is 9600.
Is there anyone who could help me understand why communication between PC and HC-05 is having delays? is the baudrate affecting it?
Yes 9600 baudrate makes delay … to increase it here is how to do it and you can search More ways upon your module type
Unfortunately, I just bought a Bluetooth shield, and I could not change the baudrate :frowning.
Although 9600 is not really fast, it will probably not be the cause of the response delay. Your post is unfortunately lacking a bit of detail.
- In your previous topic What is the com port of serial port for Bluetooth for Raspberry Pi you were trying to get Bluetooth working with a Raspberry Pi. Is the Pi still involved? If yes, is it the PC that you mention? Or is the Pi the device that the PC is communicating with? Or is the Pi out of the picture in which case it will be useful to know what the PC is communicating with?
I suggest that you give a good description of your project; please also indicate at which side your Processing application is running and what is running on the other side.
- What kind of messages are you sending? At 9600, one byte takes approximately 1 millisecond to transfer. If you’re transferring the content of a book, it will indeed take time.
- Both sides of the communication channel can slow down communication if you don’t code it correctly (e.g. using some form of delay and other stuff). I suggest that you post the code for the sides of the communication channel that involve code (just in case, please don’t forget to use code tags using the </> button above the composer window on the forum).
To be honest, I don’t know what detail to put, because the only issue i the delay when I press the GUI button in lighting an LED with an Arduino. The GUI is used on a PC or a Raspberry PI.
Regarding the port, the difference between the PI and PC, the PI uses a different port to a PC, and the issue is already solved.
The message I am sending is just a 1 letter string to the Arduino Bluetooth. The Arduino receives the data sent via PC/PI and it works, but the delay when Arduino via Bluetooth responds is not 1 millisecond, it is estimated to be 500millisec to 1 sec. And the 2 devices are just side by side.
The code I used is just a basic code from the samples. I will try recoding if it would make a difference.
Thanks. And there is no delay when you use the Pi?
If there is no delay when using the Pi, it’s caused by the operating system (which one) on the PC and I doubt you can do much about it.
If there is also a delay when using the Pi instead of the PC, there is a chance that it’s your Arduino code.
Lastly have you tried taking the Bluetooth out of the equation by using a USB connection for the serial communication? Do you have a dedicated TTL-to-USB adapter? Or do you have a second Arduino that you can use as a TTL-to-USB adapter? You can hook that up to the Arduino and test.
I have no idea which example that would be? Arduino example? Processing example?
The GUI is used in both. I found the problem, and like you mentioned earlier, why not check the coding? The problem was not from processing, in the baud rate, but how it was coded in the Arduino Ide. I reconstructed the coding format, and the delay was gone.