Page 2 of 5

Re: Need help for Bluebee module

PostPosted: Thu Dec 03, 2015 10:37 am
by hiphop9686
Is there any coding for Arduino connect with Bluebee and Xbee shield to get RSSI value periodically? I got no idea how to add the coding to the Bluebee example :| . Anyone can give me some advises or idea?

Re: Need help for Bluebee module

PostPosted: Thu Dec 03, 2015 10:39 am
by hiphop9686
Is there any coding to get RSSI value for Bluebee 4.0 that connect with Xbee to Arduino? Because I got no idea how to start the coding. :(

Re: Need help for Bluebee module

PostPosted: Thu Dec 03, 2015 11:48 am
by Apis210
Hi. I think you need to explore the library. They already got getRSSI() function in the library. :ugeek:

Re: Need help for Bluebee module

PostPosted: Thu Dec 03, 2015 2:10 pm
by hiphop9686
Yeah, I aware of that. Just that I don know how to start the coding using the library provided.

Re: Need help for Bluebee module

PostPosted: Thu Dec 03, 2015 9:27 pm
by ober
Advise, do some simple task, try it, fail, try another method, fail, try it again.

Re: Need help for Bluebee module

PostPosted: Thu Dec 03, 2015 9:48 pm
by bengchet
Hi,

You can try modify the BlueBeeInfo example sketch. If you have setup your BlueBee 4.0 before, actually you can just remove unnecessary functions like bluebee.setBLEName, etc.

Important functions are just following.

HM12 bluebee(rx,tx); // rx and tx are just like softwareSerial rx and tx, depends on your connection
bluebee.begin(your_baudrate);

When Bluebee is connected to other device, you can declare a integer variable like int rssi = bluebee.getRssI(); and you will get the value in return. Normally it should be negative value, if it gives value 9999,9998 or 9997, it means error.

Error:
9999 - No connection.
9998 - Try later.
9997 - Read error.

Well as for how to do it periodically, that is how you manage the coding, it is art of programming at all :D

Have fun exploring and learning and dare to try anything!! ;)

Re: Need help for Bluebee module

PostPosted: Mon Dec 07, 2015 9:48 am
by hiphop9686
Thanks.

Btw, is the bluebeeinfo example sketch is for Bluebee EDR mode only? or it can work in both EDR and BLE mode?

And if i had connected Bluebee to my smartphone, is it able to return the value to the app that provided ?

Re: Need help for Bluebee module

PostPosted: Mon Dec 07, 2015 11:24 am
by hiphop9686
Am I able to send anything from bluebee to the connected device while the Bluebee is USB connected to pc ? or do i need to detach the bluebee from pc with usb and connect to power supply, then the bluebee able to send data to the connected device?

And I had declare the RSSI, the return value will be shown in arduino serial monitor or the bluetooth app provided in the smartphone?

CODE: SELECT_ALL_CODE
#include <HM12.h>
#include <SoftwareSerial.h>

HM12 bluebee(2,3);

void setup() {
  Serial.begin(115200);
 bluebee.begin(115200);
 

  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
 
delay(1000);
bluebee.print("hello");  //testing, to see bluebee able to send hello to the connected device

if(bluebee.available()>0)
{
int rssi= bluebee.getRSSI();  //declare rssi

while(bluebee.available())
{
rssi=bluebee.read();
bluebee.print("RSSI=");
bluebee.print(rssi);
delay(2000);


}
}
bluebee.end();

}


This is my coding. My smartphone unable to receive anything from Bluebee. However, I can use AT command in the smartphone app.
Btw, I am using arduino uno microcontroller with XBEE shield.

Re: Need help for Bluebee module

PostPosted: Tue Dec 08, 2015 11:34 am
by hiphop9686
Here is another coding I trying currently.

CODE: SELECT_ALL_CODE
#include <HM12.h>
#include <SoftwareSerial.h>

HM12 BlueBee(2,3);
void setup() {
  Serial.begin(115200);
  BlueBee.begin(115200);

  // put your setup code here, to run once:
}

void loop() {
 
  // put your main code here, to run repeatedly:


 delay(3000);
 
int rssi= BlueBee.getRSSI();
Serial.println(rssi);
 }




It able to show the value, but the value is always 0. I did connected BlueBee to my smartphone. But it also show 0 value all the time.

Re: Need help for Bluebee module

PostPosted: Tue Dec 08, 2015 11:50 am
by bengchet
Hi,

Yes. You will get value 0 due to getRSSI function only works if BlueBee4.0 connects to another BlueBee4.0 module. However, you can send getRSSI AT command from smartphone to BlueBee4.0, you should be able to get RSSI value.