Bluetooth Shield + Arduino Uno not discoverable!

Thanks a lot strigoi !!

After searching the net for more than 2 hours your code plus explanation did the trick :slight_smile: I now am able to connect my Smartphone (Sony Xperia Z) to the Arduino UNO R3 using the Seeedstudio BT Shield.

I am having another question now about it though,… now the problem with the double blinking of LED D1 (green) I have AFTER disconnecting an APP on my Smartphone. Let me describe it in steps:

  • Disconnect the Arduino UNO from the power supply (in my case the connection with the PC)
  • Upload the code (the one down here from strigoi) to the Arduino UNO R3
  • After the upload process, LED D1 on the BT Shield makes a double blink 2 times. After that LED D1 and D2 (red) start to blink alternately.
  • On the Smartphone open the APP with which you want to connect the shield. In my case I used: Bluetooth SPP Pro. Scan for new devices → the SeeedBT shield will pop up. Connect to it using the standard code 0000.
  • Now only D1 will blink every second 1 time. Also when you connect a LED to port A1 it will now be ON.
  • In the “Byte Stream Mode” of the APP I now can send a 0 or a 1 to the shield which will put OFF or ON LED 13 on the Arduino UNO.
    === Up till here everything works perfectly!
  • Next thing I do is closing the APP on my Smartphone → LED connected to A1 goes OFF, which it should because there is no connection anymore between the Shield and another device. BUT now D1 (green) on the Shield makes the double blink again every second, and there is NO chance anymore to reconnect to the shield again → It is not visible anymore on my Smartphone.

How can I solve this that after the Shield gets disconnected it can be reconnected at another moment in time? I would expect the behavior as follows: when disconnecting the APP from the Shield, LEDs D1 and D2 would start alternating again.

Many thanks in advance!

Pieter