volca / BlueDuino

The BlueDuino is an Arduino compatible microcontroller development board based on the ATmega32U4 IC with Bluetooth 4.0. a.k.a. Bluetooth Low Energy (BLE), built in. It's based on Pro Micro designed by Sparkfun Electronics. It is based around the Arduino Leonardo which means you no longer need an addition USB-Serial Interface to program your Arduino. Just plug in the board, download the addition Arduino add-on and your ready to start programming! It's the easiest way to get Bluetooth 4.0 in your project!.
13 stars 4 forks source link

BlueDuino firmware needed #3

Closed velocipedecreative closed 10 years ago

velocipedecreative commented 10 years ago

Managed to soft-brick my BlueDuino and had to flash the bootloader to get it running again. I was successful with the Sparkfun Pro Micro 3.3V/8MHz image, but I haven't been able to send or receive any data through the BTE module. I'd rather start with your original BlueDuino firmware image. I didn't see it in Github anywhere. Is there a board support package for the Arduino IDE I can download?

Thanks.

velocipedecreative commented 10 years ago

Update: I am able to talk to the BTE module using serial_test, but it will only take AT+NAME[name]. It won't respond to any other AT commands. It's not connected to any phone.

Thanks for the help!

volca commented 10 years ago

Please try the AT command

AT+VERS?

It will show the firmware version. I'd like to know the current firmware version in your hand.

BTW: What name is the BLE module?

velocipedecreative commented 10 years ago

I never get a response. Even a simple "AT" doesn't get an "OK" back.

Module name comes up as BlueShield on my phone when it connects. UUID is null.

volca commented 10 years ago

Could you please paste the code for serial_test? The default sketch should be the code for software serial port.

Did you test it with the Serial Monitor from Arduino IDE?

velocipedecreative commented 10 years ago

Thanks so much for your help on this.

Yes, I've been using the Arduino Serial Monitor to send and receive.

Here's the code:

#include <SoftwareSerial.h>

// Blueduino comunicate with BLE module through pin11, pin12 as soft serial.
SoftwareSerial mySerial(11, 12); //RX,TX

int RXLED = 17;

String tmp; 

void setup() {
  pinMode(RXLED,OUTPUT);
  // It's just for test with "Serial Monitor" of Arduino IDE. It can be removed.
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  Serial.println("hello!");

  // Start soft serial
  mySerial.begin(9600); 
};

void loop() {
  // Read soft serial
  while (mySerial.available() > 0)  {
    tmp += char(mySerial.read());
    delay(2);
  }

  // If it got data from soft serial port then display on "Serial Monitor"
  if(tmp.length() > 0) {
    Serial.println(tmp);
    tmp = "";
  }

  // If it got data from hard serial port, then write data to soft serial port.
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}
volca commented 10 years ago

The firmware BlueShield does not support the upgrade function.

Did you test the BLE communication with the app LightBlue? The characteristic for RX/TX is

RX characteristic: D3E60004-8F36-40D6-B2D5-C5D9F5E81869
TX characteristic: D3E60005-8F36-40D6-B2D5-C5D9F5E81869

It only 4 AT commands.

You can found the description here: http://wiki.viewc.com/cc2540-module.html

velocipedecreative commented 10 years ago

Just tested the board out with LightBlue on an iPhone 5S and it's working fine. I can send and receive data from both sides with no issues.

Resolution for the AT commands failing: The shield firmware requires a termination character for all commands (I could see it was stripping off the last character from AT+NAME commands). Adding either a CR or LF caused all 4 AT commands to work. Having "No line ending" set in Serial Monitor was the reason AT commands were failing. Simply setting to "Newline", "Carriage Return" or "Both NL & CR" fixes the issue.

Appreciate all the help. I'll close this one out.

volca commented 10 years ago

the previous firmware have some issues with the AT commands.

Thank you for your information.