Can't able to connect with exosite portal


#1

Hi all, I’m trying to send monitored arduino data to my exosite’s portal over LAN. My institute have a proxy authentication system but they have allotted me a bypassed IP, gateway, subnet and dns address.

This is my code:

#include < EEPROM.h>
#include < SPI.h>
#include < Ethernet.h>
#include < DHT.h>
#include < Exosite.h>

#define DHTPIN 2

#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

String cikData = “140219bf707abc52************************”;
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE };

IPAddress dnserver(***,31,1,***);
IPAddress gateway(*,26,,***);
IPAddress subnet(***,255,***,0);
IPAddress ip(***,26,34,51);

#define REPORT_TIMEOUT 30000 //milliseconds period for reporting to Exosite.com
#define SENSOR_READ_TIMEOUT 5000 //milliseconds period for reading sensors in loop

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

void setup() {
Serial.begin(9600);
Serial.println(“Boot”);
dht.begin();
delay(1000);
Serial.println("Starting Exosite Temp Monitor ");
Serial.print("DHT Digital Pin Specified: ");
Serial.println(DHTPIN);
Ethernet.begin(mac, ip, subnet, gateway, dnserver);
// wait 3 seconds for connection
delay(3000);

}

void loop() {
static unsigned long sendPrevTime = 0;
static unsigned long sensorPrevTime = 0;
static float tempC;
static float h;
char buffer[7];
String readParam = “”;
String writeParam = “”;
String returnString = “”;
// Wait a few seconds between measurements.

Serial.print("."); // print to show running

// Read sensor every defined timeout period
if (millis() - sensorPrevTime > SENSOR_READ_TIMEOUT) {
Serial.println();
Serial.println(“Requesting temperature…”);
dht.readTemperature(); // Send the command to get temperatures
float tempC = dht.readTemperature();
Serial.print(“Celsius: “);
Serial.print(tempC);
Serial.println(” C …DONE”);
tempC = dht.readTemperature();
//
Serial.println();
Serial.println(“Requesting humidity…”);
dht.readHumidity(); // Send the command to get humidity
float h = dht.readHumidity();
Serial.print(“Percent: “);
Serial.print(h);
Serial.println(” % …DONE”);
h = dht.readHumidity();

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…”);
tempC = dht.readTemperature();
h = dht.readHumidity();

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(tempC, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2

writeParam += tempValue;    //add converted temperature String value

writeParam += "&humidity="; //add humidity

writeParam += h;

//Debug//

//Serial.println(writeParam);

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
}
This is the error I m getting:

I think that the code is fine.
I just not received data to my exosite, and the arduino serial monitor sent me a message “Can’t connect to Exosite”.

Maybe I’m missing something.
Can anyone help me to resolve this.
Thanks in advance for your answer guys,
Regards,
Prakash


#2

HI @prakashs,

Thanks for posting! Given the considerations in your route to Exosite, you may need to verify that you reach our servers first. Any way for you to test the result of :

Ethernet.begin(mac, ip, subnet, gateway, dnserver);

Additionally, are you using a ‘generic’ device as a client in our system? If you had not, then your CIK may not be activated. You should be able to figure this out by clicking on your device in your /manage/devices page.

After looking at your sketch, I can say it looks fine. If we can dig up more information on your ethernet communication, we should be able to find the problem.

Thanks,
-Martin


#3

Thanks @Martin for replying.

The problem is rectified.
The actual problem was with the proxy authentication for our LAN network.
My network administrator assigned me a bypassed IP address.
So, Now its working very fine.

But thanks for the helping hand.

Regards
Prakash