Multiple RFM69 Transmitters to One Receiver

Started by LPLuser GLM, April 28, 2017, 12:59:59 PM

LPLuser GLM

I want to send data from four separate sensor/rfm69 nodes to a single receiver.  What happens if multiple sensors are transmitting at one time?  Do I lose that data?  I would like to NOT use ACKs as I would not care if an occasional sensor reading was lost but would like to prioritize sensors so I could resend the lower priority sensors.  Thanks,
GLMc

syrinxtech

I use a "base station" that gathers a number of sources of data together, including an outdoor weather station, motion detectors, water sensors, etc.  And at the same time all of this data is written to an SD card and the output of the weather station is transmitted to multiple display stations around the house.  Needless to say the Moteino Mega is working overtime and has no problem keeping up with receiving and transmitting data. 

I guess one of the keys is to receive and process the data from each sensor as quickly and efficiently as possible.  If you keep the number of steps to a minimum, you shouldn't have a large problem keeping things synchronized.  On some of my transmissions I use ACK's and on others I don't.

If you really wanted to I guess you could create various input queues for each sensor and stack up the incoming packets in a queue.  I'm sure it will depend on how important it is to never miss an incoming packet.

LPLuser GLM

Thanks, Syrinxtech... impressive.  So yours are synchronized?  In my case they are random but I can arrange them to have different periods so they never are repeatably transmitting at the same time.  So I lose the data from both sensors if they are transmitting simultaneously?  Would it be obvious the data is corrupted or would it perhaps have incorrect bytes?  I am having a hard time imagining what happens when multiple receptions are interleaved.

syrinxtech

They're not technically synchronized but they do happen at particular intervals, just not all at the same time.  So, in effect, the base station is receiving and transmitting almost all of the time due to the number of inputs and outputs.  It definitely earns its keep.

The radio can't multiplex incoming signals.  As you call receiveDone(), you will get one buffer of data.  You have to process that data before you can read again.  And, if you need to store or re-transmit the data the radio will be busy for that short duration.  That's why sendwithretransmit is your friend if you can't afford to lose data.


TomWS

Also note that the RFM69 library 'listens' to see if transmission from another source is occurring before it transmits.  See: https://lowpowerlab.com/forum/moteino/rfm69-fundamentals-of-receiving/msg4052/#msg4052

This helps reduce collisions except when they are exactly simultaneous, but the error detection will detect this condition and not give you a 'collided' packet.  If you keep packets short and use sendwithretry()  you'll have a fairly reliable and fast communications system where several motes can transmit 'simultaneously'.  In my setup I sample data every 10 minutes, but then ALL motes are sampling and sending (all 35 of them at this one location).  For the most part a very significant amount of the data gets through reliably.

Tom

LPLuser GLM

Thanks to both of you... now I think I understand, and, happily, don't have a problem.  I am collecting data at ~10 Hz so a missed data point is not a problem.  I did not understand before that the transmitters listen before transmitting.  This really makes a big difference in my project because my transmitter modules have to be simple, with minimal space available.
Thanks again for the help!
GLMc