This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3354: unable to connect wifi via wpa supplicant

Part Number: AM3354

Tool/software: Linux

Hello,

I am working on am3354 based custom board and we are using beaglebone black BSP.

I am using ti-processor-sdk-linux-am335x-evm-04.01.00.06 SDK.

on my board i am using wlan3.and i am able to scan the SSID of the wifi and able to connect if SSID dont't have password.

for scanning i am using

iw wlan0 scan | grep SSID

for connect

iw dev wlan0 connect SSID

it is connected.

but i want to integrae the SSID and password in wpa-suplicant for auto connect. but i am not able to connect.

my Interface file is

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# Wireless interfaces
iface wlan0 inet dhcp
        wireless_mode managed
        wireless_essid any
        wpa-driver wext               << here i tried nl80211 also
        wpa-conf /etc/wpa_supplicant.conf

#iface tiwlan0 inet dhcp
        #wireless_mode managed
        #wireless_essid any

iface atml0 inet dhcp

# Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
        pre-up /bin/grep -v -e "ip=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" /proc/cmd
        udhcpc_opts -R -b

iface eth1 inet dhcp

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
auto usb0
iface usb0 inet static
        address 192.168.7.2
        netmask 255.255.255.252

# Bluetooth networking
iface bnep0 inet dhcp

wpa-supplicant file

===============

##### wpa_supplicant configuration file template #####                                                   
#                                                                                                        
# This option can be used to allow wpa_supplicant to overwrite configuration                             
# file whenever configuration is changed (e.g., new network block is added with                          
# wpa_cli or wpa_gui, or a password is changed). This is required for                                    
# wpa_cli/wpa_gui to be able to store the configuration changes permanently.                             
# Please note that overwriting configuration file will remove the comments from                          
# it.                                                                                                    
                                                                                                         
update_config=1                                                                                          
ctrl_interface=/var/run/wpa_supplicant                                                                   
ctrl_interface_group=1                                                                                   
                                                                                                         
# IEEE 802.1X/EAPOL version                                                                              
# wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines                              
# EAPOL version 2. However, there are many APs that do not handle the new                                
# version number correctly (they seem to drop the frames completely). In order                           
# to make wpa_supplicant interoperate with these APs, the version number is set                          
# to 1 by default. This configuration value can be used to set it to the new                             
# version (2).                                                                                           
                                                                                                         
                                                                                                         
eapol_version=1                                                                                          
                                                                                                         
                                                                                                         
# AP scanning/selection                                                                                  
# By default, wpa_supplicant requests driver to perform AP scanning and then                             
# uses the scan results to select a suitable AP. Another alternative is to                               
# allow the driver to take care of AP scanning and selection and use                                     
# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association                           
# information from the driver.                                                                           
# 1: wpa_supplicant initiates scanning and AP selection; if no APs matching to                           
#    the currently enabled networks are found, a new network (IBSS or AP mode                            
#    operation) may be initialized (if configured) (default)                                             
# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association                            
#    parameters (e.g., WPA IE generation); this mode can also be used with                               
#    non-WPA drivers when using IEEE 802.1X mode; do not try to associate with                           
#    APs (i.e., external program needs to control association). This mode must                           
#    also be used when using wired Ethernet drivers.                                                     
# 2: like 0, but associate with APs using security policy and SSID (but not                              
#    BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to                                
#    enable operation with hidden SSIDs and optimized roaming; in this mode,                             
#    the network blocks in the configuration file are tried one by one until                             
#    the driver reports successful association; each network block should have                           
#    explicit security policy (i.e., only one option in the lists) for                                   
#    key_mgmt, pairwise, group, proto variables                                                          
# When using IBSS or AP mode, ap_scan=2 mode can force the new network to be                             
# created immediately regardless of scan results. ap_scan=1 mode will first try                          
# to scan for existing networks and only if no matches with the enabled                                  
# networks are found, a new IBSS or AP mode network is created.

                                                                              

                                                                               
ap_scan=1                                                                      
                                                                               
                                                                               
# EAP fast re-authentication                                                   
# By default, fast re-authentication is enabled for all EAP methods that       
# support it. This variable can be used to disable fast re-authentication.     
# Normally, there is no need to disable this.                                  
                                                                               
fast_reauth=1                                                                  
device_name=Blaze                                                              
manufacturer=TI                                                                
model_name=Wilink                                                              
model_number=wl18xx                                                            
serial_number=12345                                                            
driver_param=use_multi_chan_concurrent=1 use_p2p_group_interface=1             
                                                                               
# Timeout in seconds to detect STA inactivity (default: 300 seconds)           
#                                                                              
# This timeout value is used in P2P GO mode to clean up                        
# inactive stations.                                                           
                                                                               
                                                                               
p2p_go_max_inactivity=60                                                       
p2p_go_ht40=1                                                             
disassoc_low_ack=1                                                        
concurrent_sched_scan=1                                                   
p2p_disabled=1                                                            
                                                                          
network={                                                                 
        ssid="Rahul-wifi"                                                 
        psk="mypassword"                                                  

root@Htouch:~# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
Could not read interface p2p-dev-wlan0 flags: No such device
Failed to create interface p2p-dev-p2p-dev-wlan0: -22 (Invalid argument)
nl80211: Failed to create a P2P Device interface p2p-dev-p2p-dev-wlan0
P2P: Failed to enable P2P Device interface

kindly suggest me where i am doing wrong configuration.

  • Hi,
    Can you check if following wpa_cli commands work ok for you . You will need to modify the commands as per your network

    wpa_supplicant -d -Dnl80211 -c/etc/wpa_supplicant.conf -iwlan0 -B
    wpa_cli -iwlan0 disconnect
    for i in `wpa_cli -iwlan0 list_networks | grep ^[0-9] | cut -f1`; do wpa_cli -iwlan0 remove_network $i; done
    wpa_cli -iwlan0 add_network
    wpa_cli -iwlan0 set_network 0 auth_alg OPEN
    wpa_cli -iwlan0 set_network 0 key_mgmt WPA-PSK
    wpa_cli -iwlan0 set_network 0 psk '"<your_password>"'
    wpa_cli -iwlan0 set_network 0 proto RSN
    wpa_cli -iwlan0 set_network 0 mode 0
    wpa_cli -iwlan0 set_network 0 ssid '"<your_ssid>"'
    wpa_cli -iwlan0 select_network 0
    wpa_cli -iwlan0 enable_network 0
    wpa_cli -iwlan0 reassociate
    wpa_cli -iwlan0 status
    wpa_cli save_config
    iw wlan0 link


    Saurabh
  • Thank you saurabh, Now i am able to connect my board over wifi.
    but there is one more issue it does not automatic connect at boot time every time i need to do ifup wlan0 after boot.
    i checked, my network related services also enabled.
    kindly suggest me on this point also.
  • Rahul,
    This is something you will have to address at your end . You probably need to look into linux services that start at boot time and bring up wlan0 interface when that service is started

    Saurabh