Hi,
I’m trying to test the maximum data transfer rates of the WiFly shield, but so far it seems to be woefully slow.
For testing purposes, I have my Arduino generating a sine wave and sending values to the WiFly, using SpiSerial.print() from the WiFly library (see code below). The WiFly is in ad hoc mode, communicating directly with my laptop via UDP, which I assumed would provide the highest data rates. If I send a value every few hundred milliseconds, the transfer is very reliable. But if I make the interval less than 20 ms, the messages are junk, or don’t get sent at all. This constitutes a transfer of a few hundred bytes per second, far below what I expected.
Does anyone have an idea about what the limiting factor might be? Is it the Arduino, the SpiSerial code, the WiFly itself, or something else I’m not considering? If someone knows an easy way to increase the throughput, that would be greatly appreciated.
In general, what is a reasonable data transfer rate to expect from this configuration?
Thanks in advance for your help!
// WiFly timing test sketch
#include "WiFly.h"
unsigned long time = millis();
float iter = 0;
int timeInterval = 20;
void setup() {
SpiSerial.begin();
}
void loop() {
if (millis() - time > timeInterval) {
iter += 1;
float val = sin(iter/100*2*PI);
SpiSerial.print(val);
time = millis();
}
}