Send data between 2 bluebee 4.0 ?

Bluetooth, XBee, RF......

Send data between 2 bluebee 4.0 ?

Postby hiphop9686 » Tue Mar 22, 2016 9:21 am

I would like to ask whether is it possible to send data between 2 bluebee 4.0 that connected to arduino? Such that the data send from slave, then master received the data and show on the serial monitor.
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Send data between 2 bluebee 4.0 ?

Postby bengchet » Tue Mar 22, 2016 10:53 am

Hi,

Yes it is possible. I believe this is the link you are looking for. Have a look.

Thanks.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Send data between 2 bluebee 4.0 ?

Postby hiphop9686 » Tue Mar 22, 2016 11:23 am

Thanks for the quick reply.

But I thought will be using the Arduino library provided?

Like, char c = BlueBee.read(); or BlueBee.print

The link doesnt show the Bluebee coding, but with only serial.

For example the sensor attached with slave and Bluebee. I would like to send the sensor value to master, so that master can show the data in serial monitor.
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Send data between 2 bluebee 4.0 ?

Postby hiphop9686 » Tue Mar 22, 2016 12:30 pm

i am able to send the data from slave to smartphone

but i need to send the data from slave to master, to display value on serial monitor

is there any way to do this ?
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm

Re: Send data between 2 bluebee 4.0 ?

Postby yonghui » Tue Mar 22, 2016 12:54 pm

Bluebee is actualy wireless serial link. after connection is made between the two module. u can send the characters u want to send and receive it on the other end. after receive the data, u can send it to serial terminal to be displayed
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Send data between 2 bluebee 4.0 ?

Postby bengchet » Tue Mar 22, 2016 5:47 pm

Hi,

Looks like your understanding about hardware is not very firm. Try to understand the role of each hardware before proceed to your main research. It will help you to manipulate this tool to suit your needs of application.

First understand the role of BlueBee. As Yong Hui said, once 2 bluebees are connected, they establish wireless serial link. Remember that, they don't care what kind of data is going between these links, their concern is only one: transmit whatever data the host have dumped to them to the another host ;or receive data from the another host and pass them to own host.

Ok then who are these hosts? That will be your Arduino. Arduino is the one who decides which data is required to send, and also what kind of actions needed to take after received incoming data. For this case, 2 Arduino will be using UART protocols for data transmission between each other because Bluebee supports it. Serial and softwareSerial library provides Arduino ability to send or receive data using UART. Only difference is, serial requires pin 0 as receive pin (RX) and 1 as transmit pin (TX) , softwareSerial can use pins other than 0 and 1 for RX and TX. Let's say Arduino wants to send "Hello world" with pin 3 as TX, we use SoftwareSerial to do so like ...bluebee.print("Hello world").

What if there is no BlueBee as wireless medium? Then 2 Arduinos will be needing wiring in order to communicate with each other. With BlueBee, wireless serial link is established, then 2 Arduino can 'talk' to each other wirelessly.

From previous discussion, I assume you are using XBee shield as well in your research. Think XBee shield as easy interface between Arduino and BlueBee, or should I say, it is acting more like a channel. Let's say we put jumpers at D2(RX) and D3(TX), you are telling BlueBee that Arduino will be sending data(transmit) using pin 3 and receiving data using pin 2. So BlueBee's job is to fetch data from pin 3 before transmit to another host. When receiving data from another host , Bluebee will channel every data to its own host through pin 2 and Arduino gets the data. Of course in program, you should declare SoftwareSerial(2,3) to tell Arduino to transmit data using pin 3 and receiving data from pin 2.

BlueBee library you are using in fact is serial and softwareSerial library. If you understand serial or softwareSerial library, you can use serial or softwareSerial library only to achieve the same purpose. From the link provided, he uses Serial. If you can understand the concept, you will understand why he is using Serial. You can check on how he setup jumpers on Xbee Shield.

Another thing you must understand how Serial library related to Arduino Serial monitor. Pin 0 and 1 of Arduino in fact are hardware RX and TX pins (built-in pins designed for UART purpose) and they are connected to PC once you have attached USB cable from Arduino to PC. Therefore everything Arduino transmit using serial, they will be received by PC and shown in Serial monitor. I hope now you have understood that, your application requires 2 separate UART communication that Arduino must make, one is for PC and another one is for transmitting or receiving data from another Arduino via BlueBee.

Hope you can understand.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Send data between 2 bluebee 4.0 ?

Postby bengchet » Tue Mar 22, 2016 6:10 pm

Hi,

Correction to role of BlueBee. The case happens only if BlueBee is not in remote mode (check AT+MODE in AT command list). If Bluebee is in remote mode, AT command will be filtered and response will be made corresponding to AT command.

For example, Arduino A + BlueBee A and Arduino B + BlueBee B

BlueBee A and B are connected

Normal Data (not AT command)

Arduino A sends: Hello World
Arduino A ------>(via BlueBee A) --------> (via BlueBee B) -----------> Arduino B
Arduino A gets: (nothing)
Arduino B gets: Hello World

AT command

i) BlueBee B is in remote mode (AT+MODE? OK+Get:1)
Arduino A sends: AT+RSSB?
Arduino A ------->(via BlueBee A) --------->BlueBee B Arduino B
Arduino A <-------(via BlueBee A) <---------BlueBee B
Arduino A gets: OK+Get:-085
Arduino B gets: (nothing)

ii) BlueBee B is not in remote mode (AT+MODE? OK+Get:0)
Arduino A sends: AT+RSSB?
Arduino A ------>(via BlueBee A) --------> (via BlueBee B) -----------> Arduino B
Arduino A gets: (nothing)
Arduino B gets: AT+RSSB?

BlueBee A and BlueBee B are not connected

AT command

Arduino A sends: AT
Arduino A ------->BlueBee A
Arduino A <-------BlueBee A
Arduino A gets: OK

This works for Arduino B and BlueBee B as well.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Send data between 2 bluebee 4.0 ?

Postby hiphop9686 » Wed Mar 23, 2016 10:31 am

Thank you bengchet

I able to send the data from slave to master now.

Thanks for the advices and suggestions.
hiphop9686
Apprentice
 
Posts: 34
Joined: Thu Nov 26, 2015 9:58 pm


Return to Wireless Device

Who is online

Users browsing this forum: No registered users and 15 guests

cron