Bekomme den BMP 180 nicht eingebunden im Weather Undeground
habe eine wetterstation aufgebaut.
mit dht22, bmp 180, windssensor, regensensor.
Über thinkspeak bekomme ich alle sachen angezeigt.
jedoch finde ich das weather underground besser in den einzelheiten.
aber sobald ich den bmp180 einbinde, wird der zwar im seriellen monitor korrekt angezeigt, jedoch auf der homepage des weather ground fehlen dann alle anderen daten, wie temperatur, feuchtigkeit usw.
woran könnte das liegen.
mit dht22, bmp 180, windssensor, regensensor.
Über thinkspeak bekomme ich alle sachen angezeigt.
jedoch finde ich das weather underground besser in den einzelheiten.
aber sobald ich den bmp180 einbinde, wird der zwar im seriellen monitor korrekt angezeigt, jedoch auf der homepage des weather ground fehlen dann alle anderen daten, wie temperatur, feuchtigkeit usw.
woran könnte das liegen.
code: [select]
#include <esp8266wifi.h>
#include "dht.h"
#include <adafruit_bmp085.h> //barometer
adafruit_bmp085 bmp; // bmp pressure sensor
#define dhtpin 2 //pin attach dht
#define dhttype dht22 //type of dth
const char* ssid = "fri";
const char* password = "re";
const int sleeptimes = 600; //18000 half hour, 300 5 minutes etc.
///////////////weather////////////////////////
char server [] = "weatherstation.wunderground.com";
char webpage [] = "get /weatherstation/updateweatherstation.php?";
char id [] = "in";
char password [] = "";
/////////////ifttt///////////////////////
const char* host = "maker.ifttt.com";//dont change
const string ifttt_event = "youreventname";
const int puertohost = 80;
const string maker_key = "yourmakerkey";
string conexionif = "post /trigger/"+ifttt_event+"/with/key/"+maker_key +" http/1.1\r\n" +
"host: " + host + "\r\n" +
"content-type: application/x-www-form-urlencoded\r\n\r\n";
//////////////////////////////////////////
dht dht(dhtpin, dhttype);
void setup()
{
serial.begin(115200);
dht.begin();
bmp.begin(); //pressure sensor
delay(1000);
serial.println();
serial.print("connecting ");
serial.println(ssid);
wifi.begin(ssid, password);
while (wifi.status() != wl_connected) {
delay(500);
serial.print(".");
}
}
void loop(){
//check battery
int level = analogread(a0);
level = map(level, 0, 1024, 0, 100);
if(level<50)
{
mandarnot(); //send iftt
serial.println("low batter");
delay(500);
}
//get sensor data
//float pressure = bmp.readpressure();
float tempc = dht.readtemperature();
float tempf = (tempc * 9.0)/ 5.0 + 32.0;
float humidity = dht.readhumidity();
float dewptf = (dewpoint(tempf, dht.readhumidity()));
float baromin = bmp.readpressure()/100;// calc converting pa inhg (wunderground)
//check sensor data
serial.println("+++++++++++++++++++++++++");
serial.print("tempf= ");
serial.print(tempf);
serial.println(" *f");
serial.print("tempc= ");
serial.print(tempc);
serial.println(" *c");
serial.print("dew point= ");
serial.println(dewptf);
serial.print("humidity= ");
serial.println(humidity);
serial.print("baro= ");
serial.print(baromin);
//send data weather underground
serial.print("connecting ");
serial.println(server);
wificlient client;
if (!client.connect(server, 80)) {
serial.println("conection fail");
return;
}
client.print(webpage);
client.print("id=");
client.print(id);
client.print("&password=");
client.print(password);
client.print("&dateutc=");
client.print("now");
client.print("&tempf=");
client.print(tempf);
client.print("&dewptf=");
client.print(dewptf);
client.print("&humidity=");
client.print(humidity);
//client.print("&baromin=");
//client.print(baromin);
//client.print("pressure");
//client.print("&hpa=");
// client.print(hpa);
//client.print(altitude);
// client.print(" m");
client.print("&softwaretype=esp%208266o%20version1&action=updateraw&realtime=1&rtfreq=2.5");
client.println();
delay(2500);
sleepmode();
}
double dewpoint(double tempf, double humidity) //calculate dew point
{
double a0= 373.15/(273.15 + tempf);
double sum = -7.90298 * (a0-1);
sum += 5.02808 * log10(a0);
sum += -1.3816e-7 * (pow(10, (11.344*(1-1/a0)))-1) ;
sum += 8.1328e-3 * (pow(10,(-3.49149*(a0-1)))-1) ;
sum += log10(1013.246);
double vp = pow(10, sum-3) * humidity;
double t = log(vp/0.61078);
return (241.88 * t) / (17.558-t);
}
void mandarnot(){
wificlient client;
if (!client.connect(host, puertohost)) //check connection
{
serial.println("failed connection");
return;
}
client.print(conexionif);//send information
delay(10);
while(client.available())
{
string line = client.readstringuntil('\r');
serial.print(line);
}
}
void sleepmode(){
serial.print(f("sleeping..."));
esp.deepsleep(sleeptimes * 1000);
}
Arduino Forum > International > Deutsch (Moderator: uwefed) > Bekomme den BMP 180 nicht eingebunden im Weather Undeground
arduino
Comments
Post a Comment