using netif_set_default
Posted: Mon Feb 21, 2022 9:10 pm
I have a SLIP connection on a uart to another device, on 10.0.0.1. I have a wifi STA connection to a router; the router assigns 192.168.88.252 to the esp32. When the esp32 code tries to send a UDP packet to 192.168.90.100, it gets sent down the SLIP interface.
I think what I really need is the ability to set the default interface to be the Wifi STA , so that the UDP packet gets sent out to the wifi router.
This is also affecting the NAT port forwarding I am trying to do from the other device--slip-->esp32--STA-->wifi router-->server.
I have tried calling "netif_set_default()" in my code, but the compiler complains about the argument I pass. How can I get the correct argument for "netif_set_default()" from the esp_netif_t WiFiSTA?
I think what I really need is the ability to set the default interface to be the Wifi STA , so that the UDP packet gets sent out to the wifi router.
This is also affecting the NAT port forwarding I am trying to do from the other device--slip-->esp32--STA-->wifi router-->server.
I have tried calling "netif_set_default()" in my code, but the compiler complains about the argument I pass. How can I get the correct argument for "netif_set_default()" from the esp_netif_t WiFiSTA?