Go Down

Topic: Xbee+Arduino+receiving more than 1 packet at once. (Read 1 time) previous topic - next topic

aliceguzman

Hi...this is my first time posting... but i've gotten a lot of help from the forum  :)

So... my final project consists of 3 robots that need to get to a certain point, however, on the way to this point, they're going to find some obstacles, some of which they can't avoid by themselves.

For example, if one of them gets stuck in some sort of gap, that one sends a help message to another one, and that one switches from searching the main point, to searching his partner.

Each one of the robots has an arduino Mega and I'm using Xbees for the communication. I'm using Rapp's library.
I also have another Xbee connected to my computer (let's call it 'base').

Each robot is constantly asking the base for its rssi. That way the robot has an idea wether it is close or far from the base. Also, as I mentioned, if one of them gets stuck, it sends a help message to another one.

I'm also sending updates messages regarding what each robot is doing to the base (I have an app in c# that prints these updates).

So...my problem is this... most of the times...when the robot asks for help...the other one just doesn't get the message...
I've managed to find out it is because when I'm waiting for the value of the rssi I receive the pcket for help... and that function originally didn't process the type of packet that is the help packet...however...when I added that part...it still did not work...

Any comments?  :-/   :'(

PaulS

RSSI (Relative Signal Strength Indicator) is not terribly accurate. The relative distances between two robots that are in close proximity to the base, and base, is not going to be distinguishable.

Quote
For example, if one of them gets stuck in some sort of gap, that one sends a help message to another one, and that one switches from searching the main point, to searching his partner.

Does the request for help go through base, or are the robots communicating with each other as well as base?

Serial communication is asynchronous. That mans that the order of messages is not guaranteed. If you need synchronous communication, you need to incorporate numbers in the messages, and order them on the receiver.

Or, maybe I just don't understand the problem.
The art of getting good answers lies in asking good questions.

aliceguzman

I've noticed that RSSI isn't accurate at all!! :-[
... but I'm only using it to locate a radius around the address they're searching for...to tell if they're close or far away....

I believe the request for help goes between robots... but they're also asking the base for the rssi ...and the request for help can come in any moment.

Since I'm using Rapp's library...I haven't figured a way to add a number to help me figure out which packet is which...however I do ask for the api ID... that way I know if it's a RX response (for the help msg)...or a AT command response (for rssi)...

zoomkat

Were you assigned this specific project, or did you create it yourself? It seems it is somewhat based on unvalidated assumptions on how things will work. I suggest you have the pc act as the command/control center and query the individual bots as to their status and such. Figuring out where a particular bot is located will be a challange in itself.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Go Up