-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Multiple network interfaces #8173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not sure. It will depend a lot on the port and how its network subsystem works. Which port do you use? |
I'm using ESP32. |
This looks more like a networking issue than the MicroPython. In general, will use just the interface that reach that IP that you are trying to open the socket. If you try to open a socket to a IP that is not in the same network/sub-network as configured in the locals interfaces (WiFi/Ethernet), it will try to open the socket using the interface that has the default Gateway, to reach that IP. And, in general, internet access 4G has your default gateway. Those network concepts are used is the mostly Operating System, like as Linux, BSD, Windows, and so on. As MicroPython runs over FeeRTOS (that is a Operating System) I thing it works in the same way - using those network concepts too. Ps: As far as I know (@dpgeorge can confirm) the MicroPython version 1.17 has ip_forward disabled by default, and the NAT feature not works yet. So I'm considering that your use case is to opening the socket from the MicroPython ESP32 (with 3 interfaces), not from other device via the MicroPython ESP32, because you need ip_forward and NAT enabled if you want to open a socket to the internet via MicroPython ESP32 from other device connected on WiFi or Ethernet, for example. |
I got an Olimex EVB board with Ethernet and was able to test. |
In a scenario where a platform supports simultaneously:
Or any combination of above options.
Is there a way to tell the socket what interface to use when opening a socket?
Thank in advance
The text was updated successfully, but these errors were encountered: