Skip to content

Status code of response randomly zero #19

Open
@adadgio

Description

@adadgio

I'm using node red to log simple data values from arduino send with this library.

Everything works but the status code of the response is sometime 200, but most of the time randomly 0 with an empty response. The NodeRed workflow works (its only an hTTP in and http out nodes

String response = "";
  int statusCode = client.post("/api/garden", data, &response);
  Serial.println(statusCode); // sometimes 200, often zero..
  Serial.println(response); // sometime "ok", often empty

Note: i do get my values right at every request in nodered debug node. So the request is properly made...

When i make ONE post request the debug shows:

HTTP: connect
HTTP: connected
REQUEST: 
POST /api/garden HTTP/1.1
Host: 37.139.14.78
Connection: close
Content-Length: 17
Content-Type: application/x-www-form-urlencoded

soil_humidity=719

HTTP: call readResponse
HTTP: NON-NULL RESPONSE POINTER: 
HTTP: RESPONSE: 
HTTP: return readResponse3
HTTP: return readResponse
HTTP: stop client
HTTP: client stopped
0

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