Using both ethernet and wifi interfaces
Posted: Tue Nov 23, 2021 10:59 am
Hi
We use esp-idf 3.3.5 in commercial project, so I will ask if my problem could be solved in this version of esp-idf, but I know we might have to switch to esp-idf 4 anyway...
I need to use both internet interfaces in my work:
-ethernet for peer to peer connection with some device - we already did this and it works: both devices are connected with ethernet cable and have static IP addresses and communicate using AMQP protocol
-wifi connection to access cloud database using AMQP protocol - it already works
The problem is when I try to integrate both branches and both functionalities, AMQP connects to given host using sockets interface and I have no idea how to switch between interfaces, doing nothing ends in expected: local IP address of my device is not accessible on wifi interface and vice versa database is not accessible on ethernet LAN connection.
I found `netif_set_default` function which switches between interfaces and set default interface to wifi if both wifi and ethernet are up. Is there any simple way to use both interfaces in esp-idf 3.5.1?
We use esp-idf 3.3.5 in commercial project, so I will ask if my problem could be solved in this version of esp-idf, but I know we might have to switch to esp-idf 4 anyway...
I need to use both internet interfaces in my work:
-ethernet for peer to peer connection with some device - we already did this and it works: both devices are connected with ethernet cable and have static IP addresses and communicate using AMQP protocol
-wifi connection to access cloud database using AMQP protocol - it already works
The problem is when I try to integrate both branches and both functionalities, AMQP connects to given host using sockets interface and I have no idea how to switch between interfaces, doing nothing ends in expected: local IP address of my device is not accessible on wifi interface and vice versa database is not accessible on ethernet LAN connection.
I found `netif_set_default` function which switches between interfaces and set default interface to wifi if both wifi and ethernet are up. Is there any simple way to use both interfaces in esp-idf 3.5.1?