Use of Ethernet and WiFi AP & STA simulateneously #11091
Replies: 11 comments
-
In 2.0.17 you can not. For 3.x you can decide which is the default outgoing interface by doing Network.setDefaultInterface(ETH); //outgoing connections go through ETH by default
Network.setDefaultInterface(WiFi.STA); //outgoing connections go through STA by default |
Beta Was this translation helpful? Give feedback.
-
If you switch to ETH as default, make sure that that is done AFTER STA is connected |
Beta Was this translation helpful? Give feedback.
-
Thank you @me-no-dev. If ETH is connected and sending data to HTTP(s) and WiFi is put in AP mode it also stops connecting to internet on ETH. Will it work in this situation the Edit: I have tested this situation, and when the AP is started, or when an user is connected (after IP assignaned) to AP, I have try to call |
Beta Was this translation helpful? Give feedback.
-
AP should not interfere, unless they are both set in the same subnet. |
Beta Was this translation helpful? Give feedback.
-
The AP give to my PC the IP 192.168.4.1, and ethernet obtains the IP 192.168.0.58 from the LAN, so they are not in the same subnet. But when the AP is started and/or when I connect with my PC to the AP and an IP is assigned, the HTTPS connections with WiFiClientSecure stop working. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
@enriquedbelec please provide a test sketch to reproduce the issue |
Beta Was this translation helpful? Give feedback.
-
Hi, Here is a test sketch to reproduce the issue. The sketch starts ETH and waits for link up and get IP. After that it starts performing GET requests to URL. 30 seconds after start sketch, ir starts AP. Here you can note, that the GET request is performed with 200 OK status code, until the AP is started. After the AP is started and also if you connect to AP, the requests can't be performed (log verbose shows a timeout).
|
Beta Was this translation helpful? Give feedback.
-
Hi @me-no-dev do you have any news about this? I've done tests on my ESP32 and using ethernet (LAN8710) and WiFi AP simulateneously makes that if I ping from a LAN PC to ethernet IP does not always answer the ping. It loses 50-70% of packets. Also, I've tried to get the default interface with Network.getDefaultInterface() method, and it always is at ETH_DEF. Also tried to do Network.setDefaultInterface(ETH) after AP is started and after AP gives IP to a client to force the iface priority to ethernet, but the issue is the same. Also tried to Network.setDefaultInterface(ETH) in a loop to ensure the priority is always overwritten. I suspect that this is not a priority issue, because the is the AP what is interfering with Ethernet addressing. I'm using Arduino Core 3.1.3 for the tests. If you need I can do more tests. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
|
Beta Was this translation helpful? Give feedback.
-
I've discovered the cause of this issue. And it's because the CLOCK_SOURCE of the LAN8720 is the GPIO_17. And Espressif has reported it in forums and on known issues: Errata report from Espressif: https://docs.espressif.com/projects/esp-chip-errata/en/latest/esp32/03-errata-description/index.html#clock-esp32-cannot-be-used-as-the-phy-clock-source-if-wi-fi-and-ethernet-are-used-at-the-same-time Hope it helps anyone with the same issue. Thank you so much for your help @LynxEmbedded and @me-no-dev |
Beta Was this translation helpful? Give feedback.
-
Just found ( maybe helping) same problem with Pin 17: |
Beta Was this translation helpful? Give feedback.
-
Board
Custom board
Device Description
Custom board with ESP32 Wroom 16 MB of flash with LAN8710A
Hardware Configuration
ETH_CLK_MODE -> ETH_CLOCK_GPIO17_OUT
ETH_POWER_PIN -> 5
ETH_TYPE -> ETH_PHY_LAN8720
ETH_ADDR -> 0
ETH_MDC_PIN -> 23
ETH_MDIO_PIN -> 18
ETH_CLOCK_PIN -> 17
Version
v2.0.17
IDE Name
VSCode
Operating System
Windows 10
Flash frequency
40 Mhz
PSRAM enabled
no
Upload speed
921600
Description
Hi,
I've checked on Arduino 2.0.17 and 3.1.1 that if you begin Ethernet only it can perform an HTTP connection ok. But if you enable the AP, then the ETH connection drops (can't establish connection).
Is there any way to keep working the ethernet connections while the AP is up? Ídem question with ETH + AP/STA ?
Thanks.
Sketch
// Init Ethernet driver ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
Beta Was this translation helpful? Give feedback.
All reactions