Re: UDP Transmission is not fast enough ?
Posted: Thu Feb 16, 2017 7:13 pm
Hi, I would try using a loop to generate values instead if the I2C and see if the UDP is realy holding things up.
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
void Request_Data_from_Slave()
{
int i = 0;
int index2 = 0;
Wire.requestFrom(I2Cadress, 32); // request 32 bytes from slave device adress (I2C LiOr)
while (Wire.available()){
char inChar = Wire.read();
if(inChar == '<'){
started = true;
index2 = 0;
inData[index2] = inChar;
index2++;
inData[index2] = '\0';
}
else if(inChar == '>'){
ended = true;
inData[index2] = inChar;
index2++;
inData[index2] = '\0';
}
else if(started ){
inData[index2] = inChar;
index2++;
inData[index2] = '\0';
}
if(started && ended) {
started = false;
ended = false;
//Serial.println("inData:");
Serial.println(inData);
}
} //ifend
}
void Send_inData_to_WiFi()
{
Udp.beginPacket(ipMulti, 2390);
Udp.print(UDP_String); // Sends the char Array over WiFi which we got from I2C
Udp.endPacket();
delay(2);
}