Bluetooth configuration problem Hc-05 with Arduino












1















I'm trying to set up my Bluetooth HC-05 but I'm having problems. I am using an Arduino Uno and I connect the bluetooth TX and RX cables to 0 and 1 of the Arduino. The code I am using is the following:



#include <SoftwareSerial.h>
SoftwareSerial BT(0,1);
void setup()
{
Serial.begin(9600);
BT.begin(38400);
Serial.println("Introduzca un comando:");
}
void loop()
{
if(BT.available())
{
Serial.write(BT.read());
}
if(Serial.available())
{
BT.write(Serial.read());
}
}


The problem comes when I open the serial monitor to send AT commands but I do not receive the correct message, I receive the following image.



https://drive.google.com/file/d/1StjO7i8S_lsV39meM8L2SeVMe-TT-ZPb/view?usp=sharing



I first show a message but when I enter the AT command, instead of receiving OK I receive xxxo. I suppose it is due to the bauds but I do not know how to put them, because the bluetooth I use was left to me and apparently it is already configured and I want to make changes, but it does not show me AT messages in a visible way.










share|improve this question



























    1















    I'm trying to set up my Bluetooth HC-05 but I'm having problems. I am using an Arduino Uno and I connect the bluetooth TX and RX cables to 0 and 1 of the Arduino. The code I am using is the following:



    #include <SoftwareSerial.h>
    SoftwareSerial BT(0,1);
    void setup()
    {
    Serial.begin(9600);
    BT.begin(38400);
    Serial.println("Introduzca un comando:");
    }
    void loop()
    {
    if(BT.available())
    {
    Serial.write(BT.read());
    }
    if(Serial.available())
    {
    BT.write(Serial.read());
    }
    }


    The problem comes when I open the serial monitor to send AT commands but I do not receive the correct message, I receive the following image.



    https://drive.google.com/file/d/1StjO7i8S_lsV39meM8L2SeVMe-TT-ZPb/view?usp=sharing



    I first show a message but when I enter the AT command, instead of receiving OK I receive xxxo. I suppose it is due to the bauds but I do not know how to put them, because the bluetooth I use was left to me and apparently it is already configured and I want to make changes, but it does not show me AT messages in a visible way.










    share|improve this question

























      1












      1








      1








      I'm trying to set up my Bluetooth HC-05 but I'm having problems. I am using an Arduino Uno and I connect the bluetooth TX and RX cables to 0 and 1 of the Arduino. The code I am using is the following:



      #include <SoftwareSerial.h>
      SoftwareSerial BT(0,1);
      void setup()
      {
      Serial.begin(9600);
      BT.begin(38400);
      Serial.println("Introduzca un comando:");
      }
      void loop()
      {
      if(BT.available())
      {
      Serial.write(BT.read());
      }
      if(Serial.available())
      {
      BT.write(Serial.read());
      }
      }


      The problem comes when I open the serial monitor to send AT commands but I do not receive the correct message, I receive the following image.



      https://drive.google.com/file/d/1StjO7i8S_lsV39meM8L2SeVMe-TT-ZPb/view?usp=sharing



      I first show a message but when I enter the AT command, instead of receiving OK I receive xxxo. I suppose it is due to the bauds but I do not know how to put them, because the bluetooth I use was left to me and apparently it is already configured and I want to make changes, but it does not show me AT messages in a visible way.










      share|improve this question














      I'm trying to set up my Bluetooth HC-05 but I'm having problems. I am using an Arduino Uno and I connect the bluetooth TX and RX cables to 0 and 1 of the Arduino. The code I am using is the following:



      #include <SoftwareSerial.h>
      SoftwareSerial BT(0,1);
      void setup()
      {
      Serial.begin(9600);
      BT.begin(38400);
      Serial.println("Introduzca un comando:");
      }
      void loop()
      {
      if(BT.available())
      {
      Serial.write(BT.read());
      }
      if(Serial.available())
      {
      BT.write(Serial.read());
      }
      }


      The problem comes when I open the serial monitor to send AT commands but I do not receive the correct message, I receive the following image.



      https://drive.google.com/file/d/1StjO7i8S_lsV39meM8L2SeVMe-TT-ZPb/view?usp=sharing



      I first show a message but when I enter the AT command, instead of receiving OK I receive xxxo. I suppose it is due to the bauds but I do not know how to put them, because the bluetooth I use was left to me and apparently it is already configured and I want to make changes, but it does not show me AT messages in a visible way.







      bluetooth arduino arduino-uno baud-rate






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 22:16









      josejose

      62




      62
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Could you please try the following:




          1. Configure the SoftwareSerial on 2 other pins rather than 0 and 1, because these are the UART pins of the Arduino Uno, maybe try SoftwareSerial(5,6)


          2. Change the baud rate of the arduino Serial to 38400 in order to match the BT baud rate







          share|improve this answer


























          • Ok, I have already solved it, it was also because I had to put the KEY bluetooth pin to high (1), it would be as follows: void setup() { Serial.begin(38400); // Inicializamos el puerto serie pinMode(9,OUTPUT); digitalWrite(9,HIGH); Serial.println("Introduzca un comando:"); BT.begin(38400); // Inicializamos el puerto serie BT (Para Modo AT 2) }

            – jose
            Nov 17 '18 at 11:24













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328666%2fbluetooth-configuration-problem-hc-05-with-arduino%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Could you please try the following:




          1. Configure the SoftwareSerial on 2 other pins rather than 0 and 1, because these are the UART pins of the Arduino Uno, maybe try SoftwareSerial(5,6)


          2. Change the baud rate of the arduino Serial to 38400 in order to match the BT baud rate







          share|improve this answer


























          • Ok, I have already solved it, it was also because I had to put the KEY bluetooth pin to high (1), it would be as follows: void setup() { Serial.begin(38400); // Inicializamos el puerto serie pinMode(9,OUTPUT); digitalWrite(9,HIGH); Serial.println("Introduzca un comando:"); BT.begin(38400); // Inicializamos el puerto serie BT (Para Modo AT 2) }

            – jose
            Nov 17 '18 at 11:24


















          0














          Could you please try the following:




          1. Configure the SoftwareSerial on 2 other pins rather than 0 and 1, because these are the UART pins of the Arduino Uno, maybe try SoftwareSerial(5,6)


          2. Change the baud rate of the arduino Serial to 38400 in order to match the BT baud rate







          share|improve this answer


























          • Ok, I have already solved it, it was also because I had to put the KEY bluetooth pin to high (1), it would be as follows: void setup() { Serial.begin(38400); // Inicializamos el puerto serie pinMode(9,OUTPUT); digitalWrite(9,HIGH); Serial.println("Introduzca un comando:"); BT.begin(38400); // Inicializamos el puerto serie BT (Para Modo AT 2) }

            – jose
            Nov 17 '18 at 11:24
















          0












          0








          0







          Could you please try the following:




          1. Configure the SoftwareSerial on 2 other pins rather than 0 and 1, because these are the UART pins of the Arduino Uno, maybe try SoftwareSerial(5,6)


          2. Change the baud rate of the arduino Serial to 38400 in order to match the BT baud rate







          share|improve this answer















          Could you please try the following:




          1. Configure the SoftwareSerial on 2 other pins rather than 0 and 1, because these are the UART pins of the Arduino Uno, maybe try SoftwareSerial(5,6)


          2. Change the baud rate of the arduino Serial to 38400 in order to match the BT baud rate








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 16 '18 at 12:49









          Juraj

          369311




          369311










          answered Nov 15 '18 at 22:40









          Abanoub MamdouhAbanoub Mamdouh

          115




          115













          • Ok, I have already solved it, it was also because I had to put the KEY bluetooth pin to high (1), it would be as follows: void setup() { Serial.begin(38400); // Inicializamos el puerto serie pinMode(9,OUTPUT); digitalWrite(9,HIGH); Serial.println("Introduzca un comando:"); BT.begin(38400); // Inicializamos el puerto serie BT (Para Modo AT 2) }

            – jose
            Nov 17 '18 at 11:24





















          • Ok, I have already solved it, it was also because I had to put the KEY bluetooth pin to high (1), it would be as follows: void setup() { Serial.begin(38400); // Inicializamos el puerto serie pinMode(9,OUTPUT); digitalWrite(9,HIGH); Serial.println("Introduzca un comando:"); BT.begin(38400); // Inicializamos el puerto serie BT (Para Modo AT 2) }

            – jose
            Nov 17 '18 at 11:24



















          Ok, I have already solved it, it was also because I had to put the KEY bluetooth pin to high (1), it would be as follows: void setup() { Serial.begin(38400); // Inicializamos el puerto serie pinMode(9,OUTPUT); digitalWrite(9,HIGH); Serial.println("Introduzca un comando:"); BT.begin(38400); // Inicializamos el puerto serie BT (Para Modo AT 2) }

          – jose
          Nov 17 '18 at 11:24







          Ok, I have already solved it, it was also because I had to put the KEY bluetooth pin to high (1), it would be as follows: void setup() { Serial.begin(38400); // Inicializamos el puerto serie pinMode(9,OUTPUT); digitalWrite(9,HIGH); Serial.println("Introduzca un comando:"); BT.begin(38400); // Inicializamos el puerto serie BT (Para Modo AT 2) }

          – jose
          Nov 17 '18 at 11:24






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328666%2fbluetooth-configuration-problem-hc-05-with-arduino%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          The Sandy Post

          Danny Elfman

          Pages that link to "Head v. Amoskeag Manufacturing Co."