ESP8266 soft access point recurrent service?
Posted: Sat Apr 13, 2019 12:01 pm
I am trying to send udp packets from a Wemos D1 Mini (ESP8266, platformio with arduino framework) to a Windows machine, where I have to update a 3D object. The Wemos is opening a soft access point which I connect to with my PC.
I am achieving ~ one packet every 10ms (given that I have to read the data from a sensor), however there is a noticeably delay (of ~ 200ms) every 100ms (wireshark screenshot).
I've tested it with using serial packets instead of udp where I have absolutely no problems whatsoever (one packet every 10ms, captured with hterm).
My only guess is that there is some recurrent service in relation with the soft access point, but I have no clue how to fix it. Any help?
My code using <WiFiUdp.h> and <ESP8266WiFi.h>:
Open soft access point (in setup):
Send data (called by loop, where udp_ is of type WiFiUDP and length is 3):
Cheers, chrizbee
I am achieving ~ one packet every 10ms (given that I have to read the data from a sensor), however there is a noticeably delay (of ~ 200ms) every 100ms (wireshark screenshot).
I've tested it with using serial packets instead of udp where I have absolutely no problems whatsoever (one packet every 10ms, captured with hterm).
My only guess is that there is some recurrent service in relation with the soft access point, but I have no clue how to fix it. Any help?
My code using <WiFiUdp.h> and <ESP8266WiFi.h>:
Open soft access point (in setup):
Code: Select all
WiFi.softAP("martin_router_king", "i_have_a_stream");
Send data (called by loop, where udp_ is of type WiFiUDP and length is 3):
Code: Select all
bool Sender::sendData(float *data, uint16_t length)
{
// Send data using udp
udp_.beginPacket(receiver_, port_);
for (uint16_t i = 0; i < length; ++i) {
udp_.print(':');
udp_.print(data[i]);
}
return udp_.endPacket();
}
Cheers, chrizbee