2024-10-0100
This commit is contained in:
parent
0612154ebc
commit
298f50a97e
|
@ -41,7 +41,7 @@ build_flags = ${env.build_flags}
|
|||
-Dmqtt_port=61883
|
||||
-DINNEN=\"hjk/devices/TEMPWOHNZIM/telemetry/temperature\"
|
||||
-DHUNIDITY=\"hjk/devices/TEMPWOHNZIM/telemetry/humidity\"
|
||||
-DFLUR=\"hjk/devices/TEMPFLUR/telemetry/temperature\"
|
||||
;-DFLUR=\"hjk/devices/TEMPFLUR/telemetry/temperature\"
|
||||
-DCO2=\"hjk/devices/257923/telemetry/co2\"
|
||||
-DAKKU=\"hjk/devices/WETTERSTATION/telemetry/battery\"
|
||||
-DWETTER=\"hjk/devices/WETTERSTATION/telemetry/temperature_Htu_21\"
|
||||
|
@ -68,3 +68,4 @@ build_flags = ${env.build_flags}
|
|||
-DLUFTDRUCK=\"hjk/devices/WETTERSTATIONBORIS/telemetry/pressure\"
|
||||
-DFEUCHTIGKEIT=\"hjk/devices/WETTERSTATIONBORIS/telemetry/humity\"
|
||||
-DHELLIGKEIT=\"hjk/devices/WETTERSTATIONBORIS/telemetry/Lux\"
|
||||
-DHUNIDITY=\"hjk/devices/TEMPWOHNZIM/telemetry/humidity\"
|
||||
|
|
55
src/main.cpp
55
src/main.cpp
|
@ -47,7 +47,7 @@ Ticker display_ticker;
|
|||
#endif
|
||||
|
||||
#define MaxErrCount 30
|
||||
const unsigned long stoerung = 15 * 60000000UL; // Minuten * Mikrosekunden für Sleep Mode
|
||||
const unsigned long stoerung = 1 * 60000000UL; // Minuten * Mikrosekunden für Sleep Mode
|
||||
unsigned long startTime;
|
||||
unsigned long endTime;
|
||||
#include <Wire.h>
|
||||
|
@ -115,7 +115,7 @@ const int TimeX = 1;
|
|||
const int WetterY = 32;
|
||||
const int WetterX = 18;
|
||||
|
||||
const int CoY = 43;
|
||||
const int CoY = 41;
|
||||
|
||||
|
||||
|
||||
|
@ -341,7 +341,8 @@ void reconnect() {
|
|||
Serial.print("failed, rc=");
|
||||
Serial.print(client.state());
|
||||
Serial.println(" try again in 5 seconds");
|
||||
// Wait 5 seconds before retrying
|
||||
display.setCursor(1,56);
|
||||
display.print("ERROR: MQTT!!!");
|
||||
delay(5000);
|
||||
}
|
||||
}
|
||||
|
@ -483,6 +484,41 @@ void ZeigeFeuchtigkeit(double Wetter1, int yPos = 2, int xPos = 1)
|
|||
|
||||
}
|
||||
}
|
||||
void ZeigeTemperatur(float temperatur, uint16_t Color){
|
||||
char szWetter[15];
|
||||
if (temperatur > -99)
|
||||
{
|
||||
dtostrf(temperatur, 5, 1, szWetter);
|
||||
display.setFont();
|
||||
display.setCursor(1, 30);
|
||||
display.setTextColor(Color);
|
||||
display.fillRect(0, 29, 40, 9, myBLACK);
|
||||
display.print(szWetter);
|
||||
display.setCursor(31, 25);
|
||||
display.setFont(&Picopixel);
|
||||
display.print("o");
|
||||
display.setCursor(34, 36);
|
||||
display.setFont();
|
||||
display.print("C");
|
||||
display.setFont(0);
|
||||
}
|
||||
}
|
||||
void ZeigeInnenFeuchtigkeit(float Luftfeuchtigkeit){
|
||||
char szWetter[15];
|
||||
if (Luftfeuchtigkeit > 0)
|
||||
{
|
||||
dtostrf(Luftfeuchtigkeit, 2, 0, szWetter);
|
||||
display.setFont();
|
||||
display.setCursor(45, 30);
|
||||
display.setTextColor(myWHITE);
|
||||
display.fillRect(45, 30, 64, 7, myBLACK);
|
||||
display.print(szWetter);
|
||||
display.print("%");
|
||||
display.setFont(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Test()
|
||||
{
|
||||
display.setCursor(1, 40);
|
||||
|
@ -734,6 +770,7 @@ static void setup_wifi() {
|
|||
Serial.print(".");
|
||||
ErrCount ++;
|
||||
if (ErrCount >= MaxErrCount){
|
||||
Serial.print("\tKeine Kontakt zum WLAN !!!");
|
||||
endTime = millis();
|
||||
unsigned long Pause = stoerung -((endTime - startTime) * 1000); // Pause
|
||||
ESP.deepSleep(Pause); // Pause
|
||||
|
@ -762,8 +799,11 @@ void loop() {
|
|||
blinkSek = !blinkSek;
|
||||
ZeigeDatum(timeinfo, 1, 1);
|
||||
ZeigeZeit(timeinfo, TimeX, TimeY);
|
||||
ZeigeTemperatur(TempWohn, myWHITE);
|
||||
ZeigeInnenFeuchtigkeit(LuftfeuchtigkeitWohnug);
|
||||
|
||||
//ZeigeZeit(timeinfo, 1,40);
|
||||
//ZeigeCO(1,CoY);
|
||||
ZeigeCO(1,CoY);
|
||||
/* if ((timeinfo.tm_min % 10) == 0){
|
||||
/* if (Covid19 != 0){
|
||||
scroll_text(matrix_height-8,20,"Landkreis Heilbronn", 30,30,30, true);
|
||||
|
@ -795,21 +835,22 @@ void loop() {
|
|||
scroll_text2(matrix_height-24,20,"ich w\201nsche Euch allen ein", 128,128,0, true);
|
||||
scroll_text2(matrix_height-24,20,"Frohes neues Jahr 2022.", 128,255,0, true); */
|
||||
|
||||
if (timeinfo.tm_min %2 != 0){
|
||||
/* if (timeinfo.tm_min %2 != 0){
|
||||
ZeigeWetter(double(TempWohn), WetterY,WetterX);
|
||||
}else {
|
||||
ZeigeFeuchtigkeit(double(LuftfeuchtigkeitWohnug), WetterY,WetterX);
|
||||
}
|
||||
} */
|
||||
//Serial.println("START");
|
||||
if (Aussentemp > -99.9){
|
||||
char szWetter[10];
|
||||
dtostrf(TempFlur, 4, 1, szWetter);
|
||||
//Serial.print(Aussentemp); Serial.print(" "); Serial.println(szWetter);
|
||||
#ifdef FLUR
|
||||
scroll_Grad(matrix_height-8,30," Flur: " + String(szWetter), 64,64,64, true);
|
||||
#endif
|
||||
/* Achtung sehr wichtig,
|
||||
wenn das gesamt Laufschrift mehr
|
||||
als 30 Sekunden Dauert muss ein .... */
|
||||
client.loop();
|
||||
/* eingeführt werden, sonst kommt es zu
|
||||
einen Socket Fehler !!!! */
|
||||
scroll_text(matrix_height-8,30,"Luftdruck: " + String(Pressure) + " hPa", 255,255,255, true);
|
||||
|
|
Loading…
Reference in New Issue
Block a user