Skip to main content
Tweeted twitter.com/#!/StackRobotics/status/435769937911873538
deleted 14 characters in body
Source Link
Shahbaz
  • 3.3k
  • 1
  • 21
  • 38

I am working right now with Arduino UNO and HC-05 bluetooth module.I followed the instruction given on this link for wiring.So So there are 2 mode of working with this HC-05 module

i) Simple serial communication ii) working in AT command mode so as to change the parameters of HC-05 module

  1. Simple serial communication
  2. Working in AT command mode so as to change the parameters of HC-05 module

As long as iI work in simple serial communication mode, everything workworks fine but when iI tried to change the parameters of module, it didn't workedwork out.FOr For working in At command mode, PIN NO 34 of HC-05 module needneeds to be high and iwhich I had taken care of.Lately i find Lately I found that in mu module they had knowingly not connected the Berg strip to PIN 34  , so iI connected the PIN directly, even thought ithough I am not able to change the parameters of moduelmodule and when iI write any command on COM port of arduino IDE, iI get this response

Enter AT commands:
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^

I think that garbage is due to my code

and hereHere is my code:

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
  pinMode(9, OUTPUT);  
  digitalWrite(9, HIGH);
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(38400);  
}

void loop()
{
  uint8_t x;
  char CommandFromSerial[50]=" ";
  char ResponseFromBluetooth[50]= " ";
   
  if ((Serial.available())){
    if(Serial.available()>0){
      for(x=0;x<50;x++){
        CommandFromSerial[x]=Serial.read();}
      BTSerial.println(CommandFromSerial);}
}
    
 }
  }

  if ((BTSerial.available())){
    if(BTSerial.available()>0){
      for(x=0;x<50;x++){
        ResponseFromBluetooth[x]=BTSerial.read();}}
    Serial.println(ResponseFromBluetooth);}
    
 }
}

I am not able to figure out what iI am doing wrong. iI used this command on COM port AT\r\nAT\r\n and many other commands but everytime ievery time I get the same response.

Did i had messedI mess up with my bluetooth module unknowingly?

I am working right now with Arduino UNO and HC-05 bluetooth module.I followed the instruction given on this link for wiring.So there are 2 mode of working with this HC-05 module

i) Simple serial communication ii) working in AT command mode so as to change the parameters of HC-05 module

As long as i work in simple serial communication mode, everything work fine but when i tried to change the parameters of module, it didn't worked out.FOr working in At command mode, PIN NO 34 of HC-05 module need to be high and i had taken care of.Lately i find that in mu module they had knowingly not connected the Berg strip to PIN 34  , so i connected the PIN directly, even thought i am not able to change the parameters of moduel and when i write any command on COM port of arduino IDE, i get this response

Enter AT commands:
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^

I think that garbage is due to my code

and here is my code

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
  pinMode(9, OUTPUT);  
  digitalWrite(9, HIGH);
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(38400);  
}

void loop()
{uint8_t x;
 char CommandFromSerial[50]=" ";
 char ResponseFromBluetooth[50]= " ";
   
  if ((Serial.available())){
    if(Serial.available()>0){
  for(x=0;x<50;x++){
  CommandFromSerial[x]=Serial.read();}
BTSerial.println(CommandFromSerial);}
}
    
 
 
  if ((BTSerial.available())){
    if(BTSerial.available()>0){
  for(x=0;x<50;x++){
  ResponseFromBluetooth[x]=BTSerial.read();}}
Serial.println(ResponseFromBluetooth);}
    
 
}

I am not able to figure out what i am doing wrong. i used this command on COM port AT\r\n and many other commands but everytime i get the same response.

Did i had messed up with my bluetooth module unknowingly?

I am working right now with Arduino UNO and HC-05 bluetooth module.I followed the instruction given on this link for wiring. So there are 2 mode of working with this HC-05 module

  1. Simple serial communication
  2. Working in AT command mode so as to change the parameters of HC-05 module

As long as I work in simple serial communication mode, everything works fine but when I tried to change the parameters of module, it didn't work out. For working in At command mode, PIN NO 34 of HC-05 module needs to be high which I had taken care of. Lately I found that in mu module they had knowingly not connected the Berg strip to PIN 34, so I connected the PIN directly, even though I am not able to change the parameters of module and when I write any command on COM port of arduino IDE, I get this response

Enter AT commands:
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^

I think that garbage is due to my code

Here is my code:

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
  pinMode(9, OUTPUT);  
  digitalWrite(9, HIGH);
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(38400);  
}

void loop()
{
  uint8_t x;
  char CommandFromSerial[50]=" ";
  char ResponseFromBluetooth[50]= " ";
   
  if ((Serial.available())){
    if(Serial.available()>0){
      for(x=0;x<50;x++)
        CommandFromSerial[x]=Serial.read();
      BTSerial.println(CommandFromSerial);
    }
  }

  if ((BTSerial.available())){
    if(BTSerial.available()>0)
      for(x=0;x<50;x++)
        ResponseFromBluetooth[x]=BTSerial.read();
    Serial.println(ResponseFromBluetooth);
  }
}

I am not able to figure out what I am doing wrong. I used this command on COM port AT\r\n and many other commands but every time I get the same response.

Did I mess up with my bluetooth module unknowingly?

Source Link
shailendra
  • 327
  • 2
  • 6
  • 14

Bluetooth module HC-05 giving ERROR :(0)

I am working right now with Arduino UNO and HC-05 bluetooth module.I followed the instruction given on this link for wiring.So there are 2 mode of working with this HC-05 module

i) Simple serial communication ii) working in AT command mode so as to change the parameters of HC-05 module

As long as i work in simple serial communication mode, everything work fine but when i tried to change the parameters of module, it didn't worked out.FOr working in At command mode, PIN NO 34 of HC-05 module need to be high and i had taken care of.Lately i find that in mu module they had knowingly not connected the Berg strip to PIN 34 , so i connected the PIN directly, even thought i am not able to change the parameters of moduel and when i write any command on COM port of arduino IDE, i get this response

Enter AT commands:
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^

I think that garbage is due to my code

and here is my code

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
  pinMode(9, OUTPUT);  
  digitalWrite(9, HIGH);
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(38400);  
}

void loop()
{uint8_t x;
 char CommandFromSerial[50]=" ";
 char ResponseFromBluetooth[50]= " ";
   
  if ((Serial.available())){
    if(Serial.available()>0){
  for(x=0;x<50;x++){
  CommandFromSerial[x]=Serial.read();}
BTSerial.println(CommandFromSerial);}
}
    

 
  if ((BTSerial.available())){
    if(BTSerial.available()>0){
  for(x=0;x<50;x++){
  ResponseFromBluetooth[x]=BTSerial.read();}}
Serial.println(ResponseFromBluetooth);}
    

}

I am not able to figure out what i am doing wrong. i used this command on COM port AT\r\n and many other commands but everytime i get the same response.

Did i had messed up with my bluetooth module unknowingly?