Ich brauche, wer hätte es gedacht, tatsächlich mal eure Hilfe.
Also hier der Inhalt vom Sketch (STASSID und STAPSK habe ich hier mit xxxx überschrieben. Da stehen natürlich sonst die korrekten Daten drinnen und bei Server_IP steht jetzt meinedomain.de und nicht die richtige Domain):
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include "DHT.h"
#define DHT11Pin 14
#define DHTType DHT11
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <WiFiUdp.h>
#include <NTPClient.h> // für die Uhrzeit
//Zeitverschiebung UTC <-> MEZ (Winterzeit) = 3600 Sekunden (1 Stunde)
//Zeitverschiebung UTC <-> MEZ (Sommerzeit) = 7200 Sekunden (2 Stunden)
const long utcOffsetInSeconds = 3600;
char daysOfTheWeek[7][12] = {"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"};
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "pool.ntp.org", utcOffsetInSeconds);
#ifndef STASSID
#define STASSID "xxxx"
#define STAPSK "xxxx"
#endif
//#define SERVER_IP "10.0.1.7:9080" // PC address with emulation on host
#define SERVER_IP "meinedomain.de"
#define SERVER_RESOURCE "iot/entry.php" // define the script you want to call
#define USE_BOARD 0 // an ID for your board
const byte pin1 = 0;
const byte pin2 = 2;
const byte pin3 = 14;
const byte adc = A0;
String Uhrzeit(5);
float humi;
float tempC;
float tempF;
DHT HT(DHT11Pin,DHTType);
//OLED define
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void Uhrzeit_anzeigen () {
// Uhrzeit
// display.display();
display.clearDisplay();
timeClient.update();
oledDisplayHeader(0,0,daysOfTheWeek[timeClient.getDay()]);
display.setTextSize(4);
Uhrzeit = timeClient.getFormattedTime();
display.setCursor(1, 30);
display.println(Uhrzeit.substring(0,5));
delay(500);
}
void oledDisplayHeader(int x,int y,String unit){
display.setTextSize(2);
display.setCursor(x, y);
display.print(unit);}
void oledDisplay(int size, int x,int y, float value, String unit){
display.setTextSize(size);
display.setTextColor(WHITE);
display.setCursor(x, y);
display.print(value,1);
display.setCursor(x+100, y);
display.print(unit);}
void Temperatur_anzeigen () {
humi = HT.readHumidity();
tempC = HT.readTemperature() ;
// Temperatur
display.display();
display.clearDisplay();
oledDisplayHeader(0,0,"Temperatur");
oledDisplay(4,1,30,tempC,"C");
delay(10000);
// Luftfeuchtigkeit
display.display();
display.clearDisplay();
oledDisplayHeader(0,0,"Feuchte");
oledDisplay(4,1,30,humi,"%");
delay(10000);
Serial.print("Temperatur:");
Serial.println(tempC);
Serial.print(" Feuchte :");
Serial.println(humi);
Serial.println();
}
void doWebclient() {
if ((WiFi.status() == WL_CONNECTED)) {
String message;
WiFiClient client;
HTTPClient http;
Serial.print(F("[HTTP] begin\n"));
// configure traged server and url
Serial.println ("https://" SERVER_IP "/" SERVER_RESOURCE);
http.begin(client, "https://" SERVER_IP "/" SERVER_RESOURCE); // MISSING ... in configuration?
http.addHeader("Content-Type", "application/x-www-form-urlencoded"); // // standard content type for simple form-posts, for more see https://en.wikipedia.org/wiki/Media_type
// build your post data
message = "board=";
message += USE_BOARD;
message += "&uptime=";
message += millis()/1000;
message += "&adc=";
message += analogRead(adc);
message += "&pin1=";
message += digitalRead(pin1);
message += "&pin2=";
message += digitalRead(pin2);
// start connection and send HTTP header and body
int httpCode = http.POST(message);
// httpCode will be negative on error
if (httpCode > 0) {
// HTTP header has been send and Server response header has been handled
Serial.printf("[HTTPs] POST code: %d\n", httpCode);
if (httpCode == HTTP_CODE_OK) { // file found at server
const String& payload = http.getString();
Serial.println(F("received payload:\n<<"));
Serial.println(payload);
Serial.println(F(">>"));
}
} else {
Serial.printf("[HTTP] POST failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
}
else
{
Serial.println("[HTTP] not connected");
}
}
void timerWebclient()
{
const uint16_t interval = 60 * 1000UL; // set the interval for your webclient to post data
static uint32_t previousMillis = - interval;
uint32_t currentMillis = millis();
if (currentMillis - previousMillis > interval)
{
doWebclient();
previousMillis = currentMillis;
}
}
void setup() {
Serial.begin(9600);
//For OLED I2C
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for(;;); }
Serial.print (F("\n\nESP8266 POST HTTP webclient\nBoard "));
Serial.println(USE_BOARD);
pinMode(adc, INPUT);
pinMode(pin1, INPUT);
pinMode(pin2, INPUT);
WiFi.begin(STASSID, STAPSK);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.print(F("\nConnected! IP address: "));
Serial.println(WiFi.localIP());
timeClient.begin(); // Uhrmodul starten
}
void loop() {
timerWebclient(); // call the timer for the webclient
Temperatur_anzeigen ();
delay(10000);
// do other things in your loop
}
Und über den seriellen Monitor erscheint dann diese Meldung:

Bitte stört auch nicht an der Ausgabe von der Temperatur und der Luftfeuchtigkeit. Die Werte werden im Moment noch falsch angezeigt.
Im nächsten Schritt habe ich dann die https://meinedomain.de/iot/entry.php über den Browser aufgerufen. Da erscheint der Hinweis
NOK; valid=0; data not valid
Wo liegt der Fehler und es gibt im Sketch zweimal einen Eintrag bei Server_IP. Aktuell steht da auch noch die IP 10.0.1.7:9080. Was ist das für eine IP? Muss die auskommentiert werden?
Bereits jetzt Danke für eure Hilfen und Antworten.