Need help for Bluebee module

Bluetooth, XBee, RF......

Re: Need help for Bluebee module

Postby hiphop9686 » Thu Dec 03, 2015 10:37 am

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?
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Need help for Bluebee module

Postby hiphop9686 » Thu Dec 03, 2015 10:39 am

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. :(
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Need help for Bluebee module

Postby Apis210 » Thu Dec 03, 2015 11:48 am

Hi. I think you need to explore the library. They already got getRSSI() function in the library. :ugeek:
Apis210
Apprentice
 
Posts: 32
Joined: Tue Dec 01, 2015 4:13 pm

Re: Need help for Bluebee module

Postby hiphop9686 » Thu Dec 03, 2015 2:10 pm

Yeah, I aware of that. Just that I don know how to start the coding using the library provided.
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Need help for Bluebee module

Postby ober » Thu Dec 03, 2015 9:27 pm

Advise, do some simple task, try it, fail, try another method, fail, try it again.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Need help for Bluebee module

Postby bengchet » Thu Dec 03, 2015 9:48 pm

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!! ;)
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Need help for Bluebee module

Postby hiphop9686 » Mon Dec 07, 2015 9:48 am

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 ?
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Need help for Bluebee module

Postby hiphop9686 » Mon Dec 07, 2015 11:24 am

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.
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Need help for Bluebee module

Postby hiphop9686 » Tue Dec 08, 2015 11:34 am

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.
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Need help for Bluebee module

Postby bengchet » Tue Dec 08, 2015 11:50 am

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.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

PreviousNext

Return to Wireless Device

Who is online

Users browsing this forum: No registered users and 10 guests

cron