I have a situation where I am polling data from a device using TCP/IP protocol via Lan/Ethernet medium , this network doesn't have internet available. Now I want to send this data through mqtt via a different network(Say mobile hotspot based Wifi)which has a internet connection for which I am using umqtt library.
So basically, I have to make two socket connection, one for the ethernet and one for mqtt(wireless). I want to know whether there is a way to make mqtt socket connect through wifi network exclusively and the other one through ethernet device. Till now I am not able to find any way to make any socket connect specifically via a network medium(say ethernet and not wifi) in a case when esp32 is connected to both or two different networks.
Any help in this regard would be greatly appreciated.
Thanks .
Using Lan and Wifi at same time in esp32
Re: Using Lan and Wifi at same time in esp32
hi,
Sorry I don't have a board handy with both WiFi and Ethernet to test this, but the usual way to solve this is by binding the socket to the IP address of the interface. i.e. https://docs.micropython.org/en/latest/ ... ocket.bind
Have you tried that? Sorry I can't test it, but if it doesn't work then that's possibly a bug in MicroPython.
Sorry I don't have a board handy with both WiFi and Ethernet to test this, but the usual way to solve this is by binding the socket to the IP address of the interface. i.e. https://docs.micropython.org/en/latest/ ... ocket.bind
Have you tried that? Sorry I can't test it, but if it doesn't work then that's possibly a bug in MicroPython.