hi i have to upoload bmp 180 sensor values to the website but i am not getting sensor values on website can any one please help me. here is the aurduino code
#include <SFE_BMP180.h>
#include <Wire.h>
#include <SPI.h>
#include <Ethernet.h>
#include <Servo.h>
SFE_BMP180 pressure;
#define ALTITUDE 1655.0
Servo myservo;
byte mac[] = { 0x98, 0x4F, 0xEE,0x01, 0x65, 0x4E };
IPAddress ip(192,168,19,170);
char server[] = "192.168.19.171";
EthernetClient client;
void setup() {
pressure.begin();
Serial.begin(9600);
while (!Serial) {
;
}
Ethernet.begin(mac,ip);
}
void loop() {
char status;
double T,P,p0,a;
status = pressure.startTemperature();
if (status != 0)
{
// Wait for the measurement to complete:
delay(status);
// Retrieve the completed temperature measurement:
// Note that the measurement is stored in the variable T.
// Function returns 1 if successful, 0 if failure.
status = pressure.getTemperature(T);
if (status != 0)
{
status = pressure.startPressure(3);
if (status != 0)
{
//a = pressure.altitude(P,p0);
// Wait for the measurement to complete:
delay(status);
status = pressure.getPressure(P,T);
if (status != 0)
{
// Print out the measurement:
p0 = pressure.sealevel(P,ALTITUDE);
a = pressure.altitude(P,p0);
}
}
}
}
if (client.connect(server, 80))
{
Serial.println("Connection: done");
client.print("GET smart/data.php?");// This
client.println(" HTTP/1.0"); // Part of the GET request
client.println("Host:192.168.19.171");
client.println("Connection: close"); // Part of the GET request telling the server that we are over transmitting the message
client.println(); // Empty line
client.println(); // Empty line
client.stop(); // Closing connection to server
}
else {
// If Arduino can't connect to the server (your computer or web page)
Serial.println("--> connection failed\n");
}
// Give the server some time to recieve the data and store it. I used 10 seconds here. Be advised when delaying. If u use a short delay, the server might not capture data because of Arduino transmitting new data too soon.
delay(1000);
}