Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send big buffers (4000 bytes) #2

Closed
tobiasmuecksch opened this issue Apr 3, 2018 · 3 comments
Closed

How to send big buffers (4000 bytes) #2

tobiasmuecksch opened this issue Apr 3, 2018 · 3 comments
Labels
question Further information is requested

Comments

@tobiasmuecksch
Copy link

Hi @ludiazv,

I'm having a problem. I need to transmit buffers with a size of 4000 bytes. This package can't transmit more than 32 bytes.
Do you have any idea or hint how to transmit bigger buffers?

@ludiazv
Copy link
Owner

ludiazv commented Apr 3, 2018

32 bytes is hardware limit for a single frame. There is no way to send more than that in a single frame. This is typically called MTU in network protocols. For this radios the MTU is 32.

For sending 4K you need to implement fragmentation of the data in 32bytes chunks/fragments. A simple way could be to add a 2-byte header in your payload with the packet number & data length.

On transmission, split the original buffer in 30 byte chunks, pack each pakcket with the header and write each packet to the radio. You shold implement controlled retry sending each chunk

On the receiver, defragment the sequence controlling the order and the size of each chunk.

@tobiasmuecksch
Copy link
Author

tobiasmuecksch commented Apr 4, 2018

@ludiazv Thank you very much for the detailed in-depth answer.

FYI:
I'm trying to make an audio transmitter that transmits the microphone signal from a raspberry pi to another raspberry pi. Currently I'm trying to transmit the raw signal, but maybe that won't work.

The maximum speed of this module is 2 Mbps = 250 kB/s am I right? That means 25000 / 32 Byte = ~781 Frames per Second. The raw signal currently is ten times this big.

Conclusion; I have to compress the signal.

@ludiazv ludiazv added the question Further information is requested label Apr 4, 2018
@ludiazv
Copy link
Owner

ludiazv commented Apr 4, 2018

Audio streaming is possible with this radios. I think that a better approach is not compressing but down-sampling the audio signal and send over the radio allowing some packets to be loss. With compression this could more complex. In principle an audio signal from 13-40khz could be transmited depending on the speed.

Check this information: https://tmrh20.github.io/RF24Audio/

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants