Search found 2 matches

by KonssnoK
Fri Sep 17, 2021 7:50 am
Forum: General Discussion and Questions
Topic: Bind socket to different interface
Replies: 1
Views: 1302

Re: Bind socket to different interface

i think the answer is

Code: Select all

s = socket.socket()
s.bind(self.eth.ifconfig()[0])
but haven't tried yet
by KonssnoK
Thu Sep 16, 2021 2:02 pm
Forum: General Discussion and Questions
Topic: Bind socket to different interface
Replies: 1
Views: 1302

Bind socket to different interface

Hello, I am using an ESP32 with both ETH (lan8720) and WIFI. How can i choose which interface to use when creating a socket? basically i have both: self.sta_if = network.WLAN(network.STA_IF) self.eth = network.LAN(id = 0, mdc = machine.Pin(23), mdio = machine.Pin(18), power = None, phy_addr = 1, phy...