How to quickly transfer data from local vars to remote PC

Status
Not open for further replies.

mrm

Member
Let's say I need to transfer 80kb per second (that's 80 * 10^3, not 80 * 2^10!) out from a byte array variable. (10,000 sensor samples per second, each sample being a 64 bit number.)

I want to do this over ethernet. I understand the ethernet chip onboard the Teensy is 10/100mbps and so this should pose no problem at all.

What would be the most appropriate (that is, the most simple and robust) protocol for transferring that data? My initial candidates are:
- MQTT(supports up to 256MB per message, and I like this protocol for its QoS and message handling)
- TCP (e.g. using Putty)

I'd like the data to end up in some kind of event driven programming tool like Node-RED, so it can be further processed and stored.
 
80kb/s is 10kB/s. I presume you meant 80kB/s ? Which is 640kb/s (in data comms bits/second is normally used, not
bytes/second, note).

I understand the ethernet chip onboard the Teensy is 10/100mbps
Mb/s, not milli-bits/second!! Note that the theoretical max bit rate is not something you can achieve in practice, so 100Mb/s ethernet
might get you to 80Mb/s if you're lucky, but you'll never see 100Mb/s at the application level due to protocol overheads, contention,
other traffic, etc.

I'd have thought plain TCP is the simple and robust approach as its the basic reliable stream protocol over IP. However
its a bare stream. That might be too simple for your application?
MQTT will be less simple (requires buffer space / storage?) but probably more robust (given a suitable implementation...).

This thread might be pertinent: https://forum.pjrc.com/threads/61714-Teensy-4-1-MQTT
 
Thanks, yes correct I meant 80kB/s (and Mb/s when quoting ethernet bit rate). Hopefully the fact I overexplained the nature of my data made up for my inability to use capital letters there :)

Thanks for the comment. Will read through that thread.
 
10,000 sensor samples per second, each sample being a 64 bit number.

Does your sensor provide data as 64-bit values? If you are converting from say, 12-16-bit ADC input to some other units, and using double-precision floats, consider sending the data in its raw format. That would reduce your bandwidth by a factor or 4 to 200 kbps, and you could probably do it with a UART.
 
Status
Not open for further replies.
Back
Top