Raspberry 3 with USB Wifi Stick

  • Hello everybody,

    i have a little problem with my LibreELEC / Tvheadend client.

    The onboard wifi modul on the Rpi 3 is not fast enught to see HD TV.

    So if ordered this WIFI USB Stick: ANEWKODI Wlan Stick 600Mbit/s, 5dBi Antenna, Dualband: Amazon.de: Elektronik

    In the Rpi3 'confi.txt' i have diabled the onboard modul with entry:

    dtoverlay=pi3-disable-wifi

    When i plug the USB Stick on the Rpi 3, LibreELEC identify the Stick in lsusb as

    Bus 001 Device 004: ID 0bda:a811 Realtek Semiconductor Corp.

    When i connect the Wifi Network on the Kodi Frotend, LibreELEC give the folowing Error Message:

    Network Error: Did not receive a reply. Possible causes include: the remote App

    The Stick connect the Network with really good performance but i can't find any entrys at the logs.

    When i connect on the ssh console with connman he give no Error Message and connect.

    But the problem is when i give the Rpi a reboot from the kodi frontend or with ssh,

    in both things LibreELEC lost/forgett the Wifi Settings and the Key.

    So i must re-enter the Settings an the key at each reboot :-/

  • The connection manager stores network profiles via hardware MAC address, and your device is probably configured with 00:00:00:00 so each time you reboot the kernel assigns a new random MAC. This does not match any existing stored profiles, so you need to configure the network (again).

    "dmesg | paste" and share the URL generated to confirm.

  • Hey chewitt,

    here i have a print out of dmeseg it's from my test with OSMC but is have the same problem.

    I think it is the driver for the rtl8812au chipset he can not read the MAC from the EPROM...

    Display Spoiler

    [ 1.244780] dwc_otg: Microframe scheduler enabled

    [ 1.244826] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x806d587c

    [ 1.244837] WARN::hcd_init_fiq:460: FIQ ASM at 0x806d5bec length 36

    [ 1.244848] WARN::hcd_init_fiq:486: MPHI regs_base at 0xb087a000

    [ 1.244908] dwc_otg 3f980000.usb: DWC OTG Controller

    [ 1.244944] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1

    [ 1.244976] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000

    [ 1.245022] Init: Port Power? op_state=1

    [ 1.245027] Init: Power Port (0)

    [ 1.245227] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

    [ 1.245237] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

    [ 1.245246] usb usb1: Product: DWC OTG Controller

    [ 1.245254] usb usb1: Manufacturer: Linux 4.9.29-10-osmc dwc_otg_hcd

    [ 1.245262] usb usb1: SerialNumber: 3f980000.usb

    [ 1.246054] hub 1-0:1.0: USB hub found

    [ 1.246095] hub 1-0:1.0: 1 port detected

    [ 1.246734] dwc_otg: FIQ enabled

    [ 1.246740] dwc_otg: NAK holdoff enabled

    [ 1.246744] dwc_otg: FIQ split-transaction FSM enabled

    [ 1.246757] Module dwc_common_port init

    [ 1.246996] usbcore: registered new interface driver usb-storage

    [ 1.247228] mousedev: PS/2 mouse device common for all mice

    [ 1.247552] usbcore: registered new interface driver usbtouchscreen

    [ 1.248008] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer

    [ 1.248291] bcm2835-cpufreq: min=600000 max=1000000

    [ 1.250407] sdhci: Secure Digital Host Controller Interface driver

    [ 1.250410] sdhci: Copyright(c) Pierre Ossman

    [ 1.250570] sdhost-bcm2835 3f202000.sdhost: could not get clk, deferring probe

    [ 1.252589] mmc-bcm2835 3f300000.mmc: could not get clk, deferring probe

    [ 1.252647] sdhci-pltfm: SDHCI platform and OF driver helper

    [ 1.254712] ledtrig-cpu: registered to indicate activity on CPUs

    [ 1.254819] hidraw: raw HID events driver (C) Jiri Kosina

    [ 1.254911] usbcore: registered new interface driver usbhid

    [ 1.254913] usbhid: USB HID core driver

    [ 1.255393] vchiq: vchiq_init_state: slot_zero = 0xaf980000, is_master = 0

    [ 1.257073] Initializing XFRM netlink socket

    [ 1.257088] NET: Registered protocol family 17

    [ 1.257166] Key type dns_resolver registered

    [ 1.257239] Registering SWP/SWPB emulation handler

    [ 1.257651] registered taskstats version 1

    [ 1.258417] Key type encrypted registered

    [ 1.258601] vc-sm: Videocore shared memory driver

    [ 1.258606] [vc_sm_connected_init]: start

    [ 1.263220] [vc_sm_connected_init]: end - returning 0

    [ 1.267093] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2

    [ 1.268009] sdhost: log_buf @ af907000 (ef907000)

    [ 1.344519] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)

    [ 1.346545] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0

    [ 1.346551] mmc-bcm2835 3f300000.mmc: DMA channel allocated

    [ 1.424581] of_cfs_init

    [ 1.424648] of_cfs_init: OK

    [ 1.430657] Freeing unused kernel memory: 2048K (80c00000 - 80e00000)

    [ 1.443687] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)

    [ 1.445236] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)

    [ 1.446764] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)

    [ 1.449566] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)

    [ 1.474617] Indeed it is in host mode hprt0 = 00021501

    [ 1.484512] mmc0: host does not support reading read-only switch, assuming write-enable

    [ 1.490334] mmc0: new high speed SDHC card at address aaaa

    [ 1.490873] mmcblk0: mmc0:aaaa SC16G 14.8 GiB

    [ 1.509443] random: fast init done

    [ 1.542019] mmcblk0: p1 p2

    [ 1.549369] mmc1: new high speed SDIO card at address 0001

    [ 1.637845] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)

    [ 1.644692] fsck: E2fsck run: /bin/e2fsck -p -C 0 /dev/mmcblk0p2

    [ 1.644852] fsck: Filesystem UUID: baf6c3be-07cc-43d9-a20c-2d3184e511dc

    [ 1.645029] fsck: /dev/mmcblk0p2: clean, 25116/958464 files, 266355/3826688 blocks

    [ 1.674581] usb 1-1: new high-speed USB device number 2 using dwc_otg

    [ 1.674674] Indeed it is in host mode hprt0 = 00001101

    [ 1.904737] usb 1-1: New USB device found, idVendor=0424, idProduct=9514

    [ 1.904743] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0

    [ 1.905275] hub 1-1:1.0: USB hub found

    [ 1.905337] hub 1-1:1.0: 5 ports detected

    [ 2.224575] usb 1-1.1: new high-speed USB device number 3 using dwc_otg

    [ 2.354752] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00

    [ 2.354762] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0

    [ 2.357325] smsc95xx v1.0.5

    [ 2.446921] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ba:99:31

    [ 2.544542] usb 1-1.4: new high-speed USB device number 4 using dwc_otg

    [ 2.675080] usb 1-1.4: New USB device found, idVendor=0bda, idProduct=a811

    [ 2.675090] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3

    [ 2.675096] usb 1-1.4: Product: 802.11ac WLAN Adapter

    [ 2.675101] usb 1-1.4: Manufacturer: Realtek

    [ 2.675105] usb 1-1.4: SerialNumber: 00e04c000001

    [ 2.774592] usb 1-1.5: new full-speed USB device number 5 using dwc_otg

    [ 2.917692] usb 1-1.5: New USB device found, idVendor=17ef, idProduct=6022

    [ 2.917702] usb 1-1.5: New USB device strings: Mfr=0, Product=2, SerialNumber=0

    [ 2.917707] usb 1-1.5: Product: Lenovo Ultraslim Plus Wireless Keyboard & Mouse

    [ 2.924353] input: Lenovo Ultraslim Plus Wireless Keyboard & Mouse as /devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.5…01/input/input0

    [ 2.984727] hid-generic 0003:17EF:6022.0001: input,hidraw0: USB HID v1.11 Keyboard [Lenovo Ultraslim Plus Wireless Keyboard & Mouse] on usb-3f980000.usb-1.5/input0

    [ 2.994108] input: Lenovo Ultraslim Plus Wireless Keyboard & Mouse as /devices/platform/soc/http://3f980000.usb/usb1/1-1/1-1.5…02/input/input1

    [ 3.029904] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)

    [ 3.030109] systemd[1]: Detected architecture 'arm'.

    [ 3.054829] hid-generic 0003:17EF:6022.0002: input,hidraw1: USB HID v1.11 Mouse [Lenovo Ultraslim Plus Wireless Keyboard & Mouse] on usb-3f980000.usb-1.5/input1

    [ 3.077030] NET: Registered protocol family 10

    [ 3.078007] systemd[1]: Inserted module 'ipv6'

    [ 3.088788] systemd[1]: Set hostname to <osmc01>.

    [ 3.307104] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.

    [ 3.307279] systemd[1]: Found ordering cycle on basic.target/start

    [ 3.307289] systemd[1]: Found dependency on sysinit.target/start

    [ 3.307298] systemd[1]: Found dependency on rpcbind.service/start

    [ 3.307308] systemd[1]: Found dependency on network-online.target/start

    [ 3.307317] systemd[1]: Found dependency on connman-wait-for-network.service/start

    [ 3.506269] fuse init (API version 7.26)

    [ 3.743550] systemd-udevd[220]: starting version 215

    [ 4.155025] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000

    [ 4.491965] 8812au: loading out-of-tree module taints kernel.

    [ 4.503500] RTL871X: module init start

    [ 4.503509] RTL871X: rtl8812au v4.3.20_16317.20160108

    [ 4.503512] RTL871X: build time: Oct 9 2017 03:30:04

    [ 4.573311] usbcore: registered new interface driver brcmfmac

    [ 4.584266] RTL871X: ERROR invalid mac addr:00:00:00:00:00:00, assign random MAC

    [ 4.585108] RTL871X: rtw_ndev_init(wlan0) if1 mac_addr=00:e0:4c:2b:f0:a4

    [ 4.586162] usbcore: registered new interface driver rtl8812au

    [ 4.586172] RTL871X: module init ret=0

    [ 4.664029] random: crng init done

    [ 4.735183] brcmfmac: Firmware version = wl0: Aug 7 2017 00:46:29 version 7.45.41.46 (r666254 CY) FWID 01-f8a78378

    [ 5.205616] systemd-journald[196]: Received request to flush runtime journal from PID 1

    [ 5.229118] uart-pl011 3f201000.serial: no DMA platform data

    [ 5.411095] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup

    [ 5.411233] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

    [ 5.461623] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready

    [ 5.461633] brcmfmac: power management disabled

    [ 5.741274] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

    [ 7.677790] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

    [ 7.682237] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1

    [ 7.695436] 8021q: 802.1Q VLAN Support v1.8

    [ 9.640442] Bluetooth: Core ver 2.22

    [ 9.640503] NET: Registered protocol family 31

    [ 9.640507] Bluetooth: HCI device and connection manager initialized

    [ 9.640521] Bluetooth: HCI socket layer initialized

    [ 9.640529] Bluetooth: L2CAP socket layer initialized

    [ 9.640551] Bluetooth: SCO socket layer initialized

    [ 9.649524] Bluetooth: HCI UART driver ver 2.3

    [ 9.649534] Bluetooth: HCI UART protocol H4 registered

    [ 9.649537] Bluetooth: HCI UART protocol Three-wire (H5) registered

    [ 9.649646] Bluetooth: HCI UART protocol Broadcom registered

    [ 9.722101] Bluetooth: BNEP (Ethernet Emulation) ver 1.3

    [ 9.722109] Bluetooth: BNEP filters: protocol multicast

    [ 9.722122] Bluetooth: BNEP socket layer initialized

    [ 17.318480] Console: switching to colour dummy device 80x30

    [ 25.226512] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

    [ 152.675723] RTL871X: rtw_set_802_11_connect(wlan0) fw_state=0x00000008

    [ 152.730076] RTL871X: start auth

    [ 152.734473] RTL871X: auth success, start assoc

    [ 152.750325] RTL871X: rtw_cfg80211_indicate_connect(wlan0) BSS not found !!

    [ 152.750352] RTL871X: assoc success

    [ 152.750557] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

    [ 152.755054] RTL871X: recv eapol packet

    [ 152.755774] RTL871X: send eapol packet

    [ 152.767522] RTL871X: recv eapol packet

    [ 152.767931] RTL871X: send eapol packet

    [ 152.768548] RTL871X: set pairwise key camid:4, addr:c0:25:06:f1:ce:56, kid:0, type:AES

    [ 152.775466] RTL871X: set group key camid:5, addr:c0:25:06:f1:ce:56, kid:2, type:AES

    [ 459.226955] RTL871X: recv eapol packet

    [ 459.228339] RTL871X: set group key camid:6, addr:c0:25:06:f1:ce:56, kid:1, type:AES

    [ 459.228420] RTL871X: send eapol packet

    [ 1059.233177] RTL871X: recv eapol packet

    [ 1059.234595] RTL871X: set group key camid:5, addr:c0:25:06:f1:ce:56, kid:2, type:AES

    [ 1059.234745] RTL871X: send eapol packet

    [ 1659.238368] RTL871X: recv eapol packet

    [ 1659.239914] RTL871X: set group key camid:6, addr:c0:25:06:f1:ce:56, kid:1, type:AES

    [ 1659.240004] RTL871X: send eapol packet

  • I had the same problem in the past. My libreelec setup was only able to see the 5ghz channel 36 and 40. So maybe if you set the 5ghz channel in your router to 36 or 40 the problem is solved.

  • That's interesting too but i can see all Networks in the neighborhood 2,4 an 5 ghz.

    But in case the system can not rigster the real MAC Adress from the Chip that is realy strange that wil work with your solution....

    Crazy :)

    But maybe there are a other or newer driver / frimware for the Chipset that i can install or modify?

  • So and here we have the dmesg URL from as test with Rpi2 on LibreELEC 8.2.1

    URUW

    Display Spoiler
  • Code
    [ 4.584266] RTL871X: ERROR invalid mac addr:00:00:00:00:00:00, assign random MAC

    Manufacturers can save $$ if they do not acquire a block of MAC addresses that require each chipset to be programmed with a unique identifier. Finding devices with ^ no MAC is an increasing trend among cheap USB wireless devices.

    It's possible to force a specific MAC using udev rules but it's better done via kernel boot params as these are effected when the driver module loads at boot time. Right now I've forgotten how to do it .. I'll need to Google.

  • Thank you chewitt,

    now i have write a driver option file in /etc/modprobe.d/8812au.conf

    Code
    options 8812au rtw_initmac="6b:XX:XX:XX:XX"

    but now i can't find the wifi chanels 12/13 on 2,4 ghz and no 5 ghz Networks :(

    When i remove yet the conf file and reboot the usb wifi will also not find networks on chancel 12/13 on 2,4 ghz band and 5ghz anymore.

    Edited 2 times, last by fritz_hh (December 3, 2017 at 10:39 PM).

  • Code
    echo "options cfg80211 ieee80211_regdom=DE” > /storage/.config/modprobe.d/cfg80211.conf

    ^ Do that to set the wireless regulatory domain. It should allow channels 12-13 if allowed in Germany. If not, you have to break the law and set the regulatory domain to somewhere that allows them.

  • Thank You chewitt,

    that's works fine :)

    On LibreElec 8.x, OSMC 2017-10-1, openElex 6.x

    Here are the soloution compared for all that have se same problem with a externl Wifi device that have no MAC adress.

    For Rpi 3 diable the Internal Wifi Module is it necessary to edit the config.txt file:

    Code
    mount -o remount,rw /flash
    nano /flash/config.txt

    Add at the End: dtoverlay=pi3-disable-wifi

    Code: config.txt
    ...
    dtoverlay=pi3-disable-wifi

    and Save after a reboot the internal Wifi Module is diabled.

    For the external Wifi Module based on "rtl8812au" Chipset without a MAC Adress:

    1. Give the System the local info for the Wifi add the File "cfg80211.conf" in the directory "modprobe.d"

    LibreElec/openELEC: /storage/.config/modprobe.d/

    OSMC: /etc/modprobe.d/

    Code: cfg80211.conf
    options cfg80211 ieee80211_regdom=DE

    2. Set a fix MAC Adress for the device

    Code: 8812au.conf
     options 8812au rtw_initmac=xx:xx:xx:xx:xx:xx rtw_ht_enable=1 rtw_cbw40_enable=3

    Now reboot and enjoy :)