How to get the JY-MCU bt board to work

Alright that's good that you got it communicating with you with AT commands. In my case when I sent AT+VERSION I got "linvor 1.5". If you get the version working then this might be different. Did you try the AT commands without the plus, like "ATVERSION"?

orangeLearner:
Alright that's good that you got it communicating with you with AT commands. In my case when I sent AT+VERSION I got "linvor 1.5". If you get the version working then this might be different. Did you try the AT commands without the plus, like "ATVERSION"?

Did not work either.

Do we have the same board? Mine says JY-MCU BT_BOARD 1.02. If it is the same board then I do not know how to proceed save for searching online.

orangeLearner:
Do we have the same board? Mine says JY-MCU BT_BOARD 1.02. If it is the same board then I do not know how to proceed save for searching online.

I have same board (JY-MCU BT_BOARD V1.02), but here: http://www.ebay.com/itm/150763254858 says that default baud rate is 9600 and I tried with 38400 and 9600 and it works only with 9600.
But another problem: when I type AT I get OK, but when I type AT+VERSION (or ATVERSION, like You said before) I get nothing.
Maybe You connected State or Key pins on BT board?
Thanks!

Scratchy:

orangeLearner:
Do we have the same board? Mine says JY-MCU BT_BOARD 1.02. If it is the same board then I do not know how to proceed save for searching online.

I have same board (JY-MCU BT_BOARD V1.02), but here: http://www.ebay.com/itm/150763254858 says that default baud rate is 9600 and I tried with 38400 and 9600 and it works only with 9600.
But another problem: when I type AT I get OK, but when I type AT+VERSION (or ATVERSION, like You said before) I get nothing.
Maybe You connected State or Key pins on BT board?
Thanks!

Thats exactly the problem I got to.

Scratchy:
when I type AT I get OK, but when I type AT+VERSION (or ATVERSION, like You said before) I get nothing.

Are you really typing keys with your fingers? If this is the same firmware my board has,
that will never work - it uses timing to decide when it has gotten a message, and no one
can type fast enough for long messages to satisfy it. Try using cut & paste into your
terminal app.

Claghorn:

Scratchy:
when I type AT I get OK, but when I type AT+VERSION (or ATVERSION, like You said before) I get nothing.

Are you really typing keys with your fingers? If this is the same firmware my board has,
that will never work - it uses timing to decide when it has gotten a message, and no one
can type fast enough for long messages to satisfy it. Try using cut & paste into your
terminal app.

I typing commands via Arduino IDE Serial Monitor, so I think it sends whole command with minimal delay, right?

Claghorn:

Scratchy:
when I type AT I get OK, but when I type AT+VERSION (or ATVERSION, like You said before) I get nothing.

Are you really typing keys with your fingers? If this is the same firmware my board has,
that will never work - it uses timing to decide when it has gotten a message, and no one
can type fast enough for long messages to satisfy it. Try using cut & paste into your
terminal app.

Cut and paste doesn't work either, that's the thing.

The serial monitor isn't a very good terminal. It may be sending a CR or LF or both at the end, my JY-MCU doesn't like those either. You need something that sends the last 'N' in version then stops sending :-). (Maybe the serial monitor can be set to no line ending? I forget).

Claghorn:
The serial monitor isn't a very good terminal. It may be sending a CR or LF or both at the end, my JY-MCU doesn't like those either. You need something that sends the last 'N' in version then stops sending :-). (Maybe the serial monitor can be set to no line ending? I forget).

Yes, my serial monitor is set to no line ending.

Finally I changed baud rate with simple TTL to Serial cable connected to BT module. :slight_smile:
And finally uploaded sketch via bluetooth: http://arduino.cc/forum/index.php/topic,110532.0.html :slight_smile:

I have the exact same problem as the people above.

I too have an JY-MCU BT board as found here.

I use the standard SoftwareSerialExample program as found in the Arduino software. I have changed the communication between the JY-MCU and the Arduino to 9600 baud, instead of the 38400 mentioned by orangeLearner.

I then proceed to open up the standard Arduino terminal program, change the baudrate to 57600, and no line ending. I see 'Goodnight moon!'

Then I type 'AT' and press send. An 'OK' returns. All fine and dandy, but other than that AT command, no other AT commands like 'AT+VERSION' work. The module is just sitting there, flashing a red light. My iPhone also can't find any Bluetooth device, no 'Linvor' is showing up.

Can anyone shine a light on this one?

FreeBee:
Then I type 'AT' and press send. An 'OK' returns. All fine and dandy, but other than that AT command, no other AT commands like 'AT+VERSION' work. The module is just sitting there, flashing a red light. My iPhone also can't find any Bluetooth device, no 'Linvor' is showing up.

Can anyone shine a light on this one?

Unfortunately yes: iOS won't talk simple serial bluetooth (RFCOMM) without you paying Apple a gazillion dollars and going through something like a Navy Seal training certification process :-). Either that or rooting your iPhone so you can install the stuff described at:

http://code.google.com/p/btstack/

Claghorn:
Unfortunately yes: iOS won't talk simple serial bluetooth (RFCOMM) without you paying Apple a gazillion dollars and going through something like a Navy Seal training certification process :-). Either that or rooting your iPhone so you can install the stuff described at:

Google Code Archive - Long-term storage for Google Code Project Hosting.

So i'll need another device like an older phone with BT to check wether or not the BT module is broadcasting it's name and/or make connections?

FreeBee:
So i'll need another device like an older phone with BT to check wether or not the BT module is broadcasting it's name and/or make connections?

I guess - I don't think iPhones are missing BT, they just refuses to talk RFCOMM because (for some reason) that's the way Apple wants it. My Android phone works fine talking to my JY-MCU modules as does my linux box with a cheap bluetooth dongle plugged into a USB port (mine was sold by D-link).

I have the same problem with AT commands, only have AT working, non other. Is the problem in the software serial sketch maby? I don't have a usb to ttl board, only a usb to rs232 so I really need make it work over the arduino, any Ideas?

I've already got yhe propper interface and it's working, somehow the sketch for arduino doesnt do the job.

I had the same problems where only the AT command received a response. I have the breakout version 1.03 with firmware version 1.5. Found and changed a simple Arduino sketch to allow AT commands to be sent to the Bluetooth adapter. Simply adding a delay(10) allowed the other commands such as AT+VERSION to get a correct response from the Bluetooth adapter. I used Arduino's serial Monitor to send all the commands. This is based on the code in the link provided earlier in this thread. Hope this is useful to some!

Link to the code: http://eclipse.clinertech.com/arduino/bluetooth/blth.html

augustinoy:
I have the same problem with AT commands, only have AT working, non other. Is the problem in the software serial sketch maby? I don't have a usb to ttl board, only a usb to rs232 so I really need make it work over the arduino, any Ideas?

Poppin, your code works with me. Something in the example code makes it unable to get a response from any other AT command. Nice job, it works here.

Links with the AT commands.

http://eclipse.clinertech.com/arduino/bluetooth/Bluetooth_AT_Commands.txt

Two key pieces of information I wish I knew when I started.

  1. AT commands DO NOT work when the device is paired.
  2. SoftwareSerial doesn't work past 9600 BAUD.

WARNING: Setting the BAUD Rate too high will essentially lock you out of the chip if you don't have hardware that can send/recieve at that baud rate...

This code above worked for me very well >.> until I changed the BAUD rate using AT+BAUD8
Now it's stopped responding to AT commands. ( I did recompile my sketch to use the new baud rate 115200)
There is a "STATE" Pin that I found on Krill Labs - Using the BT Board v1.02 JY-MCU
that says that will toggle it between AT command mode and regular work but I think maybe a 10k resistor is too much since I'm only running on 5V

I've also discovered that delay rates of tx/rx stuff changes pending on baud rate so maybe I'm failing there somehow. I was reading the SofwareSerial.cpp file and some other sources said timing is pretty important for this but unsure exactly how to calc it.

At one point I did have my snes controller -> Arduino Mega -> BlueTooth module -> custom compiled SNES9x >.> but I wanted faster response times.

Things would lock up alot and I got a reset procedure down.
Remove the pairing (ubuntu 12.04 LTS)
Reboot box
hcitool scan
rfcomm bind 0 00:12:02:28:71:34 1
screen /dev/rfcomm0 9600 #This will prompt you for the pairing password and I also noticed the LED went solid rather than blinky.
screen /dev/rfcomm0 9600
rfcomm release 00:12:02:28:71:34

UPDATE:

Got it working again, I switched to hardware tx3/rx3 then I cycled through every baud rate until I saw the right output, aparently I set it to 57600

run the following just once after boot, and note AT commands cannot be run after this is paired
hcitool scan
rfcomm bind 0 00:12:02:28:71:34 1

#Upload this test code
void setup() {
Serial3.begin(57600);
}

void loop() {
Serial3.write("test\r\n");
delay(1000);
}

command line test
screen /dev/rfcomm0 57600 #cycle through all baud rates until you see the plain text "test" string

I re uploaded the sketch every time but when I hit 57600 I just decided to re run screen without the upload and it worked >.> so maybe it doesn't matter or maybe that fixed it.

Once I saw the plain text I CTRL-A-k out of screen

rfcomm release 00:12:02:28:71:34 #If you don't release the pairing AT commands don't work!

Then upload the following code

String command = "";
void setup() {
Serial.begin(115200);
Serial3.begin(57600);
Serial.println("Type AT commands!");
}

void loop(){
if (Serial3.available()) {
while(Serial3.available()) { command += (char)Serial3.read();delay(10); }
Serial.println(command);
command = ""; // No repeats
}
if (Serial.available()){ delay(20); Serial3.write(Serial.read()); }
}

screen /dev/ttyACM0 115200 #Begin typing AT commands.