Thank's nitram.
Your solution may work, but I was not able to open the SSID for evaluation. But finally I've found this solution.
The way is to use the manual config, wifi.sh can't be used at all. The issue was that wpa need to scan ssid's and test them.
I'm using the channel 11 and it takes roughly 12 seconds.
This is my tutorial:
First need to be created the config file, for example /tmp/wifi.cfg.
network={
scan_ssid=1
ssid="yourwifiname"
psk="yourwifipassword"
}
The most important is the scan_ssid=1 parameter which executes the network scan and enables the connection to the hidden networks. This function is not supported by wifi.sh script. The psk may be used in encrypted format generated via wpa_passphrase.
Than need to be created some script for wpa execution and ip querry. This script may be added to bootlocal.sh for automated execution at boot.
ifconfig wlan0 up
wpa_supplicant -iwlan0 -c/tmp/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10
The first line may not be necessary at all cases, but some my dongles need it.
The -t 10 parameter is important to safely obtain the ip, because the wpa need pretty long time to scan all the channels as mentioned above. This gives 10 queries with 3 seconds delay, totally 30 second.
This works well and i'ts simple.