ESP8266 verbinden sich nicht/ senden von UDP

Die 169.* ist doch falsch.
Der Client hat keine zugewiesene IP-Adresse sondern macht ein link-local.

Wenn der AP 192.168.4.1 hat, gib mal der Client im setup:

  IPAddress ip(192, 168, 4, 5);
  IPAddress dns(192, 168, 4, 1);
  IPAddress gateway(192, 168, 4, 1);
  IPAddress subnet(255, 255, 255, 0);
  WiFi.config(ip, dns, gateway, subnet);

Vollständig:

void setup() {
  Serial.begin(115200);

  // We start by connecting to a WiFi network
  IPAddress ip(192, 168, 4, 5);
  IPAddress dns(192, 168, 4, 1);
  IPAddress gateway(192, 168, 4, 1);
  IPAddress subnet(255, 255, 255, 0);
  WiFi.config(ip, dns, gateway, subnet);
  
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  /* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
     would try to act as both a client and an access-point and could cause
     network-issues with your other WiFi-devices on your WiFi-network. */
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}

Variable host "192.168.4.1"
Als Port nicht 17.
Der Server läuft auf 80.

const char* host = "192.168.4.1";
const uint16_t port = 80;

Dann sollte nach dem Connect irgendwas kommen.