Help needed on multiple input of data to exosite

I made temp sensor project and sending the data to exosite with single DS18b20 sensor and it worked nicely

and this is the code i used

And today i added another DS18B20 temp sensor and made small change in it the temp for another DS18B20 is showing in serial port but the data shows 0 in exosite and it not updateing and this the modified code

/*
 Exosite Arduino Basic Temp Monitor 2 (updated to use Exosite library)
  
 This sketch shows an example of sending data from a connected
 sensor to Exosite. (http://exosite.com) Code was used from various
 public examples including the Arduino Ethernet examples and the OneWire
 Library examples found on the Arduino playground. 
 (OneWire Lib credits to Jim Studt, Tom Pollard, Robin James, and Paul Stoffregen)
  
 This code keeps track of how many milliseconds have passed
 and after the user defined REPORT_TIMEOUT (default 60 seconds)
 reports the temperature from a Dallas Semi DS18B20 1-wire temp sensor.
 The code sets up the Ethernet client connection and connects / disconnects 
 to the Exosite server when sending data.
  
 Assumptions:
 - Tested with Aruduino 1.0.5
 - Arduino included Ethernet Library
 - Arduino included SPI Library
 - Using Exosite library (2013-10-20) https://github.com/exosite-garage/arduino_exosite_library
 - Using OneWire Library Version 2.0 - http://www.arduino.cc/playground/Learning/OneWire
 - Using Dallas Temperature Control Library - http://download.milesburton.com/Arduino/MaximTemperature/DallasTemperature_372Beta.zip
 - Uses Exosite's basic HTTP API, revision 1.0 https://github.com/exosite/api/tree/master/data
 --- USER MUST DO THE FOLLOWING ---
 - User has an Exosite account and created a device (CIK needed / https://portals.exosite.com -> Add Device)
 - User has added a device to Exosite account and added a data source with alias 'temp', type 'float'
 
  
 Hardware:
 - Arduino Duemilanove or similiar
 - Arduino Ethernet Shield
 - Dallas Semiconductor DS18B20 1-Wire Temp sensor used in parasite power mode (on data pin 7, with 4.7k pull-up)
 
Version History:
- 1.0 - November 8, 2010 - by M. Aanenson
- 2.0 - July 6, 2012 - by M. Aanenson
- 3.0 - October 25, 2013 - by M. Aanenson - Note: Updated to use latest Exosite Arduino Library

*/
  

#include <EEPROM.h>
#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Exosite.h>
 
// Pin use
#define ONEWIRE 7 //pin to use for One Wire interface

// Set up which Arduino pin will be used for the 1-wire interface to the sensor
OneWire oneWire(ONEWIRE);
DallasTemperature sensors(&oneWire);
 
/*==============================================================================
* Configuration Variables
*
* Change these variables to your own settings.
*=============================================================================*/
String cikData = "753807cad60a44dc1a810bab4dcc1a724428782d";  // <-- FILL IN YOUR CIK HERE! (https://portals.exosite.com -> Add Device)
byte macData[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};        // <-- FILL IN YOUR Ethernet shield's MAC address here.

// User defined variables for Exosite reporting period and averaging samples
#define REPORT_TIMEOUT 30000 //milliseconds period for reporting to Exosite.com
#define SENSOR_READ_TIMEOUT 5000 //milliseconds period for reading sensors in loop


/*==============================================================================
* End of Configuration Variables
*=============================================================================*/

class EthernetClient client;
Exosite exosite(cikData, &client);

//
// The 'setup()' function is the first function that runs on the Arduino.
// It runs completely and when complete jumps to 'loop()' 
//
void setup() {
  Serial.begin(9600);
  Serial.println("Boot");
  // Start up the OneWire Sensors library
  sensors.begin();
  delay(1000);
  Serial.println("Starting Exosite Temp Monitor");
  Serial.print("OneWire Digital Pin Specified: ");
  Serial.println(ONEWIRE);
  Ethernet.begin(macData);
  // wait 3 seconds for connection
  delay(3000); 
 
}
 
//
// The 'loop()' function is the 'main' function for Arduino 
// and is essentially a constant while loop. 
//
void loop() {
  static unsigned long sendPrevTime = 0;
  static unsigned long sensorPrevTime = 0; 
  static float tempF;
  char buffer[7];
  String readParam = "";
  String writeParam = "";
  String returnString = "";  
   
  Serial.print("."); // print to show running
 
 // Read sensor every defined timeout period
  if (millis() - sensorPrevTime > SENSOR_READ_TIMEOUT) {
    Serial.println();
    Serial.println("Requesting temperature...");
    sensors.requestTemperatures(); // Send the command to get temperatures
    float tempC = sensors.getTempCByIndex(0);
    Serial.print("Celsius:    ");
    Serial.print(tempC);
    Serial.println(" C ..........DONE");
    tempF = DallasTemperature::toFahrenheit(tempC);
    Serial.print("Fahrenheit: ");
    Serial.print(tempF);
    Serial.println(" F ..........DONE");
    
    sensors.getTempCByIndex(1); // Send the command to get temperatures
    tempC = sensors.getTempCByIndex(1);
    Serial.print("Celsius:    ");
    Serial.print(tempC);
    Serial.println(" C ..........DONE");
    tempF = DallasTemperature::toFahrenheit(tempC);
    Serial.print("Fahrenheit: ");
    Serial.print(tempF);
    Serial.println(" F ..........DONE");
     
    sensorPrevTime = millis();
  }
 
  // Send to Exosite every defined timeout period
  if (millis() - sendPrevTime > REPORT_TIMEOUT) {
    Serial.println(); //start fresh debug line
    Serial.println("Sending data to Exosite...");
    
    readParam = "";        //nothing to read back at this time e.g. 'control&status' if you wanted to read those data sources
    writeParam = "temp="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    String tempValue = dtostrf(tempF, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
    
    writeParam += tempValue;    //add converted temperature String valuen
    
    if ( exosite.writeRead(writeParam, readParam, returnString)) {
      Serial.println("Exosite OK");
      if (returnString != "") {
        Serial.println("Response:");
        Serial.println(returnString);
      }
    }
    else {
      Serial.println("Exosite Error");
    }
    
    readParam = "";        //nothing to read back at this time e.g. 'control&status' if you wanted to read those data sources
    writeParam = "temp1="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    String temp1Value = dtostrf(tempF, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
    
    writeParam += "&temp1="; //add another piece of data to send

    if ( exosite.writeRead(writeParam, readParam, returnString)) {
      Serial.println("Exosite OK");
      if (returnString != "") {
        Serial.println("Response:");
        Serial.println(returnString);
      }
    }
    else {
      Serial.println("Exosite Error");
    }
 
    sendPrevTime = millis(); //reset report period timer
    Serial.println("done sending.");
  }
  delay(1000); //slow down loop
}

i made temp1 as alies in exosite but it not updateing

help me on this

This looks wrong:

    writeParam += "&temp1="; //add another piece of data to send

I haven't used exosite so I'm guessing, but it looks like you can either send a single reading on the write or multiple. Your code looks like it's doing two separate sends, but is trying to using the multiple reading format for the second. Keep them the same except for the initial "temp1=".

Then you'll hopefully find that they both work but are always the same temperature because you're sending the same value - tempF in both cases.

xtr33m:
I made temp sensor project and sending the data to exosite with single DS18b20 sensor and it worked nicely

and this is the code i used

arduino_exosite_library/examples/TemperatureMonitor/TemperatureMonitor.ino at master · exosite-garage/arduino_exosite_library · GitHub

And today i added another DS18B20 temp sensor and made small change in it the temp for another DS18B20 is showing in serial port but the data shows 0 in exosite and it not updateing and this the modified code

/*

Exosite Arduino Basic Temp Monitor 2 (updated to use Exosite library)
 
This sketch shows an example of sending data from a connected
sensor to Exosite. (http://exosite.com) Code was used from various
public examples including the Arduino Ethernet examples and the OneWire
Library examples found on the Arduino playground.
(OneWire Lib credits to Jim Studt, Tom Pollard, Robin James, and Paul Stoffregen)
 
This code keeps track of how many milliseconds have passed
and after the user defined REPORT_TIMEOUT (default 60 seconds)
reports the temperature from a Dallas Semi DS18B20 1-wire temp sensor.
The code sets up the Ethernet client connection and connects / disconnects
to the Exosite server when sending data.
 
Assumptions:

Hardware:

  • Arduino Duemilanove or similiar
  • Arduino Ethernet Shield
  • Dallas Semiconductor DS18B20 1-Wire Temp sensor used in parasite power mode (on data pin 7, with 4.7k pull-up)

Version History:

  • 1.0 - November 8, 2010 - by M. Aanenson
  • 2.0 - July 6, 2012 - by M. Aanenson
  • 3.0 - October 25, 2013 - by M. Aanenson - Note: Updated to use latest Exosite Arduino Library

*/

#include <EEPROM.h>
#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Exosite.h>

// Pin use
#define ONEWIRE 7 //pin to use for One Wire interface

// Set up which Arduino pin will be used for the 1-wire interface to the sensor
OneWire oneWire(ONEWIRE);
DallasTemperature sensors(&oneWire);

/*==============================================================================

  • Configuration Variables
  • Change these variables to your own settings.
    =============================================================================/
    String cikData = "753807cad60a44dc1a810bab4dcc1a724428782d";  // <-- FILL IN YOUR CIK HERE! (https://portals.exosite.com -> Add Device)
    byte macData[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};        // <-- FILL IN YOUR Ethernet shield's MAC address here.

// User defined variables for Exosite reporting period and averaging samples
#define REPORT_TIMEOUT 30000 //milliseconds period for reporting to Exosite.com
#define SENSOR_READ_TIMEOUT 5000 //milliseconds period for reading sensors in loop

/*==============================================================================

  • End of Configuration Variables
    =============================================================================/

class EthernetClient client;
Exosite exosite(cikData, &client);

//
// The 'setup()' function is the first function that runs on the Arduino.
// It runs completely and when complete jumps to 'loop()'
//
void setup() {
 Serial.begin(9600);
 Serial.println("Boot");
 // Start up the OneWire Sensors library
 sensors.begin();
 delay(1000);
 Serial.println("Starting Exosite Temp Monitor");
 Serial.print("OneWire Digital Pin Specified: ");
 Serial.println(ONEWIRE);
 Ethernet.begin(macData);
 // wait 3 seconds for connection
 delay(3000);

}

//
// The 'loop()' function is the 'main' function for Arduino
// and is essentially a constant while loop.
//
void loop() {
 static unsigned long sendPrevTime = 0;
 static unsigned long sensorPrevTime = 0;
 static float tempF;
 char buffer[7];
 String readParam = "";
 String writeParam = "";
 String returnString = "";  
 
 Serial.print("."); // print to show running

// Read sensor every defined timeout period
 if (millis() - sensorPrevTime > SENSOR_READ_TIMEOUT) {
   Serial.println();
   Serial.println("Requesting temperature...");
   sensors.requestTemperatures(); // Send the command to get temperatures
   float tempC = sensors.getTempCByIndex(0);
   Serial.print("Celsius:    ");
   Serial.print(tempC);
   Serial.println(" C ..........DONE");
   tempF = DallasTemperature::toFahrenheit(tempC);
   Serial.print("Fahrenheit: ");
   Serial.print(tempF);
   Serial.println(" F ..........DONE");
   
   sensors.getTempCByIndex(1); // Send the command to get temperatures
   tempC = sensors.getTempCByIndex(1);
   Serial.print("Celsius:    ");
   Serial.print(tempC);
   Serial.println(" C ..........DONE");
   tempF = DallasTemperature::toFahrenheit(tempC);
   Serial.print("Fahrenheit: ");
   Serial.print(tempF);
   Serial.println(" F ..........DONE");
   
   sensorPrevTime = millis();
 }

// Send to Exosite every defined timeout period
 if (millis() - sendPrevTime > REPORT_TIMEOUT) {
   Serial.println(); //start fresh debug line
   Serial.println("Sending data to Exosite...");
   
   readParam = "";        //nothing to read back at this time e.g. 'control&status' if you wanted to read those data sources
   writeParam = "temp="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
   
   String tempValue = dtostrf(tempF, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
   
   writeParam += tempValue;    //add converted temperature String valuen
   
   if ( exosite.writeRead(writeParam, readParam, returnString)) {
     Serial.println("Exosite OK");
     if (returnString != "") {
       Serial.println("Response:");
       Serial.println(returnString);
     }
   }
   else {
     Serial.println("Exosite Error");
   }
   
   readParam = "";        //nothing to read back at this time e.g. 'control&status' if you wanted to read those data sources
   writeParam = "temp1="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
   
   String temp1Value = dtostrf(tempF, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
   
   writeParam += "&temp1="; //add another piece of data to send

if ( exosite.writeRead(writeParam, readParam, returnString)) {
     Serial.println("Exosite OK");
     if (returnString != "") {
       Serial.println("Response:");
       Serial.println(returnString);
     }
   }
   else {
     Serial.println("Exosite Error");
   }

sendPrevTime = millis(); //reset report period timer
   Serial.println("done sending.");
 }
 delay(1000); //slow down loop
}




i made temp1 as alies in exosite but it not updateing 

help me on this

wildbill is right, you really only want to call exosite.writeRead() once per loop unless you have a good reason.

Basically you want to end up with a string that looks like "temp1=26.7&temp2=32.7" and then you'll want to have two dataports on Exosite with the aliases "temp1" and "temp2". So the exosite code would look like this:

// Send to Exosite every defined timeout period
    readParam = "";        //nothing to read back at this time e.g. 'control&status' if you wanted to read those data sources

    // First Dataport
    writeParam = "temp1="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    String tempValue = dtostrf(temp1F, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
    writeParam += tempValue;    //add converted temperature String value

    // Second Dataport
    writeParam = "&temp2="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    String tempValue = dtostrf(temp2F, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
    writeParam += tempValue;    //add converted temperature String value

    // Do write
    if ( exosite.writeRead(writeParam, readParam, returnString)) {
      Serial.println("Exosite OK");
      if (returnString != "") {
        Serial.println("Response:");
        Serial.println(returnString);
      }
    }
    else {
      Serial.println("Exosite Error");
    }

now changed the code to

/*
 Exosite Arduino Basic Temp Monitor 2 (updated to use Exosite library)
  
 This sketch shows an example of sending data from a connected
 sensor to Exosite. (http://exosite.com) Code was used from various
 public examples including the Arduino Ethernet examples and the OneWire
 Library examples found on the Arduino playground. 
 (OneWire Lib credits to Jim Studt, Tom Pollard, Robin James, and Paul Stoffregen)
  
 This code keeps track of how many milliseconds have passed
 and after the user defined REPORT_TIMEOUT (default 60 seconds)
 reports the temperature from a Dallas Semi DS18B20 1-wire temp sensor.
 The code sets up the Ethernet client connection and connects / disconnects 
 to the Exosite server when sending data.
  
 Assumptions:
 - Tested with Aruduino 1.0.5
 - Arduino included Ethernet Library
 - Arduino included SPI Library
 - Using Exosite library (2013-10-20) https://github.com/exosite-garage/arduino_exosite_library
 - Using OneWire Library Version 2.0 - http://www.arduino.cc/playground/Learning/OneWire
 - Using Dallas Temperature Control Library - http://download.milesburton.com/Arduino/MaximTemperature/DallasTemperature_372Beta.zip
 - Uses Exosite's basic HTTP API, revision 1.0 https://github.com/exosite/api/tree/master/data
 --- USER MUST DO THE FOLLOWING ---
 - User has an Exosite account and created a device (CIK needed / https://portals.exosite.com -> Add Device)
 - User has added a device to Exosite account and added a data source with alias 'temp', type 'float'
 
  
 Hardware:
 - Arduino Duemilanove or similiar
 - Arduino Ethernet Shield
 - Dallas Semiconductor DS18B20 1-Wire Temp sensor used in parasite power mode (on data pin 7, with 4.7k pull-up)
 
Version History:
- 1.0 - November 8, 2010 - by M. Aanenson
- 2.0 - July 6, 2012 - by M. Aanenson
- 3.0 - October 25, 2013 - by M. Aanenson - Note: Updated to use latest Exosite Arduino Library

*/
  

#include <EEPROM.h>
#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Exosite.h>
 
// Pin use
#define ONEWIRE 7 //pin to use for One Wire interface

// Set up which Arduino pin will be used for the 1-wire interface to the sensor
OneWire oneWire(ONEWIRE);
DallasTemperature sensors(&oneWire);
 
/*==============================================================================
* Configuration Variables
*
* Change these variables to your own settings.
*=============================================================================*/
String cikData = "753807cad60a44dc1a810bab4dcc1a724428782d";  // <-- FILL IN YOUR CIK HERE! (https://portals.exosite.com -> Add Device)
byte macData[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};        // <-- FILL IN YOUR Ethernet shield's MAC address here.

// User defined variables for Exosite reporting period and averaging samples
#define REPORT_TIMEOUT 30000 //milliseconds period for reporting to Exosite.com
#define SENSOR_READ_TIMEOUT 5000 //milliseconds period for reading sensors in loop


/*==============================================================================
* End of Configuration Variables
*=============================================================================*/

class EthernetClient client;
Exosite exosite(cikData, &client);

//
// The 'setup()' function is the first function that runs on the Arduino.
// It runs completely and when complete jumps to 'loop()' 
//
void setup() {
  Serial.begin(9600);
  Serial.println("Boot");
  // Start up the OneWire Sensors library
  sensors.begin();
  delay(1000);
  Serial.println("Starting Exosite Temp Monitor");
  Serial.print("OneWire Digital Pin Specified: ");
  Serial.println(ONEWIRE);
  Ethernet.begin(macData);
  // wait 3 seconds for connection
  delay(3000); 
 
}
 
//
// The 'loop()' function is the 'main' function for Arduino 
// and is essentially a constant while loop. 
//
void loop() {
  static unsigned long sendPrevTime = 0;
  static unsigned long sensorPrevTime = 0; 
  static float temp1F;
  static float temp2F;
  char buffer[7];
  String readParam = "";
  String writeParam = "";
  String returnString = "";  
   
  Serial.print("."); // print to show running
 
 // Read sensor every defined timeout period
  if (millis() - sensorPrevTime > SENSOR_READ_TIMEOUT) {
    Serial.println();
    Serial.println("Requesting temperature...");
    sensors.requestTemperatures(); // Send the command to get temperatures
    float temp1C = sensors.getTempCByIndex(0);
    Serial.print("Celsius:    ");
    Serial.print(temp1C);
    Serial.println(" C ..........DONE");
    temp1F = DallasTemperature::toFahrenheit(temp1C);
    Serial.print("Fahrenheit: ");
    Serial.print(temp1F);
    Serial.println(" F ..........DONE");
    
    sensors.requestTemperatures(); // Send the command to get temperatures
    float temp2C = sensors.getTempCByIndex(1);
    Serial.print("Celsius:    ");
    Serial.print(temp2C);
    Serial.println(" C ..........DONE");
    temp2F = DallasTemperature::toFahrenheit(temp2C);
    Serial.print("Fahrenheit: ");
    Serial.print(temp2F);
    Serial.println(" F ..........DONE");
     
    sensorPrevTime = millis();
  }
 
  // Send to Exosite every defined timeout period
  if (millis() - sendPrevTime > REPORT_TIMEOUT) {
    Serial.println(); //start fresh debug line
    Serial.println("Sending data to Exosite...");
    
    readParam = "";        //nothing to read back at this time e.g. 'control&status' if you wanted to read those data sources
    writeParam = "temp1="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    String tempValue = dtostrf(temp1F, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
    
    writeParam += tempValue;    //add converted temperature String value
    
    writeParam = "&temp2="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    String tempValue = dtostrf(temp2F, 1, 2, buffer); 
    
    writeParam += tempValue;    //add converted temperature String value
    
    //writeParam += "&message=hello"; //add another piece of data to send

    if ( exosite.writeRead(writeParam, readParam, returnString)) {
      Serial.println("Exosite OK");
      if (returnString != "") {
        Serial.println("Response:");
        Serial.println(returnString);
      }
    }
    else {
      Serial.println("Exosite Error");
    }
 
    sendPrevTime = millis(); //reset report period timer
    Serial.println("done sending.");
  }
  delay(1000); //slow down loop
}

now getting this error

sketch_oct15a.ino: In function 'void loop()':
sketch_oct15a:152: error: redeclaration of 'String tempValue'
sketch_oct15a:146: error: 'String tempValue' previously declared here

Whoops, missed that. In the second dataport section delete the "String " from "String tempValue" and it should compile.

Azdle:
Whoops, missed that. In the second dataport section delete the "String " from "String tempValue" and it should compile.

thanks but now only temp2 value get reflected in exosite and temp1 not getting updated

serial monitor shows both the temp sensor

Sending data to Exosite...
Connecting to Exosite...Connected
Exosite OK
done sending.
....
Requesting temperature...
Celsius: 35.00 C ..........DONE
Fahrenheit: 95.00 F ..........DONE
Celsius: 25.87 C ..........DONE
Fahrenheit: 78.57 F ..........DONE

First thing to check is to make sure that the aliases on the dataports are set right. Make sure they're set to temp1 and temp2.

Other than that it's hard to say. If you want you can email me your device's CIK (patrickbarrett@exosite.com) and I can setup logging for your device and check that all the datasources are setup correctly.

Azdle:
First thing to check is to make sure that the aliases on the dataports are set right. Make sure they're set to temp1 and temp2.

Other than that it's hard to say. If you want you can email me your device's CIK (patrickbarrett@exosite.com) and I can setup logging for your device and check that all the datasources are setup correctly.

thanks patrick and i send you mail :slight_smile:

It looks like you have the dataports correct and they're being updated, temp1 and temp2 (Sump and Main Tank) both say they were updated 20 minutes ago. Although temp2 is 0.0, is that not the value you're expecting?

I've setup logging, make sure the device is on and reporting so that I can see what the request looks like.

Azdle:
It looks like you have the dataports correct and they're being updated, temp1 and temp2 (Sump and Main Tank) both say they were updated 20 minutes ago. Although temp2 is 0.0, is that not the value you're expecting?

I've setup logging, make sure the device is on and reporting so that I can see what the request looks like.

now the device is connected

Sending data to Exosite...
Connecting to Exosite...No Connection...Connected
Exosite OK
Response:
00&temp1=
done sending.
.
Requesting temperature...
Celsius: 35.31 C ..........DONE
Fahrenheit: 95.56 F ..........DONE
Celsius: 25.69 C ..........DONE
Fahrenheit: 78.24 F ..........DONE
......
Requesting temperature...
Celsius: 35.25 C ..........DONE
Fahrenheit: 95.45 F ..........DONE
Celsius: 25.69 C ..........DONE
Fahrenheit: 78.24 F ..........DONE
.....
Requesting temperature...
Celsius: 35.25 C ..........DONE
Fahrenheit: 95.45 F ..........DONE
Celsius: 25.69 C ..........DONE
Fahrenheit: 78.24 F ..........DONE
.....
Requesting temperature...
Celsius: 35.25 C ..........DONE
Fahrenheit: 95.45 F ..........DONE
Celsius: 25.62 C ..........DONE
Fahrenheit: 78.12 F ..........DONE
.....
Requesting temperature...
Celsius: 35.25 C ..........DONE
Fahrenheit: 95.45 F ..........DONE
Celsius: 25.69 C ..........DONE
Fahrenheit: 78.24 F ..........DONE
.
Sending data to Exosite...
Connecting to Exosite...Connected
Exosite OK
done sending.

i think only temp2 data was reflecting in exosite and temp1 not getting any update

Ah, another copy/paste error on my part, sorry about that.

writeParam = "&temp2=";

should be

writeParam += "&temp2=";

Right now it's overwriting the existing value instead of appending to it.

Azdle:
Ah, another copy/paste error on my part, sorry about that.

writeParam = "&temp2=";

should be

writeParam += "&temp2=";

Right now it's overwriting the existing value instead of appending to it.

awesome it works thanks a ton :smiley:

Next i planned to add DHT11 sensor on it

/*
 Exosite Arduino Basic Temp Monitor 2 (updated to use Exosite library)
  
 This sketch shows an example of sending data from a connected
 sensor to Exosite. (http://exosite.com) Code was used from various
 public examples including the Arduino Ethernet examples and the OneWire
 Library examples found on the Arduino playground. 
 (OneWire Lib credits to Jim Studt, Tom Pollard, Robin James, and Paul Stoffregen)
  
 This code keeps track of how many milliseconds have passed
 and after the user defined REPORT_TIMEOUT (default 60 seconds)
 reports the temperature from a Dallas Semi DS18B20 1-wire temp sensor.
 The code sets up the Ethernet client connection and connects / disconnects 
 to the Exosite server when sending data.
  
 Assumptions:
 - Tested with Aruduino 1.0.5
 - Arduino included Ethernet Library
 - Arduino included SPI Library
 - Using Exosite library (2013-10-20) https://github.com/exosite-garage/arduino_exosite_library
 - Using OneWire Library Version 2.0 - http://www.arduino.cc/playground/Learning/OneWire
 - Using Dallas Temperature Control Library - http://download.milesburton.com/Arduino/MaximTemperature/DallasTemperature_372Beta.zip
 - Uses Exosite's basic HTTP API, revision 1.0 https://github.com/exosite/api/tree/master/data
 --- USER MUST DO THE FOLLOWING ---
 - User has an Exosite account and created a device (CIK needed / https://portals.exosite.com -> Add Device)
 - User has added a device to Exosite account and added a data source with alias 'temp', type 'float'
 
  
 Hardware:
 - Arduino Duemilanove or similiar
 - Arduino Ethernet Shield
 - Dallas Semiconductor DS18B20 1-Wire Temp sensor used in parasite power mode (on data pin 7, with 4.7k pull-up)
 
Version History:
- 1.0 - November 8, 2010 - by M. Aanenson
- 2.0 - July 6, 2012 - by M. Aanenson
- 3.0 - October 25, 2013 - by M. Aanenson - Note: Updated to use latest Exosite Arduino Library

*/
  

#include <EEPROM.h>
#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Exosite.h>
#include "DHT.h"
 
// Pin use
#define ONEWIRE 7 //pin to use for One Wire interface
#define DHTPIN 2
DHT dht(DHTPIN, DHT11);

// Set up which Arduino pin will be used for the 1-wire interface to the sensor
OneWire oneWire(ONEWIRE);
DallasTemperature sensors(&oneWire);
 
/*==============================================================================
* Configuration Variables
*
* Change these variables to your own settings.
*=============================================================================*/
String cikData = "753807cad60a44dc1a810bab4dcc1a724428782d";  // <-- FILL IN YOUR CIK HERE! (https://portals.exosite.com -> Add Device)
byte macData[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};        // <-- FILL IN YOUR Ethernet shield's MAC address here.

// User defined variables for Exosite reporting period and averaging samples
#define REPORT_TIMEOUT 30000 //milliseconds period for reporting to Exosite.com
#define SENSOR_READ_TIMEOUT 5000 //milliseconds period for reading sensors in loop


/*==============================================================================
* End of Configuration Variables
*=============================================================================*/

class EthernetClient client;
Exosite exosite(cikData, &client);

//
// The 'setup()' function is the first function that runs on the Arduino.
// It runs completely and when complete jumps to 'loop()' 
//
void setup() {
  Serial.begin(9600);
  Serial.println("Boot");
  // Start up the OneWire Sensors library
  sensors.begin();
  delay(1000);
  Serial.println("Starting Exosite Temp Monitor");
  Serial.print("OneWire Digital Pin Specified: ");
  Serial.println(ONEWIRE);
  Ethernet.begin(macData);
  // wait 3 seconds for connection
  delay(3000); 
 
}
 
//
// The 'loop()' function is the 'main' function for Arduino 
// and is essentially a constant while loop. 
//
void loop() {
  static unsigned long sendPrevTime = 0;
  static unsigned long sensorPrevTime = 0; 
  static float temp1F;
  static float temp2F;
  static float temh;
  char buffer[7];
  String readParam = "";
  String writeParam = "";
  String returnString = "";  
   
  Serial.print("."); // print to show running
 
 // Read sensor every defined timeout period
  if (millis() - sensorPrevTime > SENSOR_READ_TIMEOUT) {
    Serial.println();
    Serial.println("Requesting temperature...");
    sensors.requestTemperatures(); // Send the command to get temperatures
    float temp1C = sensors.getTempCByIndex(0);
    Serial.print("Celsius:    ");
    Serial.print(temp1C);
    Serial.println(" C ..........DONE");
    temp1F = DallasTemperature::toFahrenheit(temp1C);
    Serial.print("Fahrenheit: ");
    Serial.print(temp1F);
    Serial.println(" F ..........DONE");
    
    sensors.requestTemperatures(); // Send the command to get temperatures
    float temp2C = sensors.getTempCByIndex(1);
    Serial.print("Celsius:    ");
    Serial.print(temp2C);
    Serial.println(" C ..........DONE");
    temp2F = DallasTemperature::toFahrenheit(temp2C);
    Serial.print("Fahrenheit: ");
    Serial.print(temp2F);
    Serial.println(" F ..........DONE");
    
      // Wait a few seconds between measurements.
     delay(2000);

  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float temh = dht.readHumidity();
  // Read temperature as Celsius
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit
  float f = dht.readTemperature(true);
  
  // Check if any reads failed and exit early (to try again).
  if (isnan(temh) || isnan(t) || isnan(f)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
      }

  // Compute heat index
  // Must send in temp in Fahrenheit!
  float hi = dht.computeHeatIndex(f, temh);

  Serial.print("Humidity: "); 
  Serial.print(temh);
  Serial.print(" %\t");
  Serial.print("Temperature: "); 
  Serial.print(t);
  Serial.print(" *C ");
  Serial.print(f);
  Serial.print(" *F\t");
  Serial.print("Heat index: ");
  Serial.print(hi);
  Serial.println(" *F");

     
    sensorPrevTime = millis();
    
  }
 
  // Send to Exosite every defined timeout period
  if (millis() - sendPrevTime > REPORT_TIMEOUT) {
    Serial.println(); //start fresh debug line
    Serial.println("Sending data to Exosite...");
    
    readParam = "";        //nothing to read back at this time e.g. 'control&status' if you wanted to read those data sources
    writeParam = "temp1="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    String tempValue = dtostrf(temp1F, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
    
    writeParam += tempValue;    //add converted temperature String value
    
    writeParam += "&temp2="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    tempValue = dtostrf(temp2F, 1, 2, buffer); 
    
    writeParam += tempValue;    //add converted temperature String value
    
    writeParam += "&hum="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    String humValue = dtostrf(temh, 1, 2, buffer);
    
    writeParam += humValue;    //add converted temperature String value
    
    //writeParam += "&message=hello"; //add another piece of data to send

    if ( exosite.writeRead(writeParam, readParam, returnString)) {
      Serial.println("Exosite OK");
      if (returnString != "") {
        Serial.println("Response:");
        Serial.println(returnString);
      }
    }
    else {
      Serial.println("Exosite Error");
    }
 
    sendPrevTime = millis(); //reset report period timer
    Serial.println("done sending.");
  }
  delay(1000); //slow down loop
  
}

humidity is showing correctly in serial port but i making some issue in sending the data to exosite this is the part i have issue i think

    writeParam += "&hum="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    String humValue = dtostrf(temh, 1, 2, buffer);
    
    writeParam += humValue;    //add converted temperature String value

You have declared a second variable called temh here:

  float temh = dht.readHumidity();

This one is masking the static variable with the same name which you use to send data to exosite.

Get rid of the word float in the snippet above.

wildbill:
You have declared a second variable called temh here:

  float temh = dht.readHumidity();

This one is masking the static variable with the same name which you use to send data to exosite.

Get rid of the word float in the snippet above.

Thanks will i missed out :slight_smile: