Recalbox 7.0

can't connect to Wifi using TP-LINK TL-WN823N

  • Hi everyone,

    I use recalbox on my rpi 2B since a while but I changed my home configuration and want to connect the Recalbox using Wifi.

    I choose the dongle TP-LINK TL-WN823N since it is marked as supported in the compatibility list but I can't make it work.

    I try to fill SSID and password in the Recalbox Interface, in the recalbox.conf using nano in ssh, but nothing works.

    Here is the dmesg output when I plug the dongle :

    [ 200.297992] usb 1-1.2: USB disconnect, device number 4
    [ 204.373470] usb 1-1.2: new high-speed USB device number 5 using dwc_otg
    [ 204.474567] usb 1-1.2: New USB device found, idVendor=2357, idProduct=0109
    [ 204.474591] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 204.474610] usb 1-1.2: Product: 802.11n NIC
    [ 204.474622] usb 1-1.2: Manufacturer: Realtek
    [ 204.474633] usb 1-1.2: SerialNumber: 00e04c000001

    Can someone have any idea ?

    Thanks !

  • @blaadr What type of wifi security is active on your access point ? WEP ? WPA ? WPA2 ?

  • @gkralicek2
    it is wpa-psk(tkip) + wpa2-psk(aes).

  • @blaadr It should work fine with that. Maybe your password contains special characters that are not recognized properly by the system when you type it using the standard recalbox menu. What you can try before any further investigation is to try and edit the recalbox.conf file (located in the ./recalbox/share/system folder) in order to type your wifi password manually and make sure that all the characters are there. Once done save the recalbox.conf file and reboot in order to see if it solves your problem. If not we'll look deeper in to the matter :=)

  • @gkralicek2
    Well, In fact, when I connected in ssh to edit the recalbox.conf I've done a copy/paste of both SSID and Key directly from the admin console of the wifi router.
    So I'm pretty sure of them 😕

  • @blaadr Ok, so what you can do next is to force the configuration in the wpa_supplicant.conf file located in /etc/wpa_supplicant/wpa_supplicant.conf

    Open the file delete the content and replace it with the following (replace the indications ssid and pass with your own ones) :

    ctrl_interface=/var/run/wpa_supplicant GROUP=root


    proto=WPA RSN
    group=CCMP TKIP

    Save and reboot. Should work fine with that. Keep me posted !

  • @gkralicek2
    Thank for your help, I tried to do that but when I try writing my file with nano, I get the error message :"Error writing wpa_supplicant.conf: Read-only file system".
    I tried to chmod the file but I can't, for the same reason.
    How can I overpass this ?

  • @blaadr type the following :
    mount -o remount,rw /boot
    while in ssh in order to remount the root partition in read/write mode. Then you should have no problem saving the wpa_supplicant.conf file :=)

  • @gkralicek2 I finally wrote successfully the wpa_supplicant.conf file but still not working after reboot.
    So I tried launching command to debug :

     wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -d

    Here is the output :

    wpa_supplicant v2.5
    random: Trying to read entropy from /dev/random
    Successfully initialized wpa_supplicant
    Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
    Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
    Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
    ctrl_interface='DIR=/var/run/wpa_supplicant GROUP=root'
    Priority group 0
       id=0 ssid='NUMERICABLE-B023'
    Could not read interface wlan0 flags: No such device
    nl80211: Driver does not support authentication/association or connect commands
    nl80211: deinit ifname=wlan0 disabled_11b_rates=0
    nl80211: Remove monitor interface: refcount=0
    netlink: Operstate: ifindex=0 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
    Could not read interface wlan0 flags: No such device
    nl80211: Set mode ifindex 0 iftype 2 (STATION)
    nl80211: Failed to set interface 0 to mode 2: -19 (No such device)
    wlan0: Failed to initialize driver interface
    Failed to add interface wlan0
    wlan0: Cancelling scan request
    wlan0: Cancelling authentication timeout


  • @blaadr Have you tried unplugging your dongle and plugging it back on a different usb port to refresh the driver ?
    And is your AP SSID visible or hidden ?

  • @gkralicek2 I tried to unplugged the dongle and plug it into all the other port without sucess 😞

    Besides,the AP SSID is visible.

    Just to be sure that it don't come from the dongle itself, I plugged it on my Windows 10 PC and it works fine. But there is a LED on the dongle that flash when connected to the PC that do not flash when connected to the RPI...

  • @blaadr The dongle LED should light up when plugged showing the +5v from the USB is indeed received. What type of power supply do you use ? 2A ? 3A ?
    Don't you have a tiny multicoloured square icon displayed from time to time at the top right corner of your screen when the dongle is plugged ?

  • @gkralicek2
    I use a 3A power supply, and I never had problems using other USB devices.
    I just played for 15 minutes and never noticed any icon on the screen.

    Just to be sure it doesn't come from the power supply, I tried another one, without success.

    I noticed that the LED of the dongle flash for 1/10 second when I plug it.

  • @blaadr Oh ok, then if it flashes even very briefly when plugged power is received ok but the fact you don't have the constant blinking afterwards means the driver doesn't initialize itself properly at bootup. What do you get when doing an ifconfig ? Do you see wlan0 listed ? And could you please make a capture of your /etc/network/interfaces file ?

  • @gkralicek2 Ok so i do not have a wlan0 interface listed here is the outputof the ifconfig :

    eth0      Link encap:Ethernet  HWaddr B8:27:EB:87:12:3A
              inet addr:  Bcast:  Mask:
              inet6 addr: fe80::ba27:ebff:fe87:123a%1994612484/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:104 errors:0 dropped:0 overruns:0 frame:0
              TX packets:135 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:9948 (9.7 KiB)  TX bytes:19315 (18.8 KiB)
    lo        Link encap:Local Loopback
              inet addr:  Mask:
              inet6 addr: ::1%1994612484/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    And this is the content of the /etc/network/interfaces file :

    # Configure Loopback
    auto lo
    iface lo inet loopback
    auto eth0
    iface eth0 inet dhcp
    auto wlan0
    iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

  • @blaadr ok so it seems obvious that the dongle driver is not loaded. What do you get if you type :
    ifup wlan0

  • @gkralicek2 Then I get this output :

    ip: SIOCGIFFLAGS: No such device

  • @blaadr ok, no wifi driver is loaded in the system and your card wlan0 is not created. So now we'll have to find what prevent the driver to be loaded in the system. I'll need a capture of your recalbox.log file.
    Go to recalbox/share/system/logs and delete the file recalbox.log which is there. Then reboot your system having your dongle inserted in USB port, go back to the log folder, open the file and cut and paste the content here

  • @gkralicek2 Here it is :

    [     5271.69] : Stopping S94manager
    [        2.79] : starting new log
    [        2.82] : converting dos to unix carriage return characters
    [        3.52] : setting audio to auto
    [        3.60] : setting audio volume to 90
    ---- ----
    [        3.65] : setting hostname to RECALBOX
    ---- ----
    [        3.71] : setting audio output mode : auto
    [        3.73] : setting audio volume : 90
    numid=3,iface=MIXER,name='PCM Playback Route'
      ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
      : values=0
    Simple mixer control 'PCM',0
      Capabilities: pvolume pvolume-joined pswitch pswitch-joined
      Playback channels: Mono
      Limits: Playback -10239 - 400
      Mono: Playback -663 [90%] [-6.63dB] [on]
    [        3.84] : creating network entry in /var/lib/wpa_supplicant.conf
    [        3.89] : setting keyboard layout to fr
    [        3.89] : updated wifi settings : ssid=NUMERICABLE-B023 key=BNKFPLJB1K
    Loading /usr/share/keymaps/i386/azerty/
    [        4.55] : starting emulationstation with lang = fr_FR
    [        4.58] : Starting emulationstation with command :
    [        4.60] : HOME=/recalbox/share/system LANG="fr_FR.UTF-8" SDL_VIDEO_GL_DRIVER=/usr/lib/ SDL_NOMOUSE=1 /usr/bin/emulationstation; [ -f /tmp/shutdown.please ] && (rm /tmp/shutdown.please; shutdown -h now);[ -f /tmp/reboot.please ] && (rm /tmp/reboot.please; shutdown -r now)
    ---- ----
    udhcpc (v1.24.1) started
    Sending discover...
    Sending discover...
    Sending select for
    Lease of obtained, lease time 86400
    deleting routers
    adding dns
    adding dns
    ---- ----
    [       15.85] : no wlan interface found
    ---- ----
    [       18.87] : Starting S94manager
    Will not start pm2 : system.api.enabled is set to 0

  • @blaadr unplug your Ethernet cable otherwise the Wlan0 card won't initialize. According to the capture you sent you are already connected to your network through wire and you got an IP address in 192.168.0.x. You won't manage to get another card on the same network until you unplug the first one.
    So lose the network cable and reboot the pi with the usb dongle only in order to check if the network card initializes.
    Once booted try to initiate a "ping recalbox" command from your Windows machine connected to the network and see if the Pi replies.

Want to support us ?