[help]Cannot connect via wifi to an access point

Started by thiddleston530, May 22, 2021, 07:41:55 AM

Previous topic - Next topic

thiddleston530

Hello,

I have no deep knowledge in A20 board as I just come on a project developped be an other team and now, I have to connect this board on a wifi access point.
Previously, it was an access point itself.

This board is based on buildroot-2015.

I had to add wpa_supplicant from menu config and I also asked to add wpa_cli and wpa_passphrase but unfortunately, after a make I can only find wpa_supplicant in the root fs. Better than nothing....

So I think I have bad configuration files. There are listed below:

/etc/init.d/S04Wireless:
    #!/bin/sh

    pid=$(lsusb | grep 0bda | awk '{print $6}' | tail -c5)

    if [ "$piad" = "8176" ]
    then
            echo "Detecting RTL8188CUS wifi adapter"
            driver=8192cu
    elif [ "$pid" = "8179" ]
    then
            echo "Detecting RTL8188EUS wifi adapter"
            driver=8188eu
    else
            echo "No wifi adapter found!"
            exit 1
    fi

    start() {
            echo "Starting Wireless Driver..."
            echo
            echo "    loading driver..."
            insmod /usr/local/lib/wireless/$driver.ko rtw_power_mgnt=0 rtw_enusbss=0
    }

    stop() {
            rmmod $driver
    }

    case "$1" in
        start)
            start
            ;;
        stop)
            stop
            ;;
        restart|reload)
            stop
            start
            ;;
        *)
            echo
            echo "Usage: $0 {start|stop|restart}"
            echo
            exit 1
            ;;
    esac

    exit $?

/etc/init.d/S40network
    #!/bin/sh
    #
    # Start the network....
    #

    # Debian ifupdown needs the /run/network lock directory
    mkdir -p /run/network

    case "$1" in
      start)
            echo "Starting network..."
            /sbin/ifup -a
            ;;
      stop)
            echo -n "Stopping network..."
            /sbin/ifdown -a
            ;;
      restart|reload)
            "$0" stop
            "$0" start
            ;;
      *)
            echo "Usage: $0 {start|stop|restart}"
            exit 1
    esac

    exit $?


/etc/wpa_supplicant/wpa_supplicant.conf

    ctrl_interface=/usr/sbin/wpa_supplicant
    update_config=1

    ap_scan=1

    network={
            ssid="AC_MYCOACH"
            psk=4e2a6ac8650c3543ade9c....f440c9ae88fbfe505abd3c0cc2
    }

if I execute ifup wlan0, I get:

# ifup -vvv wlan0
    run-parts /etc/network/if-pre-up.d
    ip link set wlan0 up
    udhcpc -R -n -p /var/run/udhcpc.wlan0.pid -i wlan0
    udhcpc (v1.23.2) started
    Sending discover...
    Sending discover...
    Sending discover...
    No lease, failing

And the wlan0 is not connected:
# iwconfig
lo        no wireless extensions.

tunl0     no wireless extensions.

wlan0     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Anyway, I can see the access point:

# iwlist wlan0 scan
    wlan0     Scan completed :
          Cell 01 - Address: DE:AD:BE:EF:00:00
                    ESSID:"AC_MYCOACH"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Frequency:2.412 GHz (Channel 1)
                    Encryption key:on
                    Bit Rates:54 Mb/s
                    Extra:wpa_ie=dd160050f20101000050f20201000050f20201000050f202
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    Quality=100/100  Signal level=100/100

I can connect to this access point without problem from my smartphone.
Could you please tell me what's wrong?

Regards,
thiddleston530