Help ! HC05 error 507

Hi all
I am a newbie. I have problem with Bluetooth HC05
I paired with my phone ok . but I connect >> Error 507
Code my phone : Pic attach
code Arduino :
int led13=13;
int estado=0;

void setup(){

pinMode(led13, OUTPUT);

Serial.println("Goodnight moon!");
void loop(){
void dkled()
estado =;
if(estado == '1'){
if(estado == '2'){


Thank for your help !

The error 507 sounds more like a PC error than a phone error. Either way, I believe it has nothing to do with HC-05. The code compiles but it is junk because it specifically doesn't do anything other than say goodnight moon, once, which I assume it does OK, but is not the cause of the error. You should try using a standard Android terminal until you know what you are doing. Some homebrew thing simply adds to the confusion and may actually be part of the problem.

You might find the following background notes useful.

which at least does something more useful than flashing a LED.

I solved my problem.
It's my phone.
Thank anyway !