Go Down

Topic: [Solved] ITead Studio Bluetooth Shield v2.2 - How to work with AT-Command? (Read 11822 times) previous topic - next topic



I try to use the ITead Studio Bluetooth Shield v2.2 [1] with my DFRduino Nano v3. I wired up GND and 5V to the shield and Connected TX to D5 and RX to D4 and use SoftSerial to communicate with the shield.
Then I installed the ITEAD BT Debugging Assistant [2] (a tool that lets you set up a serial connection with the shield over bluetooth) on my mobile phone.
The shield has a DAT/CMD switch. When it is set to DAT everything works as expected. When I open the serial monitor from the Arduino software, the text I write there appears on my mobile and vice versa.

But now I wanted to change the Name, the shield identifies with.
Like the datasheet tells, I put the switch to CMD-mode.
Then with "AT+NAME?" in the serial monitor, I expected it to return the current device name, but it doesn't. I'm not seeing any reaction in the serial monitor.
Also, when it's in the CMD-mode it disconnects my phone and I am not able to find it with bluetooth anymore.

Does anyone here own the shield and can help me to solve this problem?
I am using Kubuntu 11.10 with Arduino 1.0 from the Debian Repository, but I'm not sure if it's important.

Here is the sketch, simply passing bytes from one serial connection to the other:
Code: [Select]

#include <SoftwareSerial.h>

#define BT_TX 4
#define BT_RX 5

SoftwareSerial mySerial(BT_RX, BT_TX);

void setup()
 pinMode(13, OUTPUT);

void loop()
 if ( mySerial.available() )
   Serial.write( mySerial.read() );
 if ( Serial.available() )
   mySerial.write( Serial.read() );

[1] http://iteadstudio.com/product/arduino-bluetooth-shield-upgrade-to-v2-2/
[2] http://iteadstudio.com/application-note/make-arduino-talk-with-android-by-bluetooth/



Sounds a bit strange...

Also, when it's in the CMD-mode it disconnects my phone and I am not able to find it with bluetooth anymore.

When in the CMD-mode does it disconnect you?

Sure you are doing it right?

1) Power off
2) Put in CMD-mode
3) Power on - connect to it
4) Type "AT+NAME?" (remember "/r/n" (enter))

How about if you just change the name? Same thing?


Well, I think I have not pointed this out clearly.
When I switch to CMD, I do the folliwing
1) Set the hardware switch
2) press reset button on shield -> mobile disconnects and is no longer able to find the shield

Then I opened the serial monitor, set line endings to CR+LF and typed AT+NAME? (enter) the RX-LED on the nano flashes and then nothing happens.
I would expect to get the name "Itead" printed out.

I also tried minicom and PuTTY. Even under Windows 7 (I thought it might be an issue with the line endings) I had no success with the Serial Monitor in the Arduino software.

The same thing happens if I completely disconnect the nano from USB after setting the switch.

Also, when in DAT-mode the status-LED flashes fast (2 in 1s) and when in CMD-mode it gets really slow (1 in 2s) but according to the datasheet this behaviour seems normal to me.


So, problem seems to be solved!

I uploaded the minimal sketch to my Arduino Uno so that RX/TX are free. Then put the shield on top and set the jumpers to use D0 as RX and D1 as TX, just like the Atmel on the Arduino board. And now under Windows with 38400 Baud it worked!

Hope this helps maybe someone else who is struggling with the shield!
But I still have no clue why this did not work with Linux.


yes I know how to solve your problem. whenever you introduce CMD mode, you are no longer in Slave mode, and hence no other gadget can reach you. you use CMD mode if you want to turn your shield into MASTER mode, or just give commands to it. that's why it happens to you.

Go Up