Closed Stephan35 closed 5 years ago
you want to start new client and send something inside the UDP callback? Or will that client be started elsewhere and just send some data in the UDP callback? The second option is possible, the first is not.
What is UDP callback ? is it .onPacket ?
yes
Because i tried to send tcp within onPacket event , and failed . Impossible to send this kind of data :
WiFiClient dweet_client;
const int httpPort = 80;
if (!dweet_client.connect(dweet_host, httpPort)) {
Serial.println("connection failed");
return false;
}else{
Serial.print("connection établie");
// This will send the request to the server
dweet_client.print(String("GET /dweet/for/"+DweetID+"?Luminosite=") + DweetAnalRead + "&Cpt_WL_CONNECTED=" + DweetAlive + " HTTP/1.1\r\n" +
"Host: " + dweet_host + "\r\n" +
"Connection: close\r\n\r\n");
Serial.println("|closing connection");
dweet_client.flush();
}
dweet_client.stop();
return true;
}
Should i store what i wish to do and launch in loop ?
Yes, since it requires you to connect, you can not do it in the callback.
Ok, very helpfull again ;-) Best regards.
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
Hello, I would like to know if it is possible to send TCP request while Udp event ? Best regards