I'm working with esp8266 Arduino (via Adafruit Feather Huzzah) I'm trying to continuously write 3 characters to a TCP socket, but there's nothing continuous about it. It has a very regular pattern of high and low bandwidth. It writes at a very high rate for ~10 seconds, and then a very low rate for 4 seconds (see graph of received packets)
//...
void loop() {
if (!client.connect(host, port)) {
delay(10);
return;
}
for (int i=0; i < 1024; i++){
client.print(String(analogRead(A0)) + "\r\n");
delay(1);
}
}
Number of received messages (v2.2.0 and 2.3.0 firmware)
Any ideas if it's the wifi driver, something in the chip or hardware timers that I can't get around... or maybe something else?
-- Update --
I have tested this with master, and it gets a different, but still bursty result. It appears that it now "catches up", instead of slowing down, but it's still on a ~10s / ~4s pattern. What could be causing this? What are the options for mitigation?