2024-10-0701 Kein Kontakt zum MQTT Server

This commit is contained in:
hans-jurgen 2024-10-07 17:00:47 +02:00
parent bc3ffb5f45
commit ad373e4269
3 changed files with 10 additions and 9 deletions

View File

@ -28,7 +28,7 @@ void init_HTU21(){
void read_HTU21D() {
float t = htu.readTemperature();
t = t + K_HTU;
t = t + KorrekturTemperatur;
dtostrf(t,7,1,htuData.temperature);
float h = htu.readHumidity();
dtostrf(h,7,1,htuData.humity);

View File

@ -88,7 +88,7 @@ build_flags = ${env.build_flags}
-DDNS=\"192.168.2.1\"
-DKMYIP=\"192.168.2.41\"
-Dmqtt_server=\"hjkmqtt.dedyn.io\"
-Dmqtt_port=8883
-Dmqtt_port=61883
-DTERROR=20
-DTLOWBATT=60
-DTINTERVAL=5
@ -96,7 +96,7 @@ build_flags = ${env.build_flags}
-DUBKorectur=0.854417949
-DMinimalSpannung=3.00
-DKorrekturLuftdruck=23.58
-DKorrekturTemperatur=0.0
-DKorrekturTemperatur=-3,5
[env:hjk]
build_flags = ${env.build_flags}

View File

@ -14,7 +14,7 @@
void reconnect();
void setup_wifi();
void verifyFingerprint();
//void verifyFingerprint();
void callback(char* topic1, byte* payload, unsigned int length);
void pulse_pin(uint8_t pin);
@ -49,9 +49,9 @@ IPAddress dns;
IPAddress secondaryDNS(8, 8, 8, 8);
//const char* mqtt_fprint = "a3:44:1d:aa:6e:e5:c7:55:02:20:98:ea:9b:df:1a:42:a2:f3:e3:0d";
const char* mqtt_user = "mqtt";
const char* mqtt_pass = "fische";
const char* mqtt_fprint = "a3:44:1d:aa:6e:e5:c7:55:02:20:98:ea:9b:df:1a:42:a2:f3:e3:0d";
const char* mqtt_user = "hjk";
const char* mqtt_pass = "51fische#";
const unsigned long interval = TINTERVAL * 60000000LU; // Minuten * Mikrosekunden für Sleep Mode
const unsigned long intervalLowBatt = TLOWBATT * 60000000LU; // Minuten * Mikrosekunden für Sleep Mode, Akku entladen
@ -80,7 +80,8 @@ void setup() {
digitalWrite(BUILTIN_LED, HIGH); */
Serial.begin(74880);
while ( !Serial ) delay(100); // wait for native usb
WiFi.mode( WIFI_OFF );
//WiFi.mode( WIFI_OFF );
WiFi.mode(WIFI_STA);
WiFi.forceSleepBegin();
Serial.println();
@ -292,7 +293,7 @@ void callback(char* topic1, byte* payload, unsigned int length)
void reconnect() {
// Loop until we're reconnected
sprintf(clientName, "%s%s", "ESP8266Wetter", sID);
sprintf(clientName, "%s%s", "WetterSensor", sID);
while (!client.connected()) {
Serial.print("Attempting MQTT connection...");
//verifyFingerprint();