Ich verwende einen NodeMCU V1 (ESP8266) mit einem BME280 Sensor um Temperatur, Luftdruck und Luftfeuchtigkeit von unserem WoMo zu messen und übertragen.
Im Seriellen Monitor von Arduino Vers. 2.0 sehe ich alle drei Werte nur in der Blynk Ausgabe bekomme ich nur die Temperatur angezeigt.
Leider habe ich mittlerweile keine Idee wo der Fehler liegt. Bin kein Programmierer!!
In der alten Version hat das alles gut funktioniert.
Hier noch der der Arduino Code.
/*BLYNK with BME280
für Zuhause, unklar ist warum bekomme ich nur die Temperatur in Blynk
vom April 2023
*/
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme; //I2C
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPLyjwTFbHV"
#define BLYNK_TEMPLATE_NAME "TemperaturmessungZuhause"
#define BLYNK_AUTH_TOKEN "M7IrT12a6xHRuzjomt3iHluPwyX1ZCO_"
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char ssid[] = "XXXXXXX";
char pass[] = "XXXXXXXX";
char auth[] = "oUXjpbTVm1_qcbXjmQC6Lxk6Fp-zPvGz";
SimpleTimer timer;
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
// 0x76 I2C Adresse vom Sensor
if (!bme.begin(0x76)) {
Serial.println("Keinen Sensor gefunden");
while (1);
}
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}
void loop()
{
if(millis()%10000==0){
double temp =bme.readTemperature();
double pressure =bme.readPressure() / 100.0F;
double hum =bme.readHumidity();
Serial.print("Temperatur: ");Serial.println(temp);
Serial.print("Luftdruck: ");Serial.println(pressure);
Serial.print("Luftfeuchtigkeit: ");Serial.println(hum);
Blynk.virtualWrite(V1, temp);
Blynk.virtualWrite(V2, pressure);
Blynk.virtualWrite(V3, hum);
}
Blynk.run();
}
/*BLYNK with BME280
für Zuhause, unklar ist warum bekomme ich nur die Temperatur in Blynk
vom April 2023
*/
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme; //I2C
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPLyjwTFbHV"
#define BLYNK_TEMPLATE_NAME "TemperaturmessungZuhause"
#define BLYNK_AUTH_TOKEN "M7IrT12a6xHRuzjomt3iHluPwyX1ZCO_"
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char ssid[] = "Devolo_WT";
char pass[] = "-Jens&01";
char auth[] = "oUXjpbTVm1_qcbXjmQC6Lxk6Fp-zPvGz";
SimpleTimer timer;
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
// 0x76 I2C Adresse vom Sensor
if (!bme.begin(0x76)) {
Serial.println("Keinen Sensor gefunden");
while (1);
}
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}
void loop()
{
if(millis()%10000==0){
double temp =bme.readTemperature();
double pressure =bme.readPressure() / 100.0F;
double hum =bme.readHumidity();
Serial.print("Temperatur: ");Serial.println(temp);
Serial.print("Luftdruck: ");Serial.println(pressure);
Serial.print("Luftfeuchtigkeit: ");Serial.println(hum);
Blynk.virtualWrite(V1, temp);
Blynk.virtualWrite(V2, pressure);
Blynk.virtualWrite(V3, hum);
}
Blynk.run();
}
@Walter_Trollmann Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
Copy and paste these if you can’t find the correct symbol on your keyboard.
Pete.
@Walter_Trollmann the triple baackticks go before and after your CODE, not the whole of your post.
Pete.
Have you checked on the Blynk Platform that you are using the correct setting and not INT string
Blynk.virtualWrite(V1, temp); // What is the Platform setting
Blynk.virtualWrite(V2, pressure); // What is the Platform setting
Blynk.virtualWrite(V3, hum); // What is the Platform setting