me-no-dev / ESPAsyncUDP

Async UDP library for ESP8266
173 stars 56 forks source link

listenMulticast - slow packet handling? #23

Closed QuadCorei8085 closed 5 years ago

QuadCorei8085 commented 6 years ago

Having an ESP8266 running in AP mode and sending multicast packets each 100ms I receive the packets on the client (connected in STA mode to the AP) with the following timestamps:

Time 22369, Data: hello 7 Time 22644, Data: hello 8 Time 22645, Data: hello 9 Time 22669, Data: hello 0 Time 22951, Data: hello 1 Time 22952, Data: hello 2 Time 22971, Data: hello 3 Time 23258, Data: hello 4 Time 23259, Data: hello 5 Time 23269, Data: hello 6 Time 23565, Data: hello 7 Time 23566, Data: hello 8 Time 23569, Data: hello 9 Time 23872, Data: hello 0 Time 23873, Data: hello 1 Time 23875, Data: hello 2 Time 23970, Data: hello 3 Time 24184, Data: hello 4 Time 24185, Data: hello 5 Time 24269, Data: hello 6 Time 24487, Data: hello 7 Time 24488, Data: hello 8 Time 24569, Data: hello 9 Time 24793, Data: hello 0 Time 24795, Data: hello 1

AP side code: ` udp.listenMulticast(IPAddress(239,1,2,3), 1234); tick.attach_ms(100, &udp_send);

void udp_send(void) { udp.print(String("hello ") + String(cnt++)); cnt %= 10; } `

STA side code: `
udp.listenMulticast(IPAddress(239,1,2,3), 1234); udp.onPacket(&onUdpPacket);

void onUdpPacket(AsyncUDPPacket& packet) { Serial.println(String("Time ")+String(millis())+ String(packet.data())); } `

When using unicast the timstamps are spot on. Any idea what causes the timing issue (that packets are incoming in bursts of 2-3-4 and 3-400ms delay between them)?

ascillato commented 6 years ago

Hi,

On the readme of a repo that uses this library (https://github.com/envy/esp-knx-ip/tree/async-udp) say:

In my case, this was fixed by disabling IGMP snooping on the wifi Router/Switch

Have you tried that?

stale[bot] commented 5 years ago

[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[bot] commented 5 years ago

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.