-->
Page 1 of 1

Persistent Connection

PostPosted: Fri Oct 14, 2016 10:33 am
by Issac Kelly
Hey! 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) https://www.dropbox.com/s/02g9ht4olp8io ... 9.png?dl=0
I believe this to be an easily reproducible issue.


Code is here:
Code: Select all//...
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.
Image

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?

Re: Persistent Connection

PostPosted: Sat Oct 15, 2016 11:31 am
by Issac Kelly
I also posted this on Stack Overflow. The first suggestion is to try the github master branch (I'm currently on version 2.3.0). I'll cross-post results here.

Re: Persistent Connection

PostPosted: Mon Oct 17, 2016 1:48 pm
by Issac Kelly
I've now tried this on master, and it's really interesting. The difference seems to be that it's still very bursty, but now it's both high and low during the 4s period, and fairly steady during the 10s period.

Is this the right place for low level discussions? I want to dive into the underlying firmware and figure out what's going on, but I think I need some guidance for the first few places to look.


Image