Page 1 of 1

dedicated connection. reducing unnecessary traffic to the esp32

Posted: Mon May 25, 2020 3:53 pm
by kbaud1
Laptop using wi-fi for internet access looses connection to internet when a second dongle is used to to connect to an ESP32 at the same time. Also: Reducing unnecessary traffic to the ESP32 to reduce energy consumption and improve cpu availability.

We noticed that when a Windows computer connects to the ESP32 in soft AP mode, Windows adds several rows to its routing table that could cause problems. One of these is for destination 0.0.0.0 (a "default gateway") that can break a prexisting internet connection to that computer via another wifi network, if the metric of that network is lower than the ESP32 network. We figured out how to prevent this route from being added at all by clearing the gateway IP address (setting tcpip_adapter_ip_info_t.gw to 0.0.0.0) when initializing the adapter in the ESP32 software.

However, Windows still adds routes to the ESP32 for destinations 224.0.0.0 (multicast) and 255.255.255.255 (broadcast). Windows makes it difficult or impossible to modify or delete these rows. In our testing we found that multicast traffic seems to only go to the ESP32 even when there is a multicast route to another adapter/network with a lower metric. Specifically, we ran ping 224.0.0.1 and ping 224.0.0.251, both of which an iPhone on the first network would respond to until we connect to the ESP32 on a second adapter, at which point only the ESP32 responds to ping 224.0.0.1 and nothing responds to ping 224.0.0.251 (although the iPhone still responds to a unicast ping to its IP address).

Is it possible to configure the ESP32 so that it will not be registered to receive multicast or broadcast traffic at all, and so Windows will not create 224.0.0.0 or 255.255.255.255 rows for it in its routing table? We only want the ESP32 to receive traffic directed to it specifically, and not general traffic that may interfere with it or other software/networks, as our testing seems to indicate can happen with the default configuration.