Create a network with several senders and one receiver ?

I have three xBee A, B and C. A and B will receive a constant stream of data and their goal is to transmit it in transparent mode to C.

C is on a raspberry and has to :
-1 identify who’s sending the data
-2 store the data on a micro sd

What are some possible solution, in order to make this configuration work ?

Info on what i’ve tested :
-A and B can’t be sending at the same time since data will get lost/mixed and C would’nt be have to identify wich data is who’s
-I tried alternating sleep modes, A sleep when B sends and then B sleeps and A sends, but since data is not buffered when sleeping this translated in the loss of half the data ( some little data loss is okay, but no more than a few percent )
-Using RTS/CTS: Lots of data loss when sending remote AT, because the commad often failed and meanwhile packets where lost.
And worse: CTS unstability. Basically sometimes CTS would stop data flow and buffer it, sometimes it would stop but not buffer, and often times it would not even stop the data from being sent. This Unpredicable behavior is totally a deal breaker and render flow control unusable.

Simple, First use API mode on your receiving module. This way you know the address of who sent that data packet.

Which XBee modules are you working with? What firmware version?

What baud rate are you running at?

I’m using XB8-DMUS-002 80k, firmware version is 8074 and i’m using baud rate 9600.

But parsing the response seems really painfull, is there a recommended way of doing it ?
I’m currently getting a string from the port, that i search for the 7E or ~ symbol, then i take a look 11 character later to indetify who’s the sender, and then i have to split it to separatee the payload from the rest, and oftentimes i catch another frame in the payload resulting in more problems …

The API frame is in Intel Hex characters. You would need to write your application in a way that it can understand these characters. The API structure is documented within the product manual for the XBee module you are working with.

Depending on what processor or language you are working with, you may find that sample Library already exist that you can plug into your code that can decipher the API frames.