Skip to content

Only the first GET works? #2

Open

Description

@interactive-matter

Hi

I’ve tried this code inside loop() and it is called very 10s:

if ( tenSecs ) {
FILE* result = client.getURI(“/test/P.php”,get_parms);
if (result!=NULL) {
int returnCode = client.getLastReturnCode();
if (returnCode==200) {
Serial.println(“loop::data uploaded”);
}
else {
Serial.print(“ERROR: Server returned “);
Serial.println(returnCode);
}
client.closeStream(result);
}
else {
Serial.println(“ERROR::failed to connect”);
}
}

Only the first GET works. All others fail – any idea?

Activity

  1. interactive-matter commented on Sep 5, 2011

    @interactive-matter
    OwnerAuthor

    I’m having a similar issue. The first request seems to work, but on subsequent requests I’m only getting the first line of the header.

    e.g. I’m contacting a django server, with debugging enabled the first response I get looks like this
    —————————————
    HTTP/1.0 200 OK
    Date: Sun, 04 Sep 2011 21:21:42 GMT
    Server: WSGIServer/0.1 Python/2.7.2
    Content-Type: text/html; charset=utf-8

    ((response body))
    —————————————
    And subsequent responses are simply:
    HTTP/1.0 200 OK

    So I’m not even getting the entire header. I’m pretty sure the problem is not server-side.

  2. ralfvdz commented on Feb 11, 2012

    @ralfvdz

    I'm experiencing similar problems with POST. Any news on this? I'm suspecting some kind of stack corruption. It seems fgetc cannot be called anymore after the second postURI call (you can call fgetc, but it seems not to be entering the function).

    I first thought it might be these statements causing problems (by supplying an argument to a format without a format specifier):
    fprintf_P(stream, requestType, uri);
    fprintf_P(stream, PSTR(" "), uri);

    So I removed the uri arguments, but it didn't fix the problem in my proof of concept. Would love to help you guys get the problem fixed, because I really like the concept of the FILE * based architecture (integrating nicely with aJson).

  3. Apollon77 commented on Aug 13, 2015

    @Apollon77
    Contributor

    Maybe my issue (#12) has something todo with this ?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions