Problems build a custom nerves system with usb wifi adapter drivers

Hi!

I’m trying to make a custom Raspnberry Pi B+ nerves system with support for USB wifi adapter. I have a TP-Link TL-WN725N v2 which uses the Realtek RTL8188EUS chipset.

I expected the wifi adapter to be supported out of the box with the correct configuration but I have not had any luck making it work yet. I have tried adding more support in the kernel to have support for wireless USB adapter, but so far it has not worked.

This is the configuration I made to the buildroot and linux kernel configs: Add configration for usb wifi adapter support · ringvold/nerves_system_rpi_wifi@962de5c · GitHub

I can see the interface in ifconfig, but wpa_supplicant does not work.
It errors logs out these messages before stopping:

15:29:15.965 [debug] wpa_supplicant: Successfully initialized wpa_supplicant

15:29:15.975 [debug] wpa_supplicant: nl80211: Driver does not support authentication/association or connect commands

15:29:15.979 [debug] wpa_supplicant: nl80211: deinit ifname=wlan0 disabled_11b_rates=0

15:29:15.980 [debug] wpa_supplicant: wlan0: Unsupported driver 'wext'

15:29:15.983 [debug] wpa_supplicant: wlan0: CTRL-EVENT-DSCP-POLICY clear_all

15:29:15.996 [error] wpa_supplicant: Process exited with status 255

I’m not sure if I need some add some drivers in addition to the kernel configuration or something else.

There are several repositories with driver source code for the chipset, but I don’t know how I would make that a part of the nerves system build. If that even is the fix for the problem I’m having.

Any help regarding this would be very much appreciated. :slight_smile:

2 Likes

There are a few things it could be here since these chipsets could vary quite a bit. The checklist I usually go through is:

  1. Is driver enabled? (via make Linux-menuconfig)
  2. Is the WiFi firmware included? (via make menuconfig)
  3. Run dmesg on device with the USB adapter connected
  • does the USB adapter show up?
  • if yes, note the vendor and product ID. Check for that combination in the Linux kernel, usually in the drivers/net/wireless/realtek/rtlwifi/<driver_name>/sw.c file. If the vendor/product combo isn’t here, you may have to patch the file for the usb device to be correctly detected
  1. See if dmesg or kernel logs on startup have any other hints at what driver/firmware might be attempted. Chances are the USB dongle is not using the chip you think it is and finding the vendor/product combo in #3 will help direct which driver and firmware is actually needed
1 Like

I’m pretty sure chipset is R8188EU and dmesg is saying R8188EU: Firmware Version 11, SubVersion 1, Signature 0x88e1.
It seems like I had not added all the required things in make menuconfig. Ex. BR2_PACKAGE_RTL8188EU

Now I get a build error:

ERROR: modpost: "filp_close" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "kernel_read" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "proc_mkdir_data" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__cfg80211_send_event_skb" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__cfg80211_alloc_event_skb" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "strncasecmp" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "proc_get_parent_data" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__pskb_copy_fclone" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "seq_release" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
WARNING: modpost: suppressed 1 unresolved symbol warnings because there were too many)
make[3]: *** [scripts/Makefile.modpost:134: /nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./Module.symvers] Error 1
make[3]: *** Deleting file '/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./Module.symvers'
make[2]: *** [Makefile:1783: modules] Error 2
make[1]: *** [package/pkg-generic.mk:294: /nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/.stamp_built] Error 2
make: *** [Makefile:23: _all] Error 2

Any ideas what that could be?

1 Like

There isn’t enough context with the output above. I would need the very beginning of the report (or possibly the whole log)

1 Like

Output from mix firmware:

==> nerves
==> nerves_system_rpi_wifi
|Elixir.Docker| Starting Build... (this may take a while)

....
>>> rtl8188eu 903b6fcb821465fe9c63e83416080df70c1c3c90 Building
>>> rtl8188eu 903b6fcb821465fe9c63e83416080df70c1c3c90 Building kernel module(s)could not compile dependency :nerves_system_rpi_wifi, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile nerves_system_rpi_wifi", update it with "mix deps.update nerves_system_rpi_wifi" or clean it with "mix deps.clean nerves_system_rpi_wifi"
==> nerves_livebook
** (Mix) The Nerves Docker build_runner encountered an error while building:

-----
ERROR: modpost: "seq_open" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "filp_close" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "kernel_read" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "proc_mkdir_data" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__cfg80211_send_event_skb" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__cfg80211_alloc_event_skb" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "strncasecmp" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "proc_get_parent_data" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__pskb_copy_fclone" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "seq_release" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
WARNING: modpost: suppressed 1 unresolved symbol warnings because there were too many)
make[3]: *** [scripts/Makefile.modpost:134: /nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./Module.symvers] Error 1
make[3]: *** Deleting file '/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./Module.symvers'
make[2]: *** [Makefile:1783: modules] Error 2
make[1]: *** [package/pkg-generic.mk:294: /nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/.stamp_built] Error 2
make: *** [Makefile:23: _all] Error 2

-----

The full logfile (build.log):

Setting User
UID: 501
GID: 20
Switching user
/usr/bin/make -j1 O=/nerves/build HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
  GEN     /nerves/build/Makefile

WARNING: unmet direct dependencies detected for BR2_PACKAGE_ERLANG
  Depends on [n]: BR2_USE_MMU [=y] && !BR2_STATIC_LIBS [=n] && BR2_TOOLCHAIN_HAS_THREADS [=y] && BR2_PACKAGE_ERLANG_ARCH_SUPPORTS [=n]
  Selected by [y]:
  - BR2_PACKAGE_NERVES_CONFIG [=y]

WARNING: unmet direct dependencies detected for BR2_PACKAGE_ERLANG
  Depends on [n]: BR2_USE_MMU [=y] && !BR2_STATIC_LIBS [=n] && BR2_TOOLCHAIN_HAS_THREADS [=y] && BR2_PACKAGE_ERLANG_ARCH_SUPPORTS [=n]
  Selected by [y]:
  - BR2_PACKAGE_NERVES_CONFIG [=y]
>>> rtl8188eu 903b6fcb821465fe9c63e83416080df70c1c3c90 Building
>>> rtl8188eu 903b6fcb821465fe9c63e83416080df70c1c3c90 Building kernel module(s)
PATH="/nerves/build/host/bin:/nerves/build/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" PKG_CONFIG="/nerves/build/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/nerves/build/host/lib/pkgconfig:/nerves/build/host/share/pkgconfig" BR_BINARIES_DIR=/nerves/build/images KBUILD_BUILD_VERSION=1 KBUILD_BUILD_USER=buildroot KBUILD_BUILD_HOST=buildroot KBUILD_BUILD_TIMESTAMP="Mon Jun  6 20:06:40 UTC 2022" KCFLAGS=-Wno-attribute-alias DTC_FLAGS=-@ /usr/bin/make -j9 -C /nerves/build/build/linux-1.20220331 HOSTCC="/usr/bin/gcc -O2 -I/nerves/build/host/include -L/nerves/build/host/lib -Wl,-rpath,/nerves/build/host/lib" ARCH=arm INSTALL_MOD_PATH=/nerves/build/target CROSS_COMPILE="/nerves/build/host/bin/armv6-nerves-linux-gnueabihf-" WERROR=0 DEPMOD=/nerves/build/host/sbin/depmod INSTALL_MOD_STRIP=1 CONFIG_RTL8188EU=m PWD=/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/. M=/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/. modules
  MODPOST /nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./Module.symvers
ERROR: modpost: "seq_open" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "filp_close" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "kernel_read" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "proc_mkdir_data" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__cfg80211_send_event_skb" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__cfg80211_alloc_event_skb" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "strncasecmp" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "proc_get_parent_data" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "__pskb_copy_fclone" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
ERROR: modpost: "seq_release" [/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./8188eu.ko] undefined!
WARNING: modpost: suppressed 1 unresolved symbol warnings because there were too many)
make[3]: *** [scripts/Makefile.modpost:134: /nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./Module.symvers] Error 1
make[3]: *** Deleting file '/nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/./Module.symvers'
make[2]: *** [Makefile:1783: modules] Error 2
make[1]: *** [package/pkg-generic.mk:294: /nerves/build/build/rtl8188eu-903b6fcb821465fe9c63e83416080df70c1c3c90/.stamp_built] Error 2
make: *** [Makefile:23: _all] Error 2