#include "bsec.h" #include "ESP8266WiFi.h" #include "WiFiUdp.h" #ifndef STASSID #define STASSID "XXXXXXXXXXXX" #define STAPSK "XXXXXXXXXXXX" #endif const char * udpAddress = "192.168.178.XX"; // Miniserver // Hier sind einige der Ports die ich schon probiert hab und die jetzt geblockt sind. Ich hab aber noch mehr ausprobiert const int udpPort = 56575; // 56564 //8445 // 7009 //55057 / 8444 //33021 //27099 const String sensor= "ESP8266-1: "; //create UDP instance WiFiUDP Udp; // Helper functions declarations void checkIaqSensorStatus(void); // void errLeds(void); // Create an object of the class Bsec Bsec iaqSensor; String output; int count; double pres; int iaq_; int iaqaccu; double temp; double hum; double iaqstat; double co2equiv; double VOCequiv; void setup(void) { Serial.begin(115200); Wire.begin(0, 2); WiFi.mode(WIFI_STA); WiFi.begin(STASSID, STAPSK); while (WiFi.status() != WL_CONNECTED) { Serial.print('.'); delay(500); } Serial.print("Connected! IP address: "); Serial.println(WiFi.localIP()); Serial.printf("UDP server on port %d\n", udpPort); output = sensor + "startet auf UDP-Port: " + String(udpPort); Udp.begin(udpPort); Udp.beginPacket(udpAddress, udpPort); Udp.print(output); Udp.endPacket(); iaqSensor.begin(BME680_I2C_ADDR_SECONDARY, Wire); checkIaqSensorStatus(); bsec_virtual_sensor_t sensorList[10] = { BSEC_OUTPUT_RAW_TEMPERATURE, BSEC_OUTPUT_RAW_PRESSURE, BSEC_OUTPUT_RAW_HUMIDITY, BSEC_OUTPUT_RAW_GAS, BSEC_OUTPUT_IAQ, BSEC_OUTPUT_STATIC_IAQ, BSEC_OUTPUT_CO2_EQUIVALENT, BSEC_OUTPUT_BREATH_VOC_EQUIVALENT, BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE, BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY, }; iaqSensor.updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_LP); checkIaqSensorStatus(); } // Function that is looped forever void loop(void) { //unsigned long time_trigger = millis(); if (iaqSensor.run()) { // If new data is available pres += iaqSensor.pressure; iaq_ += iaqSensor.iaq; iaqaccu = iaqSensor.iaqAccuracy; temp += iaqSensor.temperature; hum += iaqSensor.humidity; iaqstat += iaqSensor.staticIaq; co2equiv += iaqSensor.co2Equivalent; VOCequiv += iaqSensor.breathVocEquivalent; count += 1; if (count == 50) { pres = pres / 50; iaq_ = iaq_ / 50; temp = temp / 50; hum = hum / 50; iaqstat = iaqstat / 50; co2equiv = co2equiv / 50; VOCequiv = VOCequiv / 50; count = 0; output = String(sensor); output += "2@ " + String(pres); output += " 5@ " + String(iaq_); output += " 6@ " + String(iaqaccu); output += " 7@ " + String(temp); output += " 8@ " + String(hum); output += " 9@ " + String(iaqstat); output += " 10@ " + String(co2equiv); output += " 11@ " + String(VOCequiv); Udp.beginPacket(udpAddress, udpPort); Udp.print(output); Udp.endPacket(); pres = 0; iaq_ = 0; // iaqaccu = 0; temp = 0; hum = 0; iaqstat = 0; co2equiv = 0; VOCequiv = 0; } Serial.println(count); } else { checkIaqSensorStatus(); } } // Helper function definitions void checkIaqSensorStatus(void) { if (iaqSensor.status != BSEC_OK) { if (iaqSensor.status < BSEC_OK) { output = sensor + "BSEC error code: " + String(iaqSensor.status); } else { output = sensor + "BSEC warning code: " + String(iaqSensor.status); } Serial.println(output); Udp.beginPacket(udpAddress, udpPort); Udp.print(output); Udp.endPacket(); delay(30000); } if (iaqSensor.bme680Status != BME680_OK) { if (iaqSensor.bme680Status < BME680_OK) { output = sensor + "BME680 error code: " + String(iaqSensor.bme680Status); } else { output = sensor + "BME680 warning code: " + String(iaqSensor.bme680Status); } Serial.println(output); Udp.beginPacket(udpAddress, udpPort); Udp.print(output); Udp.endPacket(); delay(30000); } }
So...hier mal mein Skript. Ist nichts Besonderes. Und bevor jetzt jemand fragt, NEIN, wenn nichts mehr vom MS empfangen wird, handelt es sich nicht um eine Fehler- oder Warnmeldung, denn auch diese müsste ja dann ankommen.
Auch ein stromlos machen oder ein neues flashen des ESP bringt nichts. Nur das Ändern des Ports bringt was. Und ja, ich habe auch schon alle Gertäte inkl. MS & Router mal stromlos gemacht.
Ich bin ratlos.
Kommentar