zephura
Posts: 47
Joined: Mon Jul 15, 2013 9:53 am

[Solved]Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 10:00 am

Hi all,

Here I am stuck with a widespread problem compiling realtek driver,
Now, I don't know what to try else.
What I have:
0/I have a working RaspberryPi-B with a 2A external power supply and this is not the point, the driver I compiled is not recognized.
1/I have a Realtek wifi dongle (sold by MAXXTER)

Code: Select all

# lsusb
Bus 001 Device 004: ID 0bda:818b Realtek Semiconductor Corp.
2/I have a RPi-B with Raspbmc (a raspian mod)

Code: Select all

# cat /etc/debian_version
7.6
# cat /etc/apt/sources.list
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free
3/I have what seems to be a 3.12.31 kernel

Code: Select all

# uname -r
3.12.31
# gzip -dc config.gz | head
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.12.31 Kernel Configuration
#
CONFIG_ARM=y
4/I got the kernel sources from git for the 3.12.31 version : https://github.com/raspberrypi/linux/tr ... 6db1929fc0
5/ got compiling driver sources v4.3.1.1 (that was a hard point to get compiling sources) from maxxter website:
http://www.maxxter.biz/default.aspx?op= ... em&id=8280 ==> Drivers software (148254 Kb)

What I have done:
A/in the unzipped sources directory,and prepare for module compilation.

Code: Select all

#make mrproper
#gzip -dc /proc/config.gz > .config
#make                        CROSS_COMPILE= modules_prepare
That was odd, it doesn't succeeded. Needed to do this:

Code: Select all

#make mrproper
#gzip -dc /proc/config.gz > .config
#make olddefconfig
#make                        CROSS_COMPILE= modules_prepare
./scripts/mod/modpost -o Module.symvers
This "make olddefconfig" makes me thing I do not have the right sources, even if all suggested it.....and this is where the issue should be I guess.
Anyway, all work as expected, except for the Module.symvers file which empty...
B/In the appropriate module 8192eu source directory (rtl8192EU_linux_v4.3.1.1_11320.20140505)

Code: Select all

#make ARCH=arm KSRC=/root/linux/3.12.31 KVER=3.12.31 MODDESTDIR=/lib/modules/3.12.31/kernel/drivers/net/wireless
# insmod 8192eu.ko
Error: could not insert module 8192eu.ko: Invalid module format
# dmesg | tail -1
8192eu: disagrees about version of symbol module_layout
My problem is :
- I don't what to use another dongle (I have other working wifi dongle, this is not the point)
- I want to make this one working (wrong pride ?, NO, I want to learn how to compile a module for a downloaded distro)
- I don't need to use CrossCompiler
- I don't really what to use my own compiled Kernel as "I want to learn how to compile a module for a downloaded distro"

EVERYTHING suggest me a kernel version issue
If anyone got a brilliant, stupid, blue or even alien idea, any idea around this issue will be welcome.

PS : Shame on me, For the fun, I even try a useless compilation of the whole kernel (4 to 5 hours)
Last edited by zephura on Tue Dec 09, 2014 7:12 pm, edited 1 time in total.

fruitoftheloom
Posts: 27225
Joined: Tue Mar 25, 2014 12:40 pm

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 10:47 am

Take what I advise as advice not the utopian holy grail, and it is gratis !!

zephura
Posts: 47
Joined: Mon Jul 15, 2013 9:53 am

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 3:21 pm

Thanks fruitoftheloom, maybe I should have continue one of the numerous threads around this "widespread problem",
Be sure I read a lot of forum threads, blog, web-site, advises with different distro before posting on the raspberry forum.

Last news:

I got EXACTLY the right kernel sources (extract from the bash script http://svn.stmlabs.com/svn/raspbmc/rele ... el-3.12.sh )
I did not get error message with the .config file

However I got the exactly same error message

Code: Select all

# insmod 8192eu.ko
Error: could not insert module 8192eu.ko: Invalid module format
# dmesg | tail -1
8192eu: no symbol version for module_layout
As I stated, it is more a question of "howto" rather than "I-want-something-working"
In the thread "fruitoftheloom" stated, " DougieLawson " is clear:
DougieLawson wrote:So your WiFi dongle is a Realtek
Bus 001 Device 005: ID 0bda:818b Realtek Semiconductor Corp.
That device does need the 8192eu driver.

Get the Raspberry Pi Linux source from
git clone http://github.com/raspberrypi/linux
and you should be able to configure that and build an 8192eu module.
1/ get the right kernel sources : DONE
2/ prepare the use of the kernel sources (a full make should not be necessary, but maybe the issue is here) : DONE
3/ get the right modules sources (8192eu) : DONE
4/ compile the module : DONE but NOT WORKING

I could not understand what/where I am doing wrong,

Edit
Some news,

Code: Select all

# modinfo 8192eu.ko
filename:       /root/wifi/rtl8192/rtl8192EU_linux_v4.3.1.1_11320.20140505/8192eu.ko
version:        v4.3.1.1_11320.20140505
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     19931DF208E284AA64C37D6
alias:          usb:v0BDAp818Cd*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp818Bd*dc*dsc*dp*icFFiscFFipFFin*
depends:
vermagic:       3.12.34 preempt mod_unload modversions ARMv6
1st, I see the Id of the device "v0BDAp818Bd"
2nd, I see an extremly odd vermagic : "vermagic: 3.12.34 preempt ..."
This means that somewhere the sources of the last kernel (3.12.34) where used...
I really don't know neither where nor why.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 6:25 pm

As vermagic shows "3.12.34" then almost certainly the kernel source the driver is referencing when compiling is 3.12.34 and not 3.12.31 as you expect. You can check the kernel source version by looking at the Makefile in the root directory of the kernel source. The first three lines show the kernel version.

Exactly what OS are you using? Can you post the output of command uname -a?


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

zephura
Posts: 47
Joined: Mon Jul 15, 2013 9:53 am

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 7:18 pm

The OS I want to use
2/I have a RaspberryPi-B with Raspbmc (a raspian mod)

the exact Kernel version :

Code: Select all

$ uname -a
Linux raspbmc-1 3.12.31 #2 PREEMPT Wed Oct 29 09:24:56 UTC 2014 armv6l GNU/Linux
The Makefile I use is here : https://github.com/raspberrypi/linux/bl ... y/Makefile
and my makefile shows:

Code: Select all

# head Makefile
VERSION = 3
PATCHLEVEL = 12
SUBLEVEL = 34
EXTRAVERSION =
NAME = One Giant Leap for Frogkind
I thought, I checked this...

I've tried the raspberry 3.12.31 kernel sources from https://github.com/raspberrypi/linux/tr ... 6db1929fc0
and I got an error from the .config file (during the modules_prepare operation), that's why I needed "make olddefconfig"

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 8:35 pm

I've seen a number of post from people wanting to compile drivers for raspbmc but without luck.

I don't use raspbmc but use raspbian instead and have no trouble compiling a number of different wifi drivers as all the data needed is directly available from the raspbian git repo, e.g. source, .config and Module.symvers.

With .config and Module.symvers and the Linux source drivers can be compiled without any real difficulty. For other OS's the difficulty is finding this data especially the exact source and particularly the right Module.symvers.

From what you are trying it seems you have downloaded the raspbian source for 3.12.31+. This will need patching to produce the raspbmc source and then the driver may be compiled ok. If the source has not been patched, or not patched correctly, this may explain the error you get with .config.

I did take a look at compiling a wifi driver for raspbmc a while back but gave up. Think I should take another look and see what I can come up with.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

DirkS
Posts: 10737
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 9:04 pm

Last edited by DirkS on Mon Dec 08, 2014 9:28 pm, edited 1 time in total.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 9:27 pm

Thanks Dirk,

Certainly looks useful. Must try again and see how I get on this time.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

zephura
Posts: 47
Joined: Mon Jul 15, 2013 9:53 am

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Mon Dec 08, 2014 10:22 pm

MrEngman >
I fear someone answer this... "no luck for raspbmc"
Well the solution is "easy" but dirty?, compile the kernel, boot on this kernel, compile the module, use the module.
I'll try this during the night

DirkS >
I already get the sources from the subversion of svn.stmlabs.com,
in the file build_kernel-3.12.sh I find where to DL the sources (kernel 3.12.34) and the patch files

From "dodger-tools" website, the procedure i followed is the same, except 3 points:
as I give the parameter CROSS_COMPILE, the toolchain is not used (I guess)
as I did not compile the kernel, the file Module.symvers is empty
as stressed by MrEngman, as I do not have EXACTLY the same kernel sources (3.12.34) as the build kernel (3.12.31), even if compilation succeeded, the module will failed.

Conclusion : until the next Raspbmc release (never, as it was the last release before KODI)
I have to compile the kernel, install it and use it.
that's what I will try during the night

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Tue Dec 09, 2014 12:27 pm

zephura wrote:MrEngman >
I fear someone answer this... "no luck for raspbmc"
Well the solution is "easy" but dirty?, compile the kernel, boot on this kernel, compile the module, use the module.
I'll try this during the night

DirkS >
I already get the sources from the subversion of svn.stmlabs.com,
in the file build_kernel-3.12.sh I find where to DL the sources (kernel 3.12.34) and the patch files

From "dodger-tools" website, the procedure i followed is the same, except 3 points:
as I give the parameter CROSS_COMPILE, the toolchain is not used (I guess)
as I did not compile the kernel, the file Module.symvers is empty
as stressed by MrEngman, as I do not have EXACTLY the same kernel sources (3.12.34) as the build kernel (3.12.31), even if compilation succeeded, the module will failed.

Conclusion : until the next Raspbmc release (never, as it was the last release before KODI)
I have to compile the kernel, install it and use it.
that's what I will try during the night
I've now managed to compile 3 different wifi drivers for raspbmc and they install without problems.
Looks like dodger-tools solve the problem. Ran through building modules for raspbmc and the drivers compiled OK and I was able to load them without problems.

Just one funny. The modinfo showed vermagic with 3.12.34. Checked the Makefile in the kernel source /usr/src/rpi-update and kernel version showed as 3.12.34. Just for fun I edited it and changed it to 3.12.31, ran throught the kernel compile again and recompiled the modules and they then showed vermagic with 3.12.31 and they still load OK.

Drivers I compiled were for TPLINK TL-WN727N, TPLINK TL-WN725N (the version I use is different to the built in one) and the driver for 8192eu.

Thanks for your pointer to dodger-tools, Dirks. Hope this helps you, zephura.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

DirkS
Posts: 10737
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Tue Dec 09, 2014 1:11 pm

MrEngman wrote:Thanks for your pointer to dodger-tools, Dirks. Hope this helps you, zephura.
Google-fu is still working then.
Must have another go at solving my own problems ;)

Gr.
Dirk.

zephura
Posts: 47
Joined: Mon Jul 15, 2013 9:53 am

Re: Compiling WIFI driver 8192eu for Realtek "0bda:818b"

Tue Dec 09, 2014 7:11 pm

A lot to say.

As an introduction : EUREKA.
Job is not over, but it works!
(I know, as expected by MrEngman, but you know what.....I'm happy)

1.a/ The new Kernel
I compile the new kernel and modules
It took 10 hours on my RPi-B under RaspBMC
Conclusion : I REALLY need to look for CROSS_COMPILATION, TOOLCHAINS and all the existing tools
1.b/ I prepare the installation of the new Kernel and after reboot I see a beautiful

Code: Select all

# uname -a
Linux raspbmc 3.12.34 #1 PREEMPT Tue Dec 9 09:00:22 CET 2014 armv6l GNU/Linux
2/The 8192eu driver
2.1/ "rtl8192EU_linux_v4.2.2_7585.20130524"
It compiles, It manually loads, It install, It loads after reboot, It seems to works.

the very bad news it pollutes /var/log/messages (maybe because I did not configure the wlan0 interface.....)
conclusion, I need to check the parameters to disable verbose/debug options

2.2/ "rtl8192EU_linux_v4.3.1.1_11320.20140505"
It compiles, It DOES NOT load : neither a freeze, nor a kernel panic, but some kind of hang

Code: Select all

 kernel:Internal error: Oops: 17 [#1] PREEMPT ARM
 kernel:Process NetworkManager (pid: 513, stack limit = 0xd454a1b8)
 kernel:Stack: (0xd454ba58 to 0xd454c000)
etc...
Need to unplug power.....
conclusion : I will use the working module ;)

3/ Next for me :
found the parameters to tweak the module loading
configure interfaces, hostapd, iptables (to enable my raspbmc as a WIFI spot)
resume my notes/howto to give the command lines I use (for others, and for me in the future)

Finally thanks for all, for the links
And THE solution for this kind of problem is : GETTING THE EXACT SOURCES OF THE KERNEL
I did not succeeded to found thoses 3.4.31 sources

dp2313265939
Posts: 21
Joined: Wed Mar 11, 2015 4:09 am

Re: [Solved]Compiling WIFI driver 8192eu for Realtek "0bda:8

Mon Mar 16, 2015 3:33 am

Hey guys,

I'm having the same problem but I've got a newer version, the pi2. Would you mind having a look at my post and helping me out please?

http://www.raspberrypi.org/forums/viewt ... 85#p719785

Thanks!

Return to “Troubleshooting”