WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Advice to compile Realtek 8188eu WiFi driver  (Read 13520 times)

Offline mcdudeabides

  • Jr. Member
  • **
  • Posts: 60
Advice to compile Realtek 8188eu WiFi driver
« on: November 02, 2013, 09:43:47 AM »
I am very early in my journey to learn more about TCL.  I have enjoyed learning and using the RPi for many embedded applications and TCL is very compelling in pursuit of that hobby.  I would like to improve my knowledge by attempting to compile the driver and make an extension for the Realtek 8188eu chip.  The source is available and has successfully been compiled for Raspbian 3.5.11+.  As this is a driver (not a firmware load), it will require the source compile against the kernel.  I would like to try this in the TCL environment.  So any help, advice or examples that the community can share would be most appreciated. 

Here is a rough outline of the approach I want to try:

1) Start with a fresh install of piCore5 alpha 6.
2) Make changes persistent
3) Load compile-essentials
4) Add ext4 for work area
5) Download source from https://github.com/lwfinger/rtl8188eu
6) Run makefile
7) Package a .tcz

I think I can tackle 1-3.  I haven't tried 4 yet, but assume mkfs.ext4 to start and mount to /tmp2 as a work area.  5 should be a simple wget.  If things are like Raspbian, then 6 should be "make Makefile".  7 will take some research, I have no idea on approach.

Hopefully I will have gained some education and have a working 8188eu driver to contribute at the end of this adventure.  I would appreciate any advice, examples or reference before I dive in.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #1 on: November 02, 2013, 10:10:26 AM »
Hi,

4) correct

5) with wget use https://github.com/lwfinger/rtl8188eu/archive/master.zip or git clone otherwise

6) yes, expecting all necessary prerequisits installad

7) See WiKi article http://wiki.tinycorelinux.net/wiki:creating_extensions
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline mcdudeabides

  • Jr. Member
  • **
  • Posts: 60
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #2 on: November 02, 2013, 12:36:56 PM »
Bmarkus - thanks once again for your active support and continued advice. I think I will approach this in simplest terms leaving behind breadcrumbs for each step.

But given the beautiful day that exists here in Texas, I think a little outdoor football time is in order before beginning:-)

Offline mcdudeabides

  • Jr. Member
  • **
  • Posts: 60
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #3 on: November 03, 2013, 11:03:05 AM »
Well, that was a very humbling experience. 

Where I stand so far:
Created a clean system using Steen's approach from here:

Burn the Picore image to a CF card ( I use Win32Diskimager)

Then boot the Raspberry.

As Picore is running in read only mode om a partition called mmcblk0p1 you need to make another partition where it can have all the configuration files and the extensions and the Squeezelite player.
In order to make such a partition I did this (It was here I had the most difficulties) Each line is the commands I used:

fdisk /dev/mmcblk0
n new
p primary
2 partition number 1-4
6 first cylinder
+20M I made a 20 MB partition for this - you could choose any size you want (up to the CF-card size)
t change partition Id
83 linux file system
w to write the changes to the card

sudo reboot


Next I formated it to the ext4 format:
mkfs.ext4 /dev/mmcblk0p2

sudo reboot


Then you need to define where Picore will find your extensions, you do that by this command:
tce-setdrive

And then you choose 2= /mnt/mmcblk0p2

From this point I diverted and loaded compile-essentials to prepare to make the driver.
At this point, my reach well exceeded my grasp.

I created a src subdirectory under HOME to use as the base.

I loaded git (git.tcz only) to attempt to clone the rtl8188eu repository.  First git failed with missing libcrypto.  Then loaded lftp and git was able to function as expected.
Code: [Select]
tc@box:~/src$ git clone git://github.com/lwfinger/rtl8188eu
I saw the Makefile in /rtl8188eu and thought I would be having dessert early today.  Not to be.  First pass complained that the build directory did not exist.  I created /lib/modules/3.11.6-piCore+/build in hopes this would do the trick.
Code: [Select]
tc@box:~/src$ cd rtl8188eu
tc@box:~/src/rtl8188eu$ make -f Makefile
make ARCH=arm CROSS_COMPILE= -C /lib/modules/3.11.6-piCore+/build M=/home/tc/src                                                                                                 /rtl8188eu  modules
make[1]: *** /lib/modules/3.11.6-piCore+/build: No such file or directory.  Stop                                                                                                 .
Makefile:146: recipe for target 'modules' failed
make: *** [modules] Error 2
tc@box:~/src/rtl8188eu$ sudo mkdir /lib/modules/3.11.6-piCore+/build
tc@box:~/src/rtl8188eu$ sudo chmod 777 /lib/modules/3.11.6-piCore+/build
tc@box:~/src/rtl8188eu$ make -f Makefile
make ARCH=arm CROSS_COMPILE= -C /lib/modules/3.11.6-piCore+/build M=/home/tc/src/rtl8188eu  modules
make[1]: Entering directory '/lib/modules/3.11.6-piCore+/build'
make[1]: *** No rule to make target 'modules'.  Stop.
make[1]: Leaving directory '/lib/modules/3.11.6-piCore+/build'
Makefile:146: recipe for target 'modules' failed
make: *** [modules] Error 2
So to me, looks like it is changing to /build directory, using the makefile from src/rtl8188eu directory, but I don't understand the "modules" directive.

I understand this is academic for me.  If the more advanced members could possible point me in the direction of where I could continue my education, I would be most appreciative.

Also, it appears that Larry, the author of this driver, is targeting inclusion in the 3.12 core.  While my education is important, it's beginning to look as if the path of least resistance to the solution may be in waiting for 3.12.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #4 on: November 03, 2013, 11:19:54 AM »
Kernel is freezed to 3.11.6 for piCore 5.0, 3.12.x is several month ahead, so better to build it now. Or swap WIFi stick to a currently supported.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Gerrelt

  • Full Member
  • ***
  • Posts: 182
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #5 on: November 03, 2013, 11:28:16 AM »
@mcdudeabides: I think you need the kernel source files in that "build" directory. Or at least the kernel header files (the .h files, I believe).
my Raspberry Pi page: http://raspberry.gerrelt.nl

Offline mcdudeabides

  • Jr. Member
  • **
  • Posts: 60
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #6 on: November 03, 2013, 12:33:42 PM »

Kernel is freezed to 3.11.6 for piCore 5.0, 3.12.x is several month ahead, so better to build it now. Or swap WIFi stick to a currently supported.
Thanks and understood. I do have several other workable WiFi sticks, so for my personal application all is good. However I noticed a number of people trying to use WM725 v2 nano adapter. I thought I might gain some education and contribute something back.

Offline mcdudeabides

  • Jr. Member
  • **
  • Posts: 60
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #7 on: November 03, 2013, 12:34:35 PM »
@gerrelt - thanks much. Will try this later tonight.

Offline mcdudeabides

  • Jr. Member
  • **
  • Posts: 60
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #8 on: November 03, 2013, 02:36:51 PM »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #9 on: November 03, 2013, 02:53:57 PM »
@gerrelt - Is this the correct source file?

http://distro.ibiblio.org/tinycorelinux/4.x/armv6/src/piCoreKernel.tar.xz

No, it is for 4.x I will add kernel headers in next 1-2 days
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline mcdudeabides

  • Jr. Member
  • **
  • Posts: 60
Re: Advice to compile Realtek 8188eu WiFi driver
« Reply #10 on: November 03, 2013, 03:08:12 PM »
Thanks. Certainly no rush on this. Primarily for my education.