I have four XBees, two of which are with an Arduino Due and two of which are with a Teeny 3.1. They are communicating with one another and sending/receiving data from one another, and depending at different sampling rates (between 20-100 Hz) depending on the data being transmitted.
The data is first packaged with start and end characters before be transmitted to the receiver to be parsed. Start and end characters I have been using are parenthesis '()' '[]' '{}' '<>', where the data is placed in between.
This works really well with two Xbees communicating with one another, but expanding the mesh to +2 has given me data corruption problem on the receiving end. I know there are different operating modes on the XBee that allow for mesh networking, but I am having some trouble how to implement a solution.
I was hoping for some project guidance and maybe a few links to help me.
dgelman:
Can I not use API mode on the S1 to accomplish this?
Not really. The Series 2 models form networks automatically. The Series 1 models, in API mode, using the XBee library, do not. You CAN make one Arduino with Series 1 model talk to any number of other XBees, but that is not the same thing as forming a mesh network, where the radios forward packets to other radios automatically.
PaulS:
Not really. The Series 2 models form networks automatically. The Series 1 models, in API mode, using the XBee library, do not. You CAN make one Arduino with Series 1 model talk to any number of other XBees, but that is not the same thing as forming a mesh network, where the radios forward packets to other radios automatically.
Just to understand this. With S1 modules, you can have 1 transmitter and multiple receivers, but you cannot have modules separately communicate with each other and at the same time ignore signals from other modules?
Before I go and purchase four S2s, is there any clever parsing or start/stop characters I can implement a unique identifier that would prevent data corruption?
With Series 1 models in AT mode, you can communicate with THE other XBee that you have configured the XBee to talk to.
In API mode, or using the XBee library, you can define which other XBee this XBee is to talk to, but it is NOT the XBees that are forming the network. It is your code, and your awareness of the rest of the XBees that should be in the network that are forming the network. A given Series 1 XBee can talk to any number of other XBees, in API mode/using the XBee library. The ones not being talked to don't even get the message, so there is nothing for them to ignore. Well, actually they get it, but they know it is not for them, so they ignore it, and do not pass it along to the Arduino they are attached to.
In API mode/using the XBee library, every packet contains the sender ID and the destination ID, so there is no clever parsing or other tricks needed to prevent data corruption.
PaulS:
A given Series 1 XBee can talk to any number of other XBees, in API mode/using the XBee library. The ones not being talked to don't even get the message, so there is nothing for them to ignore. Well, actually they get it, but they know it is not for them, so they ignore it, and do not pass it along to the Arduino they are attached to.
In API mode/using the XBee library, every packet contains the sender ID and the destination ID, so there is no clever parsing or other tricks needed to prevent data corruption.
Isn't this exactly what I want? Which is the ability to send data with sender and destination IDs then to be received and parsed. Would using your XBee library, prevent the receiving XBees from listening in on data coming from other signals?
Isn't this exactly what I want? Which is the ability to send data with sender and destination IDs then to be received and parsed.
I don't know. You SPECIFICALLY asked about having the XBees form a network, which they can't. You CAN have the Arduinos know about all the XBees, and use them for communicate as though they were a network. But, if you call the XBees Alice, Ted, Bob, and Jane, and and Bob goes offline, the only way you know that is when you fail to get an ACK from Bob.
If Alice sends to Bob, who sends to Jane, who sends to Ted, and Bob goes offline, Alice can't talk to anyone.
If Alice, Ted, Bob, and Jane were series 2 models, and Bob went offline, Alice could still talk to Jane and Ted without even knowing that Bob wasn't in the network.
It's a matter of how much you want the XBees to do and how much you want the Arduinos to do.
PaulS:
I don't know. You SPECIFICALLY asked about having the XBees form a network, which they can't. You CAN have the Arduinos know about all the XBees, and use them for communicate as though they were a network. But, if you call the XBees Alice, Ted, Bob, and Jane, and and Bob goes offline, the only way you know that is when you fail to get an ACK from Bob.
If Alice sends to Bob, who sends to Jane, who sends to Ted, and Bob goes offline, Alice can't talk to anyone.
If Alice, Ted, Bob, and Jane were series 2 models, and Bob went offline, Alice could still talk to Jane and Ted without even knowing that Bob wasn't in the network.
It's a matter of how much you want the XBees to do and how much you want the Arduinos to do.
OH OKAY! I think I used the terms 'mesh network' incorrectly.
In this application, Bob talking to Jane and Ted but not listening to anyone, Jane is talking to Ted and John and listening to both ... etc. These relationships are strict and known and will not change if anyone goes offline. No one should be going offline, and I don't care to redirect if someone goes offline. It sounds like the xbee library can do this.
EDIT: I want to make sure that Jane can only listen to either Ted or John one at a time.