I have an app that creates a simple server to provide a file to connected IoT devices. The flow is quite simple:
- app connects to the WiFi network the IoT device creates (local-only, no internet access) - when it connects to the IoT WiFi network it disconnects from the previous WiFi network
- app binds its process to the IoT device network
- app starts a simple HTTP server to provide a file to devices on the IoT device network
- app informs the IP and Port the server is running to the other devices
- other devices access the server and download the file
Before Android 12, this flow worked 100% of the time.
But with the introduction of WiFi STA/STA concurrency the app remains connected to the previous network (with an internet connection) and for some reason, the other devices on the IoT network never reach the HTTP server running on the Android app.
I'm still binding the process to the correct network, but the server only seems reachable once the primary WiFi network (the one with internet connection) is manually disconnected.
Is there something I'm missing to get the Android HTTP server running on the secodary WiFi network?
PS.: I'm using NanoHTTPD to create the HTTP server, which creates a ServerSocket to serve the requests. I'm also using a Pixel 6 that supports the concurrent WiFi STA/STA feature.