rcS mods:
wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B
ifconfig wlan0 up
ifconfig wlan0 inet xxx.xxx.xxx.xxx
This is my wpa_supplicant.conf under /etc/wpa_supplicant/ :
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=root
update_config=1
network={
ssid="XXXXX"
scan_ssid=1
psk=xxxxxx
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=TKIP
}
Remark here: I set GROUP to "root" instead of the usual "net devs" because root is defined on our nas. The key after psk and the SSID is of course deleted. psk can be the clear key in letters included in "", or it can be an encrypted key without "" generated by wpa_passphrase, which I used.
I found that /etc/network/interfaces is not regarded by the commands in use, so there is no need to discuss it.
Still a thing to solve:
At the moment wlan0 needs a manual IP assigment through ifconfig inet xxx.xxx.xxx.xxx . Then is has a valid IP. however I need to obtain a lease with udhcpc which gives another IP. The connection works when these two IPs are identical (adjust it with ifconfig). Even when I try to obtain the same IP that was assigned by ifconfig, by means of udhcpc -i wlan0 --request xxx.xxx.xxx.xxx, I do not get the requested IP. Eventually this could be a router issue giving always the same IP to known MACs.
Al least it seems that udhcpc and ifconfig are not compatible. Would it be possible to store the IP obtained by udhcpc in a variable and hand it to ifconfig?