Sending and receiving more than one buffer worth of data on the RFM69

Started by beckerdo, February 16, 2015, 03:21:45 PM

beckerdo

Hello, I am a new Moteino user, and I have had very good success with one transmitter node (with a weather shield) and one receiver gateway. My send and receive sketches are based on the gateway and node sketches.

My send and receive buffers are char buffers of 128 characters, but apparently some messages exceed the send and receive buffer size of the RFM69. I see this sort of send data on the serial monitor of the transmitting node:
   tid=tw01, sid=BMP180, am=262.0, af=859.6, tc=24.3, tf=75.7, pma=987.6, pia=29.17, pmr=1018.9, pir=30.09
and I see this sort of receive data on the serial monitor of the receiving gateway:
   #[2][2] tid=tw01, sid=BMP180, am=262.0, af=859.6, tc=23.1, tf=73.5, p   [RX_RSSI:-37] - ACK sent.

Obviously the message payload data is getting cut of at the 61 byte boundary of the RFM69 buffer.

Does anyone have a sketch that can send and receive multiple chunks/frames and automatically disassemble/assemble message payloads? (I know I can send C structs, and perhaps save space, but even structs can exceed the buffer size limits.)

Thanks, Dan

Felix

The longer the message the higher chance for noise/interference/loss. So whenever possible keep messages as short as you can, they save power too.
Assuming you still need a long message, try structs first if you can as you mentioned. That will really compact those long numbers.
I do not personally have a sketch that will divide and reassemble messages, maybe someone else does. But a close example to that is the WirelessHex69 library which does something similar - uses a counter and ACKs to ensure all packets are received and in order. So you could follow that logic to do something similar for any # of messages. Mind the limited RAM though ;)

beckerdo

Thanks Felix. Good ideas there. Wow, I wonder how people did it in the RFM12 days with the 2 byte buffer!

Thanks, Dan