No inputs created

hi

Firstly thanks in advance to whoever can help me ,Im trying to send sensor readings from my DHT11 sensor to the Emoncms web application.the DHT11 will be attached to an arduino which can communicate with a server via an ethernet schield .The sensor are working, but Emoncms input is not working. "No input created"

I think I have forgotten something in this part

[code]

// this method makes a HTTP connection to the server:
void sendData(float temperature, float humidity) {
 // if there's a successful connection:
 if (client.connect(server, 80)) {
Serial.println("Connecting...");
    // send the HTTP PUT request:
 //   client.print("GET /emoncms.org/input/post.json?apikey=3c8770b84603e15ea8e2c9f023c9****&json={temperature");
    client.print("GET /emoncms.org/input/post.json?node=");
   client.print(node);
   client.print("&csv=");
    client.print(temperature);
    client.print(",");
    client.print(humidity); 
   client.println("&apikey=3c8770b84603e15ea8e2c9f023c9**** HTTP/1.1");   
   // client.println("} HTTP/1.1");
    client.println("Host:emoncms.org ");
    client.println("User-Agent: Arduino-ethernet");
    client.println("Connection: close");
    client.println();
 }

[APIkey masked - Moderator (RW)]

Robert Wall's picture

Re: No inputs created

Disclaimer: I don't have an Arduino, Ethernet shield nor know the Ethernet library. However...

Looking at the library documentation:
client.connect(URL, port) indicates that you're defining the URL in there.
Then lower down you're sending: "client.print("GET /emoncms.org/input/post.json?node=");" and to me, you're repeating the base URL. The example here doesn't do that.

I suggest you look in that area. If you have a tool like Wireshark to see what's actually being sent, that will help you.

pb66's picture

Re: No inputs created

Ditto the Disclaimer !

I had the same thoughts and I also wondered if an IP address should be used in place of the host domain name as I recall nanodeRF sketches using an IP to post to emoncms.org.

Paul 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.