"Country code not acquired yet"
I guessed some sort of country code has to be sent my the wifi access point for the device to work. So, I looked into hostapd configuration manual and found that in the 'IEEE 802.11 related configuration' section, we can set country codes. So, I changed the following variables:
country_code=<your country code>
When I restarted the wifi hotspot, the device could connect to internet successfully.