CZ-HC-05 HC-05 Bluetooth module not working with RoboRemo android app

I'm having trouble with sending commands to my arduino uno using a CZ-HC-05. It connects ok but no buttons/commands work using the RoboRemo app. I've tried different baud rates (changed in AT mode) and then changing the value in the arduino sketch (Bluetooth Led) to no avail. Other things I've tried, different RX TX pins, and unplugging the HC-05 while uploading the sketch.

I did however get it to work with the Ardudroid app so my HC-05 is working. I just want a customizable app with sliders to control two DC motors and RoboRemo seems to do that.

Maybe stop bits and parity? how many stop bits, parity?
115200, 1 stop bit, 0 parity enter: "AT+UART=115200,1,0"

RoboRemo website: Bluetooth LED project
http://www.roboremo.com/arduino-bluetooth-led.html

sketch_bluetooth_led.ino (1.28 KB)

None of your solutions will fix anything and may make a bad situation worse. You should never need to change the stop and parity, or even know how to do it. If you have changed it at all, it is best that you reset to default.

The only time you need to unplug the HC-05 while uploading is when you are using hardware serial pins 0,1.

I believe the most likely problem is that you are running at 115200 while using software serial. I bet you don't have a good reason for using either. If you really need to run at 115k, do it with hardware serial. If you really need to use software serial, run bluetooth at 9600. You will probably find verification in the Ardudroid app which worked OK..

Please post your code in the proper manner using the </> tags. Attaching it in the way you have is faintly insulting.

Well I have it working now so in case someone else comes across this, I set the baud rate for the bluetooth device to 9600,1,0 and it then worked with the sketch below. After resetting and checking my CZ-HC-05 I found the default setting was 38400.

The "bluetooth.begin(115200)" and "bluetooth.begin(9600)" confused me though.

// Control Arduino led over Bluetooth using RoboRemo app
// www.roboremo.com

// Hardware setup:
// BT module   Arduino
// GND ------- GND
// VCC ------- 5V
// TX-O ------ pin2
// RX-I ------ pin3

// Arduino UNO already has an LED attached to pin 13

#include <SoftwareSerial.h>  

int bluetoothTx = 2;
int bluetoothRx = 3;

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

int led = 13;

char cmd[100];
int cmdIndex;


void exeCmd() {
  
  // "led" is the led id
  
  if(strcmp(cmd, "led 0")==0) digitalWrite(led, LOW);
  if(strcmp(cmd, "led 1")==0) digitalWrite(led, HIGH);
}


void setup() {
  
  delay(500); // wait for bluetooth module to start

  bluetooth.begin(115200); // Bluetooth default baud is 115200
  
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$"); // enter cmd mode
  delay(250);  
  bluetooth.println("U,9600,N"); // change baud to 9600
  
  bluetooth.begin(9600);
  
  pinMode(led, OUTPUT);
  digitalWrite(led, LOW);
  
  cmdIndex = 0;
}


void loop() {
  
  if(bluetooth.available()) {
    
    char c = (char)bluetooth.read();
    
    if(c=='\n') {
      cmd[cmdIndex] = 0;
      exeCmd();  // execute the command
      cmdIndex = 0; // reset the cmdIndex
    } else {      
      cmd[cmdIndex] = c;
      if(cmdIndex<99) cmdIndex++;
    }
    
  }
  
}

of any android this code work, i do that on android 4.1.2 but no connect on ch 06