I'm building a remote for my WiFi-RGB Lights. I I have an ESP8266, thatwhich should send ONE Tcpone TCP packet with 4 chars. My
My code:
#include <ESP8266WiFi.h>
const char* ssid = "Wifi";
const char* password = "wifikey";
void WiFiEvent(WiFiEvent_t event) {
Serial.printf("[WiFi-event] event: %d\n", event);
}
void setup() {
Serial.begin(115200);
WiFi.disconnect(true);
delay(1000);
WiFi.onEvent(WiFiEvent);
WiFi.begin(ssid, password);
}
void loop() {
delay(1000);
const uint16_t port = 5577;
const char * host = "192.168.178.150";
WiFiClient client;
client.connect(host, port);
client.print(char(0x71));
client.print(char(0x24));
client.print(char(0x0f));
client.print(char(0xa4));
client.flush();
client.stop();
delay(5000);
}
The Problemproblem: I send 4 TCP-Pacets packets, butwhile I should send 1 TCP Pacetpacket with all the 4 chars. Thanks
Thanks for your Help :)help.