[Android Q&A, Help & Troubleshooting] eledra:
Tried to follow this tutorial for a week. The idea is to create a program which connect to an internal network while keeping connection to the internet so that I can send command from server to that internal network.

However i still have problem :(

My device:

Samsung Galaxy S3 LTE - I9305

I have tried both vanilla 4.3 and stable version of Cyanogen Mod.

My commands:

pkill dhcpcd
svc wifi disable
svc data enable
netcfg wlan0 up
cd /data/misc/wifi/
insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt"
wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -d
dhcpcd wlan0

However, it stucked:

dhcpcd[5397]: version 5.5.6 starting
dhcpcd[5397]: wlan0: waiting for carrier

It seems there is something wrong with wpa_supplicant. Here is the log:

/wpa_supplicant( 5235): wpa_supplicant v2.0-devel-4.2.2
D/wpa_supplicant( 5235): random: Trying to read entropy from /dev/random
I/wpa_supplicant( 5235): Successfully initialized wpa_supplicant
D/wpa_supplicant( 5235): Initializing interface 'wlan0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'nl80211' ctrl_interface 'N/A' bridge
D/wpa_supplicant( 5235): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 5235): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 5235): ctrl_interface='wlan0'
D/wpa_supplicant( 5235): update_config=1
D/wpa_supplicant( 5235): device_name='m3xx'
D/wpa_supplicant( 5235): manufacturer='samsung'
D/wpa_supplicant( 5235): model_name='GT-I9305'
D/wpa_supplicant( 5235): model_number='GT-I9305'
D/wpa_supplicant( 5235): serial_number='42f7426e1456afbb'
D/wpa_supplicant( 5235): config_methods='physical_display virtual_push_button keypad'
D/wpa_supplicant( 5235): p2p_listen_reg_class=81
D/wpa_supplicant( 5235): p2p_listen_channel=1
D/wpa_supplicant( 5235): p2p_oper_reg_class=115
D/wpa_supplicant( 5235): p2p_oper_channel=48
D/wpa_supplicant( 5235): Priority group 1
D/wpa_supplicant( 5235): id=0 ssid='Long'
D/wpa_supplicant( 5235): nl80211: interface wlan0 in phy phy0
I/wpa_supplicant( 5235): rfkill: Cannot open RFKILL control device
D/wpa_supplicant( 5235): nl80211: RFKILL status not available
D/wpa_supplicant( 5235): nl80211: Set mode ifindex 8 iftype 2 (STATION)
D/wpa_supplicant( 5235): nl80211: Subscribe to mgmt frames with non-AP handle 0x41dee21
...................
##### a bunch of Registerframe ####
..................
D/wpa_supplicant( 5235): nl80211: Register frame type=0xd0 nl_handle=0x41dee210
D/wpa_supplicant( 5235): nl80211: Register frame match - hexdump(len=2): 0a 07
D/wpa_supplicant( 5235): netlink: Operstate: linkmode=1, operstate=5
D/wpa_supplicant( 5235): nl80211: Using driver-based off-channel TX
D/wpa_supplicant( 5235): nl80211: TDLS supported
D/wpa_supplicant( 5235): nl80211: Supports Probe Response offload in AP mode
D/wpa_supplicant( 5235): nl80211: Driver is new enough to support monitor-less mode
D/wpa_supplicant( 5235): nl80211: driver param='(null)'
D/wpa_supplicant( 5235): nl80211: Regulatory information - country=00
D/wpa_supplicant( 5235): nl80211: 2402-2472 @ 40 MHz
D/wpa_supplicant( 5235): nl80211: 2457-2482 @ 40 MHz
D/wpa_supplicant( 5235): nl80211: 2474-2494 @ 20 MHz
D/wpa_supplicant( 5235): nl80211: 5170-5250 @ 40 MHz
D/wpa_supplicant( 5235): nl80211: 5735-5835 @ 40 MHz
D/wpa_supplicant( 5235): nl80211: Added 802.11b mode based on 802.11g information
D/wpa_supplicant( 5235): wlan0: Own MAC address: 90:18:7c:4a:61:56
D/wpa_supplicant( 5235): wpa_driver_nl80211_set_key: ifindex=8 alg=0 addr=0x0 key_idx=0 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 5235): wpa_driver_nl80211_set_key: ifindex=8 alg=0 addr=0x0 key_idx=1 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 5235): wpa_driver_nl80211_set_key: ifindex=8 alg=0 addr=0x0 key_idx=2 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 5235): wpa_driver_nl80211_set_key: ifindex=8 alg=0 addr=0x0 key_idx=3 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 5235): wlan0: RSN: flushing PMKID list in the driver
D/wpa_supplicant( 5235): nl80211: Flush PMKIDs
D/wpa_supplicant( 5235): wlan0: Setting scan request: 0 sec 100000 usec
D/wpa_supplicant( 5235): WPS: Set UUID for interface wlan0
D/wpa_supplicant( 5235): WPS: UUID based on MAC address - hexdump(len=16): b7 c8 22 f4 13 ac 55 83 99 f0 1a f0 a2 2d 95 8a
D/wpa_supplicant( 5235): EAPOL: SUPP_PAE entering state DISCONNECTED
D/wpa_supplicant( 5235): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 5235): EAPOL: KEY_RX entering state NO_KEY_RECEIVE
D/wpa_supplicant( 5235): EAPOL: SUPP_BE entering state INITIALIZE
D/wpa_supplicant( 5235): EAP: EAP entering state DISABLED
D/wpa_supplicant( 5235): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 5235): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant( 5235): Using existing control interface directory.
D/wpa_supplicant( 5235): wlan0: Added interface wlan0
D/wpa_supplicant( 5235): wlan0: State: DISCONNECTED -> DISCONNECTED