Chat freely about anything...

User avatar
By matkar
#29456 Unfortunately Android phones prefer wifi to get to the internet in case of contemporary activity of mobile data and wifi connection. Android doesn't get the data from the internet unless Wifi connection is disabled.
Is there a way to tell Android to use mobile in case it is connected to ESP module?

I have tried the wifi_softap_set_dhcps_offer_option function by setting:
wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &mode); mode to zero.
I have verified the packets in Wireshark and the DHCP offer packet doesn't send Option 3 - Router IP address.
Unfortunately this doesn't convince Android and it still tries to connect to the internet via ESP module.
I'd like to keep option 6 - Domain Name Server since I'd like to be able to get to the web page on the ESP module.

Is there anything else I can try?

I have been informed it might help change Android's mind by responding to it's DNS requests by sending ICMP type 3 code 13 (destination unreachable, communication administratively prohibited). Currently a type 3 code 3 (destination unreachable, port unreachable) is sent.
Unfortunately I don't know the way to do so. At least I can't find anything in APIs.

Any suggestions?

There are some Android apps that claim to solve this problem in one way or another but i'd like to fix this on the ESP side if possible.

Regards,
Mat