Pages: [1]   Go Down
Author Topic: Using Xbee to implement a wireless network  (Read 1138 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good morning.

I opened the discussion in Project Guidance forum (http://arduino.cc/forum/index.php/topic,60976.0.html) but I feel it is more appropriate to continue it into this forum. I hope I am doing well...

Let me recap shortly what I am trying to achieve just to provide some context…
I am building a system around Carrera Digital Slot Car system.
All the components of the system should communicate according to the network shown in the attached picture. Except the laptop all devices are built on Arduino.

1-Communication between Race Manager and Laptop:
During the initialization phase Race Manager and Laptop synchronize exchanging about 100 bytes (no time constraint).
During race the Race Manager sends to the LapTop a packet of 8 bytes each time a car complete a lap (up to 6 cars), about every 5 to 10s.

2-Communication between Driver Station and Control unit:
During the race the Driver Station sends to the Control/Unit one byte every 75ms and on request (can be never or twice during the race) one byte. No answer from the Control Unit is expected.

3-Communication between Driver Station and Race Manager:
During the initialization phase Race Manager and Driver Station synchronize exchanging about 20 bytes (no time constraint).
During the starting phase the Race Manager and the Driver Station exchange one byte to manage the possible jump start, both directions.
During race the Race Manager sends to the Driver Station a packet of 8 bytes each time a car complete a lap (up to 6 cars), about every 5 to 10s. There is one Driver Station per car and the other Driver Stations are not interested by the data related to the other cars.
During the race the Driver Station sends to the Race Manager one byte on request (can be never or several times during the race) that requires always one answer byte from the Race Manager.


 Now my questions:

After looking at different posts I am planning to use Xbee modules to build the network.

So far I am having the following questions:
- is Xbee the right approach for what I want to achieve?
- to work the network should be based on modules belonging to the same series ?
- according to what I understood both series 1 and series 2 could allow me to implement the communications I need, so why shall I go for series 1 or series 2 (cost, library, easier to use…) ?
- Xbee modules for PC can be connected to RS232 interface or USB port, in the context of being use with Arduino’s are the 2 solutions equivalent or should I go for USB?

I will have probably more questions in the future, but your feed-back will help me to define the “high level” design…

If someone has already the experience of using Xbee modules in similar context, I would appreciate the return of experience.

Raoul.


* Network.jpg (141.84 KB, 757x561 - viewed 22 times.)
Logged

Hamburg, Germany
Offline Offline
Sr. Member
****
Karma: 5
Posts: 291
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Go for XBees Series 2 with the coordinator connected by USB to the laptop. Everything else is programming.
Logged


nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8430
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm only just getting into Xbee myself but one thing I noticed is the "Latency from the time data is transmitted until received" of 72mS.

How does that gell with sending data every 75mS.

Are you doing any critical timing via the radios?
______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 906
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Graynomad is dead on with the comment on latency.  XBees are nice, but they can really be latent, especially if they have to store and forward data.  I've actually seen the second message sent come in after the first one due to retransmission caused by collision.  This is totally allowable in some circumstances, but I wouldn't want my little race car getting the stop command before the speed up command because the order was reversed by rf collisions.
Logged

Trying to keep my house under control http://www.desert-home.com/

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

Latency is a real concern and having a car crash because data was not received is a little bit scary (digital cars are quite expensive).
I don't know if it can help or not but my intention was to have the Race Manager pooling for data to avoid collision and simultaneous talks...
Do you think it can work like this?

My second concern is about the comment above from markbee about series 2. I am wondering why to choose series 2 if I am implementing a point multipoint network? I understood from different post that Xbee Series 1 allow such architecture. But maybe there is another reason...

I will appreciate any return of experience, in particular regarding  xBee performance.

Thank you for supporting.

Raoul.
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 906
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In my opinion, the latency could be a problem but, once you're aware of it, you can easily work around the shortcomings.  Regarding Series 2 vs 1.  I've only used series 2 and found it a little difficult at first, but somewhat easier with more experience and very reliable over time.  I don't avoid series 1, just want the latest set of bug fixes and software advances I can get my hands on.

One thing though, you will almost certainly be stuck with using the API mode to get things like checksums and easy addressing of messages.  AT (transparent) mode doesn't have any of that.
Logged

Trying to keep my house under control http://www.desert-home.com/

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
Thank you for your comments.
I ordered 3 XBee Series 2 with wired antennas.
As soon as I will receive them I will start prototyping.
Raoul.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As has been mentioned on many other threads, I highly, highly, highly recommend the Faludi book.  I know of no other source as good at explaining how to use xBee Series 2 modules.
Logged

Hamburg, Germany
Offline Offline
Sr. Member
****
Karma: 5
Posts: 291
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I can only emphasize this.

O'Reilly has weekdays a "Deal of the Day" for ebooks. Sometimes the Faludi-book is there on sale for abot $15. That's a fantastic bargain.

markbee
Logged


0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.

I purchased Faludi-book, and started to read it waiting for the shipping of my XBees... And yes it is very useful and written in a very accessible way for beginners. I think it is a good investment.

Regarding my project I discovered I am short in terms of I/O (for the nodes connected to a Duemilnaove) and  I was wondering if it is possible to use the digital inputs available in the Xbee series2 to collect data and to “send” it to itself, and then to read and process the data on the local Arduino as if it was send by another node in the network?

Do you think it will work? What can be the limitations of such approach?

Thank you.
Raoul.

Logged

Hamburg, Germany
Offline Offline
Sr. Member
****
Karma: 5
Posts: 291
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Raoul,

actually I never tried it but you might try periodic sampling (in API mode) and send the data to your own DH/ DL address. Remember this only works in API mode else the XBee will not send out data to UART.

Maybe you have a look at the data sheet, chapter 8, I/O sampling.

markbee
Logged


0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Markbee

Thank you for answering.
I will try as soon as I will get my Xbees.
I suspect I should keep free some I/Os pins supporting multiple roles like:
AD3 / DIO3 / (COORD_SEL)
AD5 / DIO5 / (ASSOCIATE)
DI8 / (DTR) / (Sleep_RQ)
I don't think I will have to control data flow through RTS/CTS, so if the solution works it should allow me to add 7 I/O to the Arduino.

Raoul.
Logged

Pages: [1]   Go Up
Jump to: