hello i need to make the Arduino Yun to search for a specific wireless network
and connect to it (if it's already connected to a network it needs to disconnect and connect to the right one).
i tried writing these commands to the linux: ifconfig wlan0 down (to close the wifi) iwconfig wlan0 essid [SSID] key s:[PASS] (the network has WEP security standard)
then when i type: /usr/bin/pretty-wifi-info.lua
i don't see i'm connected to the new network
another thing: the command dhcpclient doesn't seem to work on the OpenWrt-Yun
Go the webpanel, click "configure", then click the link on top "advanced configuration panel". There you'll find "luci", the web interface for low level configuration. Try using luci instead than the command line
then i wrote: /etc/init.d/network restart
and got this message:
Command failed: Not found
Configuration file: /var/run/hostapd-phy0.conf
HT (IEEE 802.11n) with WEP is not allowed, disabling HT capabilities
Using interface wlan0 with hwaddr 90:a2:da:f6:08:84 and ssid "REX001"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
Command failed: Not found
when i check via iwconfig, i don't see i'm connected to the REX001 network
thank you but it doesn't seem yet to work.
i see that the iwconfig detatils change, but i dont have ping or see my ip
how do i get the ip from the dhcp server?
i wrote these commands:
uci set wireless.@wifi-iface[0].ssid=REX002
uci set wireless.@wifi-iface[0].encryption=wep
uci set wireless.@wifi-iface[0].key=aaaa
uci commit wireless
wifi
and i see when i type the command: /usr/bin/pretty-wifi-info.lua
this:
root@Arduino:/# /usr/bin/pretty-wifi-info.lua
Current WiFi configuration
SSID: REX002
Mode: Master
Signal: 0%
Encryption method: WEP Open System (WEP-40)
/usr/bin/lua: /usr/bin/pretty-wifi-info.lua:67: attempt to get length of field 'ipaddrs' (a nil value)
stack traceback:
/usr/bin/pretty-wifi-info.lua:67: in main chunk
: ?[/quote]
i think it is because the arduino doesn't get the ip from the router.
what is the command for getting an ip address in dhcp?
/sbin/uci: Parse error (invalid command) at line 16, byte 0
/sbin/uci: Parse error (invalid command) at line 16, byte 0
/sbin/uci: Parse error (invalid command) at line 16, byte 0
/sbin/uci: Parse error (invalid command) at line 16, byte 0
[ 1057.970000] wlan0: deauthenticating from 00:1f:1f:f8:87:ac by local choice (reason=3)
command failed: Device or resource busy (-16)
Command failed: Not found
Successfully initialized wpa_supplicant
Command failed: Not found
[ 1059.290000] wlan0: authenticate with 00:1f:1f:f8:87:ac
[ 1059.300000] wlan0: send auth to 00:1f:1f:f8:87:ac (try 1/3)
[ 1059.300000] wlan0: authenticated
[ 1059.300000] ath9k ar933x_wmac: wlan0: disabling HT/VHT due to WEP/TKIP use
[ 1059.320000] wlan0: associate with 00:1f:1f:f8:87:ac (try 1/3)
[ 1059.320000] wlan0: RX AssocResp from 00:1f:1f:f8:87:ac (capab=0xc11 status=0 aid=1)
[ 1059.320000] wlan0: associated
[ 1065.010000] wlan0: deauthenticating from 00:1f:1f:f8:87:ac by local choice (reason=3)
command failed: Device or resource busy (-16)
Command failed: Not found
Successfully initialized wpa_supplicant
Command failed: Not found
root@Arduino:/# [ 1066.580000] wlan0: authenticate with 00:1f:1f:f8:87:ac
[ 1066.590000] wlan0: send auth to 00:1f:1f:f8:87:ac (try 1/3)
[ 1066.590000] wlan0: authenticated
[ 1066.590000] ath9k ar933x_wmac: wlan0: disabling HT/VHT due to WEP/TKIP use
[ 1066.610000] wlan0: associate with 00:1f:1f:f8:87:ac (try 1/3)
[ 1066.610000] wlan0: RX AssocResp from 00:1f:1f:f8:87:ac (capab=0xc11 status=0 aid=1)
[ 1066.620000] wlan0: associated
and when i type the command: /usr/bin/pretty-wifi-info.lua
i get this:
Current WiFi configuration
SSID: REX002
Mode: Client
Signal: 100%
Encryption method: WEP Open System (WEP-40)
/usr/bin/lua: /usr/bin/pretty-wifi-info.lua:67: attempt to get length of field 'ipaddrs' (a nil value)
stack traceback:
/usr/bin/pretty-wifi-info.lua:67: in main chunk
[C]: ?
#!/bin/sh
/sbin/uci set network.lan=interface
/sbin/uci set network.lan.proto=dhcp
/sbin/uci delete network.lan.ipaddr
/sbin/uci delete network.lan.netmask
/sbin/uci set wireless.@wifi-iface[0].mode=sta
/sbin/uci set wireless.@wifi-iface[0].ssid=wifi_ssid
/sbin/uci set wireless.@wifi-iface[0].encryption=wep
/sbin/uci set wireless.@wifi-iface[0].key1="786468646b6b6577696f646464"
/sbin/uci set wireless.@wifi-iface[0].key=1
/sbin/uci commit wireless; /sbin/wifi
/etc/init.d/network restart