WDTV Forum - WDTV Media Player

WDTV 1 Forum Groups => Homebrew / Custom Firmware => Topic started by: hnadov2k9 on June 24, 2009, 12:47:47 PM

Title: [howto] compile your own wireless
Post by: hnadov2k9 on June 24, 2009, 12:47:47 PM
I want to compiled my own wireless module but there isn't a detailed how to in one place for newbie like me. After reading posts from many places I was be able to compiled a workable module . I took some notes and share it here in hope that it will help someone. In this how to I will compile the rt2870sta.ko for my dlink dwa-140. Thanks Zorander, smartP and all other developers.

You need a linux box or a vmware image (http://wdtvforum.com/main/index.php?topic=1157.0)

1) Setting up compiling environment
followed from this wiki (http://wiki.wdtv.org/doku.php?id=setting_up_the_environment_for_compiling)

# create wdtv directory
wdtv@localhost ~ $ mkdir ~/wdtv && cd ~/wdtv

# download WD TV GPL Code (http://support.wdc.com/product/download.asp?groupid=1001&sid=112&lang=en)
# unzip WDTV_GPL_Code.zip

wdtv@localhost ~/wdtv $ unzip WDTV_GPL_Code.zip

# extract GPL.tgz
wdtv@localhost ~/wdtv $ tar zxf GPL.tgz

# extract TVDOCK_GPL_code_package.2008.9.25.tar
wdtv@localhost ~/wdtv $ tar xf TVDOCK_GPL_code_package.2008.9.25.tar

# set compiling environment
wdtv@localhost ~/wdtv $ cd GPL/smp86xx_toolchain_2.8.2.0/
wdtv@localhost ~/wdtv/GPL/smp86xx_toolchain_2.8.2.0 $ pwd -P
/home/wdtv/wdtv/GPL/smp86xx_toolchain_2.8.2.0


# create a mips.env file
wdtv@localhost ~/wdtv/GPL/smp86xx_toolchain_2.8.2.0 $ nano -w mips.env
# with the content
PATH=/home/wdtv/wdtv/GPL/smp86xx_toolchain_2.8.2.0/bin:$PATH
export PATH

ARCH=mips
CROSS_TOOL=mipsel-linux-
export ARCH CROSS_TOOL

# then check
wdtv@localhost ~/wdtv/GPL/smp86xx_toolchain_2.8.2.0 $ cat mips.env
PATH=/home/wdtv/wdtv/GPL/smp86xx_toolchain_2.8.2.0/bin:$PATH
export PATH

ARCH=mips
CROSS_TOOL=mipsel-linux-
export ARCH CROSS_TOOL

wdtv@localhost ~/wdtv/GPL/smp86xx_toolchain_2.8.2.0 $ source mips.env
wdtv@localhost ~/wdtv/GPL/smp86xx_toolchain_2.8.2.0 $ echo -e $PATH"\n"$ARCH"\n"$CROSS_TOOL
/home/wdtv/wdtv/GPL/smp86xx_toolchain_2.8.2.0/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.3.2:/usr/kde/3.5/bin:/usr/games/bin
mips
mipsel-linux-


2) compile kernel source

# extract kernel source
wdtv@localhost ~/wdtv/GPL/smp86xx_toolchain_2.8.2.0 $ cd ~/wdtv/TVDOCK_GPL_code_package.2008.9.25/
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25 $ tar zxf linux_kernel_2.6.15.tar.gz
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25 $ cd linux_kernel_2.6.15

# download Zorander's linux-kernel.config (http://www.mediafire.com/?sharekey=6d110a20e6fb482361d4646c62b381cbc4336473503891bb5621d66e282a0ee8)
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15 $ cp linux-kernel.config .config
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15 $ make oldconfig
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15 $ make

3) compile wireless module

# get ralink source
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15 $ cd ~/wdtv
wdtv@localhost ~/wdtv $ wget http://www.ralinktech.com.tw/data/drivers/2009_0521_RT2870_Linux_STA_V2.1.2.0.tgz
wdtv@localhost ~/wdtv $ tar zxf 2009_0521_RT2870_Linux_STA_V2.1.2.0.tgz
wdtv@localhost ~/wdtv $ cd 2009_0521_RT2870_Linux_STA_V2.1.2.0

# edit Makefile . My diff:
wdtv@localhost ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0 $ diff -uNbB Makefile.orig Makefile
--- Makefile.orig       2009-06-23 22:15:38.000000000 -0700
+++ Makefile    2009-06-23 22:20:58.000000000 -0700
@@ -8,9 +8,9 @@
 RTMP_SRC_DIR = $(RT28xx_DIR)/RT$(CHIPSET)

 #PLATFORM: Target platform
-PLATFORM = PC
+#PLATFORM = PC
 #PLATFORM = 5VT
-#PLATFORM = SIGMA
+PLATFORM = SIGMA
 #PLATFORM = SIGMA_8622
 #PLATFORM = INIC
 #PLATFORM = STAR
@@ -29,8 +29,8 @@
 endif

 ifeq ($(PLATFORM),SIGMA)
-LINUX_SRC = /root/sigma/smp86xx_kernel_source_2.7.172.0/linux-2.6.15
-CROSS_COMPILE = /root/sigma/smp86xx_toolchain_2.7.172.0/build_mipsel_nofpu/staging_dir/bin/mipsel-linux-
+LINUX_SRC = /home/wdtv/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15
+CROSS_COMPILE = /home/wdtv/wdtv/GPL/smp86xx_toolchain_2.8.2.0/bin/mipsel-linux-
 endif

 ifeq ($(PLATFORM),SIGMA_8622)
@@ -141,7 +141,7 @@
 else
        cp -f os/linux/Makefile.6 $(RT28xx_DIR)/os/linux/Makefile
        make  -C  $(LINUX_SRC) SUBDIRS=$(RT28xx_DIR)/os/linux modules
-       cp -f $(RT28xx_DIR)/os/linux/rt$(CHIPSET)sta.ko /tftpboot
+       #cp -f $(RT28xx_DIR)/os/linux/rt$(CHIPSET)sta.ko /tftpboot
 endif

 clean:

# edit os/linux/config.mk
wdtv@localhost ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0 $ diff -uNbB os/linux/config.mk.orig os/linux/config.mk
--- os/linux/config.mk.orig     2009-06-23 22:28:40.000000000 -0700
+++ os/linux/config.mk  2009-06-23 22:29:00.000000000 -0700
@@ -6,7 +6,7 @@

 #ifdef WPA_SUPPLICANT_SUPPORT
 # Support Wpa_Supplicant
-HAS_WPA_SUPPLICANT=n
+HAS_WPA_SUPPLICANT=y
 #endif // WPA_SUPPLICANT_SUPPORT //

 #ifdef NATIVE_WPA_SUPPLICANT_SUPPORT

# edit os/linux/Makefile.6 and include/os/rt_linux.h to load RT2870STA.dat from /etc/ instead of /etc/Wireless/RT2870STA/
wdtv@localhost ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0 $ diff -uNbB os/linux/Makefile.6.orig os/linux/Makefile.6
--- os/linux/Makefile.6.orig    2009-06-23 22:32:10.000000000 -0700
+++ os/linux/Makefile.6 2009-06-23 22:32:31.000000000 -0700
@@ -1,7 +1,7 @@
 include $(RT28xx_DIR)/os/linux/config.mk

 MOD_NAME = rt$(CHIPSET)sta
-DAT_PATH = /etc/Wireless/RT$(CHIPSET)STA
+DAT_PATH = /etc/RT$(CHIPSET)STA
 DAT_FILE_NAME = RT$(CHIPSET)STA.dat

 obj-m := $(MOD_NAME).o

wdtv@localhost ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0 $ diff -uNbB include/os/rt_linux.h.orig include/os/rt_linux.h
--- include/os/rt_linux.h.orig  2009-06-23 22:36:56.000000000 -0700
+++ include/os/rt_linux.h       2009-06-23 22:37:46.000000000 -0700
@@ -101,10 +101,10 @@
 #ifdef CONFIG_STA_SUPPORT

 #ifdef RTMP_MAC_USB
-#define STA_PROFILE_PATH                       "/etc/Wireless/RT2870STA/RT2870STA.dat"
+#define STA_PROFILE_PATH                       "/etc/RT2870STA.dat"
 #define STA_DRIVER_VERSION                     "2.1.2.0"
 #ifdef MULTIPLE_CARD_SUPPORT
-#define CARD_INFO_PATH                 "/etc/Wireless/RT2870STA/RT2870STACard.dat"
+#define CARD_INFO_PATH                 "/etc/RT2870STACard.dat"
 #endif // MULTIPLE_CARD_SUPPORT //
 #endif // RTMP_MAC_USB //

4) Create app.bin

# move back to wdtv work directory .
wdtv@localhost ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0 $ cd ~/wdtv

# download smartP's wireless-mod-rt.app.bin (http://www.mediafire.com/file/mtnu1mmmwkt/wireless-mod-rt.app.bin-1.1.zip)
wdtv@localhost ~/wdtv $ unzip wireless-mod-rt.app.bin-1.1.zip

# create a mount point for the app.bin
wdtv@localhost ~/wdtv $ sudo mkdir -p /mnt/orig.app.bin
wdtv@localhost ~/wdtv $ sudo mount -o loop wireless-mod-rt.app.bin /mnt/orig.app.bin
wdtv@localhost ~/wdtv $ ls /mnt/orig.app.bin/
bin  etc  firmware  lib  modules


# create a directory for your new app.bin and copy SmartP's app.bin over.
wdtv@localhost ~/wdtv $ mkdir wireless-mod-rt2870
wdtv@localhost ~/wdtv $ cp -r /mnt/orig.app.bin/* wireless-mod-rt2870/

# rt2870 does not need firmware . We can delete them .
wdtv@localhost ~/wdtv $ rm -rf wireless-mod-rt2870/firmware/

# remove other modules we don't need .
wdtv@localhost ~/wdtv $ rm wireless-mod-rt2870/modules/rt*.ko

# and we are left with:
wdtv@localhost ~/wdtv $ ls -R wireless-mod-rt2870/*
bin:
iwconfig

wireless-mod-rt2870/etc:
hotplug  init.d  mdev.conf

wireless-mod-rt2870/etc/hotplug:
wlan-rt.agent

wireless-mod-rt2870/etc/init.d:
S20wlanmodules

wireless-mod-rt2870/lib:
libiw.so.28

wireless-mod-rt2870/modules:
wireless-ext.ko

# copy our compiled module over
wdtv@localhost ~/wdtv $ cp ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0/os/linux/rt2870sta.ko wireless-mod-rt2870/modules/

# check our app.bin size
wdtv@localhost ~/wdtv $ du -sh wireless-mod-rt2870
961K    wireless-mod-rt2870

# create an app.bin file; make filesystem; mount
wdtv@localhost ~/wdtv $ dd if=/dev/zero of=wireless-mod-rt2870.app.bin bs=1024 count=1k
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.0155911 s, 67.3 MB/s

wdtv@localhost ~/wdtv $ /sbin/mkfs.ext2 wireless-mod-rt2870.app.bin
mke2fs 1.41.3 (12-Oct-2008)
wireless-mod-rt2870.app.bin is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
Maximum filesystem blocks=1048576
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

wdtv@localhost ~/wdtv $ sudo mkdir -p /mnt/new.app.bin
wdtv@localhost ~/wdtv $ sudo mount -o loop wireless-mod-rt2870.app.bin /mnt/new.app.bin/

# remove lost+found
wdtv@localhost ~/wdtv $ sudo rm -rf /mnt/new.app.bin/lost+found/

# copy content of wireless-mod-rt2870 over.
wdtv@localhost ~/wdtv $ cp -r wireless-mod-rt2870/* /mnt/new.app.bin/

# if you get the error No space left on device then you need to create a bigger app.bin file (eg dd if=/dev/zero of=wireless-mod-rt2870.app.bin bs=1024 count=2k)

# umount new.app.bin
wdtv@localhost ~/wdtv $ sudo umount /mnt/new.app.bin/

# mount the new app.bin again to check
wdtv@localhost ~/wdtv $ sudo mount -o loop wireless-mod-rt2870.app.bin /mnt/new.app.bin/
wdtv@localhost ~/wdtv $ ls -R /mnt/new.app.bin/*
/mnt/new.app.bin/bin:
iwconfig

/mnt/new.app.bin/etc:
hotplug  init.d  mdev.conf

/mnt/new.app.bin/etc/hotplug:
wlan-rt.agent

/mnt/new.app.bin/etc/init.d:
S20wlanmodules

/mnt/new.app.bin/lib:
libiw.so.28

/mnt/new.app.bin/modules:
rt2870sta.ko  wireless-ext.ko


# unmount the new app.bin
wdtv@localhost ~/wdtv $ sudo umount /mnt/new.app.bin/

# your wireless-mod-rt2870.app.bin is ready .
Title: Re: [howto] compile your own wireless
Post by: 3dxr on June 26, 2009, 01:54:30 PM
this is nice and simple how-to
good job man
Title: Re: [howto] compile your own wireless
Post by: nabster on June 30, 2009, 09:51:16 AM
what about rt73 devices?
Title: Re: [howto] compile your own wireless
Post by: hnadov2k9 on June 30, 2009, 10:34:48 AM
what about rt73 devices?

1) get driver source for rt73 http://www.ralinktech.com.tw/data/drivers/2009_0206_RT73_Linux_STA_Drv1.1.0.2.tar.bz2
2) edit Module/Makefile and Module/rt_config.h to match the diff below.
wdtv@localhost ~/wdtv/2009_0206_RT73_Linux_STA_Drv1.1.0.2/Module $ diff -uNbB Makefile.org Makefile
--- Makefile.org        2008-12-18 07:01:34.000000000 -0800
+++ Makefile    2009-06-30 11:23:59.000000000 -0700
@@ -2,7 +2,8 @@
 #      Module Name: Makefile
 #      Abstract: Makefile for rt73 linux driver on kernel series 2.6
 ######################################################################
-PLATFORM=PC
+PLATFORM=WDTV
+#PLATFORM=PC
 #PLATFORM=CMPC

 #Enable for wpa_supplicant's spcific driver "driver_ralink.c", default enabled.
@@ -40,6 +41,9 @@
 ifeq ($(PLATFORM),CMPC)
 LINUX_SRC = /home/fonchi/vendor/kernel-default-2.6.21/linux-2.6.21
 endif
+ifeq ($(PLATFORM),WDTV)
+LINUX_SRC = /home/wdtv/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15
+endif

 EXTRA_CFLAGS += -I$(LINUX_SRC)/include

wdtv@localhost ~/wdtv/2009_0206_RT73_Linux_STA_Drv1.1.0.2/Module $ diff -uNbB rt_config.h.orig rt_config.h
--- rt_config.h.orig    2009-06-30 11:20:30.000000000 -0700
+++ rt_config.h 2009-06-30 11:24:27.000000000 -0700
@@ -38,9 +38,9 @@
 #ifndef        __RT_CONFIG_H__
 #define        __RT_CONFIG_H__

-#define PROFILE_PATH                "/etc/Wireless/RT73STA/rt73sta.dat"
+#define PROFILE_PATH                "/etc/rt73sta.dat"
 #define NIC_DEVICE_NAME             "RT73STA"
-#define RT2573_IMAGE_FILE_NAME      "/etc/Wireless/RT73STA/rt73.bin"
+#define RT2573_IMAGE_FILE_NAME      "/etc/rt73.bin"
 #define RALINK_PASSPHRASE           "Ralink"
 #define DRIVER_VERSION                         "1.1.0.0"


3) At step 4 , create the app.bin , DO NOT delete the "firmware" directory but copy rt73.bin over and overwrite the old one to be sure. the module name for rt73 is rt73.ko .
Title: Re: [howto] compile your own wireless
Post by: nabster on June 30, 2009, 12:36:39 PM
awesome, thanks for the fast response. ill try this tomorrow
Title: Re: [howto] compile your own wireless
Post by: speedie70 on July 07, 2009, 02:30:52 AM
couple of questions if I can..

first off I'm a real noob to most things Linux but learning from my mistakes..  (many of them to come I imagine) ..

I thought I'd try this to see if I could at least get all the way through without any dramas..  but I've run into what I think is a problem

here # download Zorander's linux-kernel.config
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15 $ cp linux-kernel.config .config
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15 $ make oldconfig
wdtv@localhost ~/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15 $ make

after make I get the following which I assume is an error..

/bin/sh: mipsel-linux-gcc: not found
make: mipsel-linux-gcc: Command not found
  CHK     include/linux/version.h
  CC      arch/mips/kernel/asm-offsets.s
/bin/sh: mipsel-linux-gcc: not found
make[1]: *** [arch/mips/kernel/asm-offsets.s] Error 127
make: *** [prepare0] Error 2


any ideas on where I'm going wrong and once I get past this stage any tips on trying to compile for the RTL8187b chipset

thanks


Title: Re: [howto] compile your own wireless
Post by: hnadov2k9 on July 07, 2009, 06:11:16 AM
make sure you source the envirement file mips.env and $PATH is point to the correct place PATH=/home/wdtv/wdtv/GPL/smp86xx_toolchain_2.8.2.0/bin:$PATH in my setup)
read the ReadMe file that comes with the driver source for more instruction. And I don't think SmartP's script will work with that chipset . You might want to try to add this module to Zorander or b-rad.cc wireless app.bin package.
Title: Re: [howto] compile your own wireless
Post by: nabster on July 10, 2009, 11:53:39 AM
thx for the help, everything compiled right but still same known issue with my dlink dwl-g122 with rt73 :-(
Title: Re: [howto] compile your own wireless
Post by: Monkeyface66 on July 13, 2009, 01:05:49 PM
Can someone please help me out?

I'm stuck at the "diff -uNbB ....." thing because my drivers are different, too!


Here's the download:
http://www.mediafire.com/download.php?zxgmyniz2hd

RTL8191SU chipset.


Help please!  :)
Title: Re: [howto] compile your own wireless
Post by: hnadov2k9 on July 14, 2009, 10:08:25 AM
you have to follow the instructions in the readme file to compile this driver. my example is only applied to the driver source for the rt73 chipset .
Title: Re: [howto] compile your own wireless
Post by: hnadov2k9 on July 14, 2009, 01:24:39 PM
these are steps to compile rtl8192su module.
extract driver source. assumed kernel source is located at  "/home/wdtv/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15" (in my example)
Code: [Select]
sed -i "s|KSRC =.*|KSRC = /home/wdtv/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15|g;" rtl8192su_linux_2.6.0002.0708.2009/Makefile
sed -i "s|CC =.*|CC = mipsel-linux-gcc|g;" rtl8192su_linux_2.6.0002.0708.2009/HAL/rtl8192u/Makefile
cd rtl8192su_linux_2.6.0002.0708.2009 && make
get Zorander's wireless app.bin; mount it; copy content over to your app.bin directory; modify S20wireless; copy firmware; create cramfs app.bin; umount wireless-mod.app.bin
Code: [Select]
sudo mount sudo mount -o loop wireless-mod.app.bin /path/to/mount/point
mkdir mywireless.app.bin
cp -r /path/to/mount/point/* mywireless.app.bin/
echo "insmod \$APATH/modules/r8192s_usb.ko" >> mywireless.app.bin/etc/init.d/S20wireless
cp firmware/RTL8192SU/rtl8192sfw.bin mywireless.app.bin/firmware/
sudo umount /path/to/mount/point/
/sbin/mkcramfs mywireless.app.bin wireless-rtl8192su.app.bin
Title: Re: [howto] compile your own wireless
Post by: mike2k8 on July 18, 2009, 02:47:02 AM
Thanks for the guide,

I have a suggestion. I have downloaded the wdtvtools ready to compile VMware image (http://sourceforge.net/project/shownotes.php?group_id=261153&release_id=690522) (I am using it with VirtualBox on windows and it works perfect). (Thanks elmar_weber) :)
This is a debian linux box, ready to compile for the wdtv, so this avoids starting from scratch, and it should be much easier to use for people without a linux box or without a lot of linux knowledge (like me).

I know it's much to ask, but would it be possible to review this guide defining which steps are not necessary with the wdtvtools image, and which ones would need to be modified to work on that?

I think it would be ideal to have the same system for everyone to develop, as it would be much easier to write (and follow) guides and howtos. Also, as the wdtvtools is a sourceforge oss project, anybody can contribute with modifications or improvements if he feels they are needed.
Title: Re: [howto] compile your own wireless
Post by: mike2k8 on July 21, 2009, 10:49:55 AM
Hello again,

I'm trying to obtain the latest drivers I am able for the ralink rt73. As the new drivers from rt2x00 project are for newer kernels, I'm trying to compile the final version of legacy rt73 module from rt2x00 project (it is no longer developed)

http://sourceforge.net/projects/rt2400/files/Final%20software%20release/rt73-cvs-daily.tar.gz/download (http://rt73-legacy-final-cvs)
I think this is a more updated version than the one from ralink. It seems that it doesn't rely on .dat file for configuration (deprecated), and uses standard tools like iwconfig/iwpriv instead. It can be used a patched wpasupplicant too.

Unfortunately, this is the first module I'm trying to compile, and I need some help.

When I decompress and untar, I find in the README file, the following build instructions:
Quote
==================
Build Instructions
==================

    1. Unpack the driver sources and go to the Module directory:
          $ tar -xvzf rt73-cvs-daily.tar.gz
          $ cd ./rt73-cvs-YYYYMMDDHH/Module

    2. Compile the driver sources:
          $ make

    3. Install the driver (as root):
          # make install
Obviously, I suppose that there is something I must do prior to make (Modifying the Module/Makefile and Module/rt_config.h)
The problem is that they seem to be different than the ones in your diff, and I'm not sure if it would work.

Let me ask you a newbie question here. How can I use a diff? From what I have googled, I must use 'patch', but how? Should I have two text files (The original one and the diff) and when I patch I overwrite the original one?

Title: Re: [howto] compile your own wireless
Post by: hnadov2k9 on July 22, 2009, 10:07:06 AM
...
Let me ask you a newbie question here. How can I use a diff? From what I have googled, I must use 'patch', but how? Should I have two text files (The original one and the diff) and when I patch I overwrite the original one?


the diff in my example is just to give you an idea what have been changed when I ran `diff -ubB original_file modifed_file`
Title: Re: [howto] compile your own wireless
Post by: TON on July 22, 2009, 11:27:50 PM
Let me ask you a newbie question here. How can I use a diff? From what I have googled, I must use 'patch', but how? Should I have two text files (The original one and the diff) and when I patch I overwrite the original one?

I have already tried to build this driver. I do not remember any significant changes to the sources to be required. Update the makefie to set your paths to kernel sources and then just try running make right away and look at the output. I was not able to find the location it loads the firmware from. I tried both /etc/firmware and /lib/firmware. Probably you should place the firmware together with the driver.

Please leave a message if you succeed and obtain a stable working driver. By 'stable' I mean work under heavy load for more than a day at least.
Title: Re: [howto] compile your own wireless
Post by: mike2k8 on July 24, 2009, 11:04:22 AM
I have already tried to build this driver. I do not remember any significant changes to the sources to be required. Update the makefie to set your paths to kernel sources and then just try running make right away and look at the output. I was not able to find the location it loads the firmware from. I tried both /etc/firmware and /lib/firmware. Probably you should place the firmware together with the driver.

No luck. It seems that it's correctly built, but the firmware is not loaded.
I have tried every place. I have read in the README that in some linux versions it could be needed to put in /lib/firmware/2.6.15/
It doesn't work either.
Here is what I get in messages.txt
Code: [Select]
Jan  1 00:00:49 wdtv user.info kernel: rt73: init
Jan  1 00:00:49 wdtv user.info kernel: rt73: idVendor = 0x13b1, idProduct = 0x20
Jan  1 00:00:59 wdtv user.err kernel: rt73: Failed to request_firmware. Check your firmware file location
Jan  1 00:00:59 wdtv user.crit kernel: rt73: Failed to load Firmware.
Jan  1 00:00:59 wdtv user.warn kernel: rt73: probe of 1-2:1.0 failed with error -2
Jan  1 00:01:00 wdtv user.info kernel: usbcore: registered new driver rt73
Jan  1 00:01:04 wdtv user.warn kernel: Unhandled kernel unaligned access[#1]:
Jan  1 00:01:04 wdtv user.warn kernel: Cpu 0
Jan  1 00:01:04 wdtv user.warn kernel: $ 0   : 00000000 00000000 90296654 00000000
Jan  1 00:01:04 wdtv user.warn kernel: $ 4   : 75646f6d 7ff7aa98 00001fe0 7ff7aa98
Jan  1 00:01:04 wdtv user.warn kernel: $ 8   : 00000001 00000000 00000000 00000000
Jan  1 00:01:04 wdtv user.warn kernel: $12   : 00000002 9497bdf4 00000000 0100007f
Jan  1 00:01:04 wdtv user.warn kernel: $16   : 9036b220 75646f6d 7ff7aa78 00000020
Jan  1 00:01:04 wdtv user.warn kernel: $20   : 00002000 9036b298 90310000 7ff7aa70
Jan  1 00:01:04 wdtv user.warn kernel: $24   : 00000000 90298768                 
Jan  1 00:01:04 wdtv user.warn kernel: $28   : 9497a000 9497bd98 7ff7aa78 90246098
Jan  1 00:01:04 wdtv user.warn kernel: Hi    : 00000000
Jan  1 00:01:04 wdtv user.warn kernel: Lo    : 431bde83
Jan  1 00:01:04 wdtv user.warn kernel: epc   : 90296670     Tainted: PF   
Jan  1 00:01:04 wdtv user.warn kernel: ra    : 90246098 Status: 10001c03    KERNEL EXL IE
Jan  1 00:01:04 wdtv user.warn kernel: Cause : 50808010
Jan  1 00:01:04 wdtv user.warn kernel: BadVA : 75647015
Jan  1 00:01:04 wdtv user.warn kernel: PrId  : 00019069
Jan  1 00:01:04 wdtv user.warn kernel: Modules linked in: nls_koi8_u nls_koi8_r nls_iso8859_9 nls_iso8859_7 nls_iso8859_6 nls_iso8859_5 nls_iso8859_4 nls_iso8859_3 nls_iso8859_2 nls_iso8859_15 nls_iso8859_14 nls_iso8859_13 nls_euc_jp nls_cp950 nls_cp949 nls_cp936 nl
Jan  1 00:01:04 wdtv user.warn kernel: Process nmbd (pid: 847, threadinfo=9497a000, task=96e0f030)
Jan  1 00:01:04 wdtv user.warn kernel: Stack : 0000002a 00000101 00000000 00000000 00006f6c 00000000 00000000 00000000
Jan  1 00:01:04 wdtv user.warn kernel:         00000002 0100007f 00000000 00000000 9036b220 75646f6d 7ff7aa78 00000020
Jan  1 00:01:04 wdtv user.warn kernel:         00002000 90246098 00000001 96b5c934 900b3898 9497bf18 00002000 7ff7aa78
Jan  1 00:01:04 wdtv user.warn kernel:         00006f6c 00000000 00000000 00001000 55733330 00000000 9497be50 55733330
Jan  1 00:01:04 wdtv user.warn kernel:         00001000 9497bf18 00000194 00000194 2acb042c 2acb0290 00008912 7ff7aa70
Jan  1 00:01:04 wdtv user.warn kernel:         ...
Jan  1 00:01:04 wdtv user.warn kernel: Call Trace: [<90246098>]  [<900b3898>]  [<c4036044>]  [<900be3f0>]  [<9019da8c>]  [<9009a5d0>]  [<900b7bf0>]  [<90237334>]  [<90235ed4>]  [<90235d40>]  [<900b7cf8>]  [<900b80d4>]  [<900b80b0>]  [<902376d4>]  [<9002f8a0>]  [<900
Jan  1 00:01:04 wdtv user.warn kernel:
Jan  1 00:01:04 wdtv user.warn kernel: Code: afb40040  afb3003c  afb10034 <8c8300a8> 00a08021  10600032  00c09021  8c71000c  1220002f
Title: Re: [howto] compile your own wireless
Post by: hnadov2k9 on July 24, 2009, 11:14:49 AM
assumed you use SmartP app.bin, the firmware will copy from firmware/ to the right location by a script... IIRC

BTW, I tested rt73 compiled from ralink source for my Linksys WUSB54GC . it seems stable...
Title: Re: [howto] compile your own wireless
Post by: TON on July 25, 2009, 01:59:08 AM
assumed you use SmartP app.bin, the firmware will copy from firmware/ to the right location by a script... IIRC
BTW, I tested rt73 compiled from ralink source for my Linksys WUSB54GC . it seems stable...
I believe the script copies to some standard location (like /etc/firmware, do not remeber exactly right now) but for some reason it still cannot be found ??? Probably the firmware should go together with the rt73.ko?

I am glad to hear about the stable work of at least some rt73-based dongle :D. Did you try to load it with something like torrent or streaming a film from some other location? Mine looked ok for some time (up to a day) and then just stopped.
Title: Re: [howto] compile your own wireless
Post by: mike2k8 on July 25, 2009, 08:31:20 AM
assumed you use SmartP app.bin, the firmware will copy from firmware/ to the right location by a script... IIRC

BTW, I tested rt73 compiled from ralink source for my Linksys WUSB54GC . it seems stable...

In fact, I am using zorander's app.bin.
This is what is in S20wireless
Code: [Select]
for firmfile in $APATH/firmware/* ; do
  firm=`basename $firmfile`
  ln -sf $APATH/firmware/$firm /lib/firmware/$firm
done
I have put firmware in every possible place, and it doesnt work.
This is what the rt73 sources README says:
Code: [Select]
* Firmware file (rt73.bin)

    The rt73 chipset uses a firmware file which is loaded in device
    memory using the kernel firmware_class facility. 'make install'
    copy the firmware file to the standard firmwares location:
    /lib/firmware.

    However some linux distributions divert from the standard and e.g.
    use /lib/firmware/<KERNEL_VERSION>. If this is your case, you will
    have to manually move the firmware file to the right location.
    If you have problems with firmware loading, please ask on your
    distro's support media (forum, etc).

Due to not being able to use this driver, I have gone back to zorander's compiled rt73. By the way, does anyone know which version is this?

Zorander's rt73 seems like it has no separate firmware file rt73.bin, and it doesn't use rt73.sta file for config (which was used in ralink drivers, like the ones in SmartP's app.bin, and is deprecated in the drivers I was trying to compile).
I suspect that the zorander driver is the most updated one, but I don't know it for sure.

Reading in the drivers I have been trying to compile, I have discovered that wpa_supplicant is not compatible with rt73 unless you use a patched version. As the rt73 in zorander app.bin seem to rely on wpa_supplicant for WPA authentication, I assume it has a patched version, but I then wondered if it was needed.

Well the good news is that you can discard wpa_supplicant, (which should free some resources, and could be more stable, as wpa_supplicant is not supported in first place), and rely on standard iwpriv iwconfig lines:

For example, to connect using WPA2 you can put the following lines in net.config between ifconfig and iwconfig lines.
Code: [Select]
iwpriv $MDEV set Networktype=Infra
iwpriv $MDEV set AuthMode=WPA2PSK
iwpriv $MDEV set EncryptType=AES
iwpriv $MDEV set SSID="MyEssidName"
iwpriv $MDEV set WPAPSK="my passphrase"
It works. For me it seems very stable, but as I don't leave it on for long periods, I cannot be sure.
Title: Re: [howto] compile your own wireless
Post by: TON on July 26, 2009, 09:34:07 PM
mike2k8
Great to here it is stable for you.

What do you mean you do not keep it on for a long time? Do you power your wdtv off often? I do not power mine off without the necessity to change something like adding some new app.bin.

Still try to open some video over the network from another computer and watch it. My driver could not do it for more than an hour.
Title: Re: [howto] compile your own wireless
Post by: delf on July 27, 2009, 08:38:49 AM
i would like to understand this LaCie Network Space 500GB works on win xp system becuase everything i reading is about linux       and i have this firm ware on me wdtv   1.02.10_B-RAD.CC_WDLXTV-0.5.5. all i want to do is send files via lan to my wdtv with the external harddisk plz and thanx u all great jobb here
Title: Re: [howto] compile your own wireless
Post by: delf on July 30, 2009, 05:33:41 AM
i would like to know if i can have all these bin files in the usb stick
1 opt.bin
2 ndas.app.bin
3 webserver.app.bin
4 wireless-mod-rt.app.bin
5 wdtv.bin
6 core-extras.app.bin
7 log-saver.app.bin

or will it brick the wdtv
Title: Re: [howto] compile your own wireless
Post by: smartgatto on August 04, 2009, 01:08:06 AM
Hello,
excuse for my bad english but i'm italian boy...
i never used linux, so I'm stopped here:
"# download WD TV GPL Code
# unzip WDTV_GPL_Code.zip
wdtv@localhost ~/wdtv $ unzip WDTV_GPL_Code.zip"

how can I download WDTV GPL Code and put it on the virtual disk with vmware?

thanks a lots!

Title: Re: [howto] compile your own wireless
Post by: mike2k8 on August 04, 2009, 10:44:35 AM
Hello,
excuse for my bad english but i'm italian boy...
i never used linux, so I'm stopped here:
"# download WD TV GPL Code
# unzip WDTV_GPL_Code.zip
wdtv@localhost ~/wdtv $ unzip WDTV_GPL_Code.zip"

how can I download WDTV GPL Code and put it on the virtual disk with vmware?

thanks a lots!



You download it inside VMware (or VirtualBox). The virtual machine (guest) uses the network connections of the system where it's running (host). So, you can download directly inside the virtual machine. (It will be saved inside the image)
This is the simplest way.
The command line for this is 'wget' followed by the http:// download link. For example:
wget http://somedownloadlink/file.zip
You might prefer to have a full GUI with a internet browser, instead of using command line tools (It will take some time to download and install, tough). For that, follow these steps (http://wdtvforum.com/main/index.php?topic=1157.msg11697#msg11697)
 
Another way would be to download it in your host system, and then make the folder shared for the virtual machine (you need to see the help of VMware or VirtualBOX for how to share folders).

An intermediate way would be to download in your host. Save it to an iso image with a CD writing software (or to a real CD if you want), and from the virtualization software, mount the image as a cdrom, so you can access from the guest OS and copy to some directory.
Title: Re: [howto] compile your own wireless
Post by: smartgatto on August 05, 2009, 10:08:23 AM
ok, thank you very much!
I've installed a graphic interface and a web browser, so i downloaded WDTV GPL Code, but when i will do "unzip" this file, the terminal return me:

wdtv@wdtv-devel:-$ unzip
bash: unzip: command not found

how can i install unzip?

thanks a lot!!


Title: Re: [howto] compile your own wireless
Post by: Monkeyface66 on August 05, 2009, 01:08:48 PM
how can i install unzip?

Duplicate post:
http://wdtvforum.com/main/index.php?topic=1157.msg12791#new
Title: Re: [howto] compile your own wireless
Post by: smartgatto on August 06, 2009, 05:56:40 AM
excuse me for duplicate post...

I have a problem. I'm arrived to "Create app.bin", i've downloaded smartp's wireless-mod.rt.app.bin:

wdtv@wdtv-devel:~/wdtv$ sudo mkdir -p /mnt/orig.app.binwdtv@wdtv-devel:~/wdtv$ sudo mount -o loop wireless-mod-rt.app.bin /mnt/orig.app.bin
wdtv@wdtv-devel:~/wdtv$ ls /mnt/orig.app.bin/
bin  etc  firmware  lib  modules
wdtv@wdtv-devel:~/wdtv$ mkdir wireless-mod-rt2870
wdtv@wdtv-devel:~/wdtv$ cp -r /mnt/orig.app.bin/* wireless-mod-rt2870/
wdtv@wdtv-devel:~/wdtv$ rm -rf wireless-mod-rt2870/firmware/
wdtv@wdtv-devel:~/wdtv$ rm wireless-mod-rt2870/modules/rt*.ko
wdtv@wdtv-devel:~/wdtv$ ls -R wireless-mod-rt2870/*
wireless-mod-rt2870/bin:
iwconfig

wireless-mod-rt2870/etc:
hotplug  init.d  mdev.conf

wireless-mod-rt2870/etc/hotplug:
wlan-rt.agent

wireless-mod-rt2870/etc/init.d:
S20wlanmodules

wireless-mod-rt2870/lib:
libiw.so.28

wireless-mod-rt2870/modules:
wireless-ext.ko
wdtv@wdtv-devel:~/wdtv$ cp ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0/os/linux/rt2870sta.ko wireless-mod-rt2870/modules/
cp: cannot stat `/home/wdtv/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0/os/linux/rt2870sta.ko': No such file or directory
wdtv@wdtv-devel:~/wdtv$



No such file or directory? I haven't got rt2870sta.ko file? Why?

thank you!
Title: Re: [howto] compile your own wireless
Post by: mike2k8 on August 06, 2009, 09:25:58 AM

wdtv@wdtv-devel:~/wdtv$ cp ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0/os/linux/rt2870sta.ko wireless-mod-rt2870/modules/
cp: cannot stat `/home/wdtv/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0/os/linux/rt2870sta.ko': No such file or directory
wdtv@wdtv-devel:~/wdtv$

[/color]

No such file or directory? I haven't got rt2870sta.ko file? Why?

thank you!

I suspect that you have not compiled the module.
There is a missing step in the howto, right before the 4) Create app.bin
This step is the most important one. It's where you build the .ko module. (I suppose that for the author of the post is evident and that's why he has omited it).

You should follow the instructions in the README file, in this case you have to do:

Code: [Select]
cd ~/wdtv/2009_0521_RT2870_Linux_STA_V2.1.2.0
make

Wait some time to complete the process and then, if everything goes well, this should create the rt2870sta.ko file, and you can continue where you left.
Title: Re: [howto] compile your own wireless
Post by: daskino on October 29, 2009, 10:07:15 AM
Can someone please help me out?

I'm stuck at the "diff -uNbB ....." thing because my drivers are different, too!


Here's the download:
http://www.mediafire.com/download.php?zxgmyniz2hd

RTL8191SU chipset.


Help please!  :)


Hey Monkey did you work out to create the driver for RTL8191S(U) ?  I myself have a xtreamer wifi adatper i would like to use on the wdtv, In the startup file it id the adapter as RTL8191S chipset. thought i mayby could your driver if you could post it
Title: Re: [howto] compile your own wireless
Post by: suburbancore on November 03, 2009, 06:32:42 PM
excellent guide...thanks
Title: Re: [howto] compile your own wireless
Post by: sweetvn on November 04, 2009, 02:05:41 PM
Wow configure 1st gen WDTV to work wireless require more info than I thought.  Is there a plug and play wireless for 1st gen WDTV?
Title: Re: [howto] compile your own wireless
Post by: suburbancore on November 05, 2009, 12:09:35 AM
Wow configure 1st gen WDTV to work wireless require more info than I thought.  Is there a plug and play wireless for 1st gen WDTV?

It is actually very simple if you have a supported USB wi-fi stick. The steps above are for adding a driver that is not included already.

Ofcourse , some minimal configuration for your personal home network setup is always needed but overall it's not too hard.
Title: Re: [howto] compile your own wireless
Post by: sweetvn on November 05, 2009, 09:21:33 AM
Wow configure 1st gen WDTV to work wireless require more info than I thought.  Is there a plug and play wireless for 1st gen WDTV?

It is actually very simple if you have a supported USB wi-fi stick. The steps above are for adding a driver that is not included already.

Ofcourse , some minimal configuration for your personal home network setup is always needed but overall it's not too hard.

I wanted to try but I have never edit these file before.

What do you guys use to edit the file? I used notepad and it doesn't work for me cuz the Text is jumbo up.
I am using Vista
Title: Re: [howto] compile your own wireless
Post by: Josch71 on November 05, 2009, 02:33:21 PM
Hello,

I have some problems while compiling at the end of step 3) compile wireless module

If I start with command make I get this:

Code: [Select]
wdtv@wdtv-devel:~/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0$ make
make -C tools
make[1]: Entering directory `/home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/tools'
/home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/os/linux/Makefile
make  -C  /lib/modules/2.6.26-2-686/build SUBDIRS=/home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/os/linux modules
make: *** /lib/modules/2.6.26-2-686/build: No such file or directory.  Stop.
make: *** [LINUX] Error 2

..missing folder /lib/modules/2.6.26-2-686/build

I created this folder:

Code: [Select]
wdtv@wdtv-devel:~/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0$ sudo mkdir /lib/modules/2.6.26-2-686/build
And after the next make command I get this:
Code: [Select]
wdtv@wdtv-devel:~/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0$ make
make -C tools
make[1]: Entering directory `/home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/tools'
/home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/os/linux/Makefile
make  -C  /lib/modules/2.6.26-2-686/build SUBDIRS=/home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/os/linux modules
make[1]: Entering directory `/lib/modules/2.6.26-2-686/build'
make[1]: *** No rule to make target `modules'.  Stop.
make[1]: Leaving directory `/lib/modules/2.6.26-2-686/build'
make: *** [LINUX] Error 2
wdtv@wdtv-devel:~/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0$

..no rule to make target 'module'

What's wrong..?

Regards
Josch
Title: Re: [howto] compile your own wireless
Post by: suburbancore on November 06, 2009, 02:27:20 AM
Hello,

I have some problems while compiling at the end of step 3) compile wireless module

If I start with command make I get this:

Code: [Select]
wdtv@wdtv-devel:~/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0$ make
make -C tools
make[1]: Entering directory `/home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/tools'
/home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/os/linux/Makefile
make  -C  /lib/modules/2.6.26-2-686/build SUBDIRS=/home/wdtv/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0/os/linux modules
make: *** /lib/modules/2.6.26-2-686/build: No such file or directory.  Stop.
make: *** [LINUX] Error 2

..missing folder /lib/modules/2.6.26-2-686/build

I created this folder:

Code: [Select]
wdtv@wdtv-devel:~/wdtv/2008_1225_RT3070_Linux_STA_v2.0.1.0$ sudo mkdir /lib/modules/2.6.26-2-686/build
And after the next make command I get this:
Code: [Select]
wdtv@wdtv-devel:~/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0$ make
make -C tools
make[1]: Entering directory `/home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/tools'
/home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/os/linux/Makefile
make  -C  /lib/modules/2.6.26-2-686/build SUBDIRS=/home/wdtv/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0/os/linux modules
make[1]: Entering directory `/lib/modules/2.6.26-2-686/build'
make[1]: *** No rule to make target `modules'.  Stop.
make[1]: Leaving directory `/lib/modules/2.6.26-2-686/build'
make: *** [LINUX] Error 2
wdtv@wdtv-devel:~/wdtv/2009_0820_RT2870_Linux_STA_V2.2.0.0$

..no rule to make target 'module'

What's wrong..?

Regards
Josch

In step 3 you havent edited the Makefile/config.mk etc files correctly since it seems to be looking for the kernel in the wrong place.

The variables in the makefile should be pointing to the folder where you saved and compiled the kernel 2.6.15 sources in step 2.

As long as you follow the instructions in the first post STEP BY STEP (except for changing folder names where appropriate) and running the missing: "make" at the END of step 3,

it will work fine
Title: Re: [howto] compile your own wireless
Post by: Josch71 on November 09, 2009, 12:23:28 AM
Yeah - this was the error!

Compiling the package works fine now!  ;D
But I have other problems now. I used the Ralink sources for the RT2870 for compiling but it wouldn't work with my WLAN stick Edimax 7711UTN. Connecting this stick on a windows machine shows me this chipset!
On the CD coming with the stick there are Linux sources for a RT3070 chipset and onthe Edimax homepage I also get the linux sources for this stick. So I compiled the wireless package with this source.
After booting with this I was able to connect my NFS shares but the bandwith was very bad - my Fritz-Box shows me only 1MBit!

The WLAN connection was set to OPEN and I configured a static IP adress. Using WPA doesn't change anything. It's quite bad!

Any idea..?
Title: Re: [howto] compile your own wireless
Post by: sweetvn on November 09, 2009, 10:14:51 PM
I wanted to try but I have never edit these file before.

What do you guys use to edit the file? I used notepad and it doesn't work for me cuz the Text is jumbo up.
I am using Vista
Title: Re: [howto] compile your own wireless
Post by: Josch71 on November 10, 2009, 10:03:38 AM
I wanted to try but I have never edit these file before.

What do you guys use to edit the file? I used notepad and it doesn't work for me cuz the Text is jumbo up.
I am using Vista

You have to use a "linux-like" editor like vi, midnigt commander, nano on a linux machine. Notepad adds some special control character like "carrage return / line feed". For a Windows machine there are also free editors available, e.g Proton.
Title: Re: [howto] compile your own wireless
Post by: sweetvn on November 11, 2009, 08:54:26 AM
I wanted to try but I have never edit these file before.

What do you guys use to edit the file? I used notepad and it doesn't work for me cuz the Text is jumbo up.
I am using Vista

You have to use a "linux-like" editor like vi, midnigt commander, nano on a linux machine. Notepad adds some special control character like "carrage return / line feed". For a Windows machine there are also free editors available, e.g Proton.

I'm sorry for being so newbie, but too many language that I read and not able to understand.

I read that you have to be on a Linus base computer to be able to edit these file, am I correct?
if not, I have download TotalEdit_install_4_30 to use it to edit the code on my Vista.  Will that work?
Title: Re: [howto] compile your own wireless
Post by: mike2k8 on November 11, 2009, 10:51:25 AM
I wanted to try but I have never edit these file before.

What do you guys use to edit the file? I used notepad and it doesn't work for me cuz the Text is jumbo up.
I am using Vista

You have to use a "linux-like" editor like vi, midnigt commander, nano on a linux machine. Notepad adds some special control character like "carrage return / line feed". For a Windows machine there are also free editors available, e.g Proton.

I think that you can use "wordpad" on windows. The unofficial firmwares use an unix comand named dos2linux that should convert the configuration file to the linux text format before reading it.

Personally, for this I use cygwin, so I have and unix-like system in windows, where I can use linux programs like "nano" to edit the text.
Title: Re: [howto] compile your own wireless
Post by: pacorob on December 12, 2009, 02:07:28 AM
I wanted to try but I have never edit these file before.

What do you guys use to edit the file? I used notepad and it doesn't work for me cuz the Text is jumbo up.
I am using Vista

Use Notepad++ that is freeware and works great http://notepad-plus.sourceforge.net (http://notepad-plus.sourceforge.net)

It is easier to have a wireless usb stick that is already supported such as (Wireless USB Linksys wusb600n v1 (ralink rt2870 which has WPA2 support). That saves you a lot of time. You can buy them for 25 dollar/euro.
Title: Re: [howto] compile your own wireless
Post by: canipeal on December 29, 2009, 05:18:08 PM
these are steps to compile rtl8192su module.
extract driver source. assumed kernel source is located at  "/home/wdtv/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15" (in my example)
Code: [Select]
sed -i "s|KSRC =.*|KSRC = /home/wdtv/wdtv/TVDOCK_GPL_code_package.2008.9.25/linux_kernel_2.6.15|g;" rtl8192su_linux_2.6.0002.0708.2009/Makefile
sed -i "s|CC =.*|CC = mipsel-linux-gcc|g;" rtl8192su_linux_2.6.0002.0708.2009/HAL/rtl8192u/Makefile
cd rtl8192su_linux_2.6.0002.0708.2009 && make
get Zorander's wireless app.bin; mount it; copy content over to your app.bin directory; modify S20wireless; copy firmware; create cramfs app.bin; umount wireless-mod.app.bin
Code: [Select]
sudo mount sudo mount -o loop wireless-mod.app.bin /path/to/mount/point
mkdir mywireless.app.bin
cp -r /path/to/mount/point/* mywireless.app.bin/
echo "insmod \$APATH/modules/r8192s_usb.ko" >> mywireless.app.bin/etc/init.d/S20wireless
cp firmware/RTL8192SU/rtl8192sfw.bin mywireless.app.bin/firmware/
sudo umount /path/to/mount/point/
/sbin/mkcramfs mywireless.app.bin wireless-rtl8192su.app.bin

I've managed to compile my own driver for the RTL8191S chip. Unfortunately I was unsuccessful as well, I believe that the linux drivers posted for the RTL8192SU chipset posted on various forums is not compatible with the RTL8191S chipset. Have you made any progress on this?
Title: Re: [howto] compile your own wireless
Post by: TechN9Ne1730 on February 18, 2010, 05:04:59 PM
I wanted to try but I have never edit these file before.

What do you guys use to edit the file? I used notepad and it doesn't work for me cuz the Text is jumbo up.
I am using Vista

Use Notepad++ that is freeware and works great http://notepad-plus.sourceforge.net (http://notepad-plus.sourceforge.net)
I prefer Notepad 2, but to each there own. ;)

Quote
wget http://www.ralinktech.com.tw/data/drivers/2009_0521_RT2870_Linux_STA_V2.1.2.0.tgz (http://www.ralinktech.com.tw/data/drivers/2009_0521_RT2870_Linux_STA_V2.1.2.0.tgz)
Link seems to be dead. I am looking through the US version of the site for a linux driver. If I find it I will post here.
Title: Re: [howto] compile your own wireless
Post by: demesmaeker on March 17, 2010, 03:48:13 AM
Here you go! (see attachment).
But eh there are newer versions to download, so I would not use this older one (unless you are sure that it is OK of course)

@sweetvn: What usbcard do you have?
Title: Re: [howto] compile your own wireless
Post by: mortings on April 07, 2010, 09:05:45 AM
Have spent a lot of hours trying to compile a driver for my ethernet adapter KY-RS9600 to use with my WDTV Gen2 using VMware under winxp and this howto, but I'm running into all sorts of problems.

I have followed everything in step1, with the following exceptions:
- I have downloaded the gpl-code for gen2 instead of gen1 (and used the filename for that code when unzipping)
- couldn't find any GPL-folder inside the wdtv-folder, but I found smp86xx_toolchain_2.8.2.0 in the folder toolchain under wdtv, so I used that one instead
- in mips.env I have tried the path as it is in the howto, and with replacing it to match the toolchain-folder above

During "make oldconfig" in step2 I get a bunch of options, but I've just left all of them at the default value.

However when I type "make" I get the a lot of /bin/sh: mips-linux-gnu-gcc: command not found and make: mips-linux-gnu-gcc: Command not found and also make[1]: ***[arch/mips/kernel/asm-offsets.s] Error 127 and make: *** [prepare0] Error 2

Anyone have any idea to how I can fix this?


...in case anyone feel extraordinary kind I have included the driver I want to have compiled for my gen2 :-)
Title: Re: [howto] compile your own wireless
Post by: 101000 on July 27, 2010, 11:29:00 AM
Hi this is my first post :)

I've compiled those driver http://code.google.com/p/open1211/  for zydas 1211 and 1211b chipsets. I'm posting it if someone will find those usefull. It loads correctly with wdlxtv 5.8.1 but my dongle doesn't work (I had a sitecome wl 117 now I switch to a sitecom wl172 with rt73 chipset). Files are here http://rapidshare.com/files/409449886/open1211.zip
I think there are no differences between those and http://wdtvforum.com/main/index.php?topic=1379.msg10477#msg10477 but I could be wrong. 

Title: Re: [howto] compile your own wireless
Post by: 101000 on August 08, 2010, 04:23:54 AM
I have already tried to build this driver. I do not remember any significant changes to the sources to be required. Update the makefie to set your paths to kernel sources and then just try running make right away and look at the output. I was not able to find the location it loads the firmware from. I tried both /etc/firmware and /lib/firmware. Probably you should place the firmware together with the driver.

No luck. It seems that it's correctly built, but the firmware is not loaded.
I have tried every place. I have read in the README that in some linux versions it could be needed to put in /lib/firmware/2.6.15/
It doesn't work either.
Here is what I get in messages.txt
Code: [Select]
Jan  1 00:00:49 wdtv user.info kernel: rt73: init
Jan  1 00:00:49 wdtv user.info kernel: rt73: idVendor = 0x13b1, idProduct = 0x20
Jan  1 00:00:59 wdtv user.err kernel: rt73: Failed to request_firmware. Check your firmware file location
Jan  1 00:00:59 wdtv user.crit kernel: rt73: Failed to load Firmware.
Jan  1 00:00:59 wdtv user.warn kernel: rt73: probe of 1-2:1.0 failed with error -2
Jan  1 00:01:00 wdtv user.info kernel: usbcore: registered new driver rt73
Jan  1 00:01:04 wdtv user.warn kernel: Unhandled kernel unaligned access[#1]:
Jan  1 00:01:04 wdtv user.warn kernel: Cpu 0
Jan  1 00:01:04 wdtv user.warn kernel: $ 0   : 00000000 00000000 90296654 00000000
Jan  1 00:01:04 wdtv user.warn kernel: $ 4   : 75646f6d 7ff7aa98 00001fe0 7ff7aa98
Jan  1 00:01:04 wdtv user.warn kernel: $ 8   : 00000001 00000000 00000000 00000000
Jan  1 00:01:04 wdtv user.warn kernel: $12   : 00000002 9497bdf4 00000000 0100007f
Jan  1 00:01:04 wdtv user.warn kernel: $16   : 9036b220 75646f6d 7ff7aa78 00000020
Jan  1 00:01:04 wdtv user.warn kernel: $20   : 00002000 9036b298 90310000 7ff7aa70
Jan  1 00:01:04 wdtv user.warn kernel: $24   : 00000000 90298768                 
Jan  1 00:01:04 wdtv user.warn kernel: $28   : 9497a000 9497bd98 7ff7aa78 90246098
Jan  1 00:01:04 wdtv user.warn kernel: Hi    : 00000000
Jan  1 00:01:04 wdtv user.warn kernel: Lo    : 431bde83
Jan  1 00:01:04 wdtv user.warn kernel: epc   : 90296670     Tainted: PF   
Jan  1 00:01:04 wdtv user.warn kernel: ra    : 90246098 Status: 10001c03    KERNEL EXL IE
Jan  1 00:01:04 wdtv user.warn kernel: Cause : 50808010
Jan  1 00:01:04 wdtv user.warn kernel: BadVA : 75647015
Jan  1 00:01:04 wdtv user.warn kernel: PrId  : 00019069
Jan  1 00:01:04 wdtv user.warn kernel: Modules linked in: nls_koi8_u nls_koi8_r nls_iso8859_9 nls_iso8859_7 nls_iso8859_6 nls_iso8859_5 nls_iso8859_4 nls_iso8859_3 nls_iso8859_2 nls_iso8859_15 nls_iso8859_14 nls_iso8859_13 nls_euc_jp nls_cp950 nls_cp949 nls_cp936 nl
Jan  1 00:01:04 wdtv user.warn kernel: Process nmbd (pid: 847, threadinfo=9497a000, task=96e0f030)
Jan  1 00:01:04 wdtv user.warn kernel: Stack : 0000002a 00000101 00000000 00000000 00006f6c 00000000 00000000 00000000
Jan  1 00:01:04 wdtv user.warn kernel:         00000002 0100007f 00000000 00000000 9036b220 75646f6d 7ff7aa78 00000020
Jan  1 00:01:04 wdtv user.warn kernel:         00002000 90246098 00000001 96b5c934 900b3898 9497bf18 00002000 7ff7aa78
Jan  1 00:01:04 wdtv user.warn kernel:         00006f6c 00000000 00000000 00001000 55733330 00000000 9497be50 55733330
Jan  1 00:01:04 wdtv user.warn kernel:         00001000 9497bf18 00000194 00000194 2acb042c 2acb0290 00008912 7ff7aa70
Jan  1 00:01:04 wdtv user.warn kernel:         ...
Jan  1 00:01:04 wdtv user.warn kernel: Call Trace: [<90246098>]  [<900b3898>]  [<c4036044>]  [<900be3f0>]  [<9019da8c>]  [<9009a5d0>]  [<900b7bf0>]  [<90237334>]  [<90235ed4>]  [<90235d40>]  [<900b7cf8>]  [<900b80d4>]  [<900b80b0>]  [<902376d4>]  [<9002f8a0>]  [<900
Jan  1 00:01:04 wdtv user.warn kernel:
Jan  1 00:01:04 wdtv user.warn kernel: Code: afb40040  afb3003c  afb10034 <8c8300a8> 00a08021  10600032  00c09021  8c71000c  1220002f

I know it's been one year since your post and maybe it's not important but .. I've compile serialmonkey driver too and I'm able to load firmware correctly. If you want I will upload an app.bin with a correct configuration.
This is what I get from messages.txt :
Code: [Select]
Jan  1 00:00:48 WDTV-8165f user.info kernel: rt73: init
Jan  1 00:00:48 WDTV-8165f user.info kernel: rt73: idVendor = 0xdf6, idProduct = 0x90ac
Jan  1 00:00:49 WDTV-8165f user.err kernel: firmware_loading_store: unexpected value (0)
Jan  1 00:00:49 WDTV-8165f user.info kernel: rt73: using permanent MAC addr
Jan  1 00:00:49 WDTV-8165f user.info kernel: rt73: Active MAC addr: 00:0c:f6:33:b9:a1
Jan  1 00:00:49 WDTV-8165f user.info kernel: rt73: Local MAC = 00:0c:f6:33:b9:a1
Jan  1 00:00:49 WDTV-8165f user.info kernel: usbcore: registered new driver rt73
Jan  1 00:00:49 WDTV-8165f user.info kernel: rt73: driver version - 1.0.3.6 CVS
Jan  1 00:00:49 WDTV-8165f user.info kernel: rt73: using net dev supplied MAC addr
Jan  1 00:00:49 WDTV-8165f user.info kernel: rt73: Active MAC addr: 00:0c:f6:33:b9:a1
Jan  1 00:00:49 WDTV-8165f user.info kernel: rt73: Local MAC = 00:0c:f6:33:b9:a1

I don't know what " firmware_loading_store: unexpected value " means but driver seems to work correctly
Title: Re: [howto] compile your own wireless
Post by: nowhere on August 22, 2010, 08:06:15 PM
Have spent a lot of hours trying to compile a driver for my ethernet adapter KY-RS9600 to use with my WDTV Gen2 using VMware under winxp and this howto, but I'm running into all sorts of problems.

I have followed everything in step1, with the following exceptions:
- I have downloaded the gpl-code for gen2 instead of gen1 (and used the filename for that code when unzipping)
- couldn't find any GPL-folder inside the wdtv-folder, but I found smp86xx_toolchain_2.8.2.0 in the folder toolchain under wdtv, so I used that one instead
- in mips.env I have tried the path as it is in the howto, and with replacing it to match the toolchain-folder above

During "make oldconfig" in step2 I get a bunch of options, but I've just left all of them at the default value.

However when I type "make" I get the a lot of /bin/sh: mips-linux-gnu-gcc: command not found and make: mips-linux-gnu-gcc: Command not found and also make[1]: ***[arch/mips/kernel/asm-offsets.s] Error 127 and make: *** [prepare0] Error 2

Anyone have any idea to how I can fix this?


...in case anyone feel extraordinary kind I have included the driver I want to have compiled for my gen2 :-)
you need change msip.env file. The path /wdtv/wdtv should be changed to /your_user_name/wdtv.
Title: Re: [howto] compile your own wireless
Post by: nowhere on August 22, 2010, 08:19:33 PM
I have TP-LINK TL-WN821NV2 USB adapter, I downloaded driver(wpa_supplicant otus driver) from http://wireless.kernel.org/en/users/Drivers/otus, and downloaded firmware from http://wireless.kernel.org/en/users/Drivers/ar9170#device_driver.

However, I stucked at "diff -uNbB Makefile.orig Makefile". I only see "Makefile" and there is no "Makefile.orig" at same directory. Can someone help out?

Thanks
Title: Re: [howto] compile your own wireless
Post by: wandrey on September 17, 2010, 09:12:45 PM
I need help, i want a compiled driver for wdtv, for RTL8192U. Any body can help me? please? TKs
Title: Re: [howto] compile your own wireless
Post by: brackb01 on January 15, 2011, 03:53:39 AM

I don't suppose anybody has built a driver for the RT3672sta have they? (it's for the WUSB600N v2 for a WDTV Gen 1) - I don't mind contributing something financially by way of a thankyou!!!!!!
Title: Re: [howto] compile your own wireless
Post by: gchaimovitz on January 30, 2011, 07:55:22 AM
I'm trying to compile a new version of asix.ko for WDLXTV .5.8.1 as my usb-ethernet adapter won't get detected with the version included in WDLXTV.  I'm using VMPLAYER with the VMWARE image and the Makefile refers to the folder /lib/modules/2.6.26-2-686/build/includes/linux/usb/* and /lib/modules/2.6.26-2-686/build/drivers/net/usb/usbnet.h and neither of those folders exist.  I can't find on the vmware image a usbnet.h file anywhere.  What am i doing wrong?

**** UPDATE
I've been able to get through and compile the new driver.  I followed the rest of the instructions however being that this is a ethernet-usb vs a wireless is the process still the same?
Title: working drivers for RT2070 (TP-Link TL-WN321G, 148f:2070)
Post by: belidzs on April 26, 2011, 07:31:50 AM
Hi there,
First of all let me say thank you to everyone who made custom firmwares available to us, and OP for writing this excellent guide. For me, it wasn't easy to get my wireless card working, but after modifying the driver, recompiling it using this guide and applying it to the busybox, it finally works.

Here you can download SmartP's wireless extension pack modified by me with working drivers for 148f:2070. It is based on Ralink's official drivers for RT8070/RT3070/RT3370 USB v2.5.0.1
http://www.uni-corvinus.hu/~bkeresz/wireless-mod-rt3070.app.bin (http://www.uni-corvinus.hu/~bkeresz/wireless-mod-rt3070.app.bin)

Cheers,
belidzs

Supported devices:
Code: [Select]
{USB_DEVICE(0x148F,0x3070)}, /* Ralink 3070 */
        {USB_DEVICE(0x148F,0x2070)}, /* Ralink 2070L */
{USB_DEVICE(0x148F,0x3071)}, /* Ralink 3071 */
{USB_DEVICE(0x148F,0x3072)}, /* Ralink 3072 */
{USB_DEVICE(0x0DB0,0x3820)}, /* Ralink 3070 */
{USB_DEVICE(0x0DB0,0x871C)}, /* Ralink 3070 */
{USB_DEVICE(0x0DB0,0x822C)}, /* Ralink 3070 */
{USB_DEVICE(0x0DB0,0x871B)}, /* Ralink 3070 */
{USB_DEVICE(0x0DB0,0x822B)}, /* Ralink 3070 */
{USB_DEVICE(0x0DF6,0x003E)}, /* Sitecom 3070 */
{USB_DEVICE(0x0DF6,0x0042)}, /* Sitecom 3072 */
{USB_DEVICE(0x0DF6,0x0048)}, /* Sitecom 3070 */
{USB_DEVICE(0x0DF6,0x0047)}, /* Sitecom 3071 */
{USB_DEVICE(0x14B2,0x3C12)}, /* AL 3070 */
{USB_DEVICE(0x18C5,0x0012)}, /* Corega 3070 */
{USB_DEVICE(0x083A,0x7511)}, /* Arcadyan 3070 */
{USB_DEVICE(0x083A,0xA701)}, /* SMC 3070 */
{USB_DEVICE(0x083A,0xA702)}, /* SMC 3072 */
{USB_DEVICE(0x1740,0x9703)}, /* EnGenius 3070 */
{USB_DEVICE(0x1740,0x9705)}, /* EnGenius 3071 */
{USB_DEVICE(0x1740,0x9706)}, /* EnGenius 3072 */
{USB_DEVICE(0x1740,0x9707)}, /* EnGenius 3070 */
{USB_DEVICE(0x1740,0x9708)}, /* EnGenius 3071 */
{USB_DEVICE(0x1740,0x9709)}, /* EnGenius 3072 */
{USB_DEVICE(0x13D3,0x3273)}, /* AzureWave 3070*/
{USB_DEVICE(0x13D3,0x3305)}, /* AzureWave 3070*/
{USB_DEVICE(0x1044,0x800D)}, /* Gigabyte GN-WB32L 3070 */
{USB_DEVICE(0x2019,0xAB25)}, /* Planex Communications, Inc. RT3070 */
{USB_DEVICE(0x2019,0x5201)}, /* Planex Communications, Inc. RT8070 */
{USB_DEVICE(0x07B8,0x3070)}, /* AboCom 3070 */
{USB_DEVICE(0x07B8,0x3071)}, /* AboCom 3071 */
{USB_DEVICE(0x07B8,0x3072)}, /* Abocom 3072 */
{USB_DEVICE(0x7392,0x7711)}, /* Edimax 3070 */
{USB_DEVICE(0x7392,0x4085)}, /* 2L Central Europe BV 8070 */
{USB_DEVICE(0x1A32,0x0304)}, /* Quanta 3070 */
{USB_DEVICE(0x1EDA,0x2310)}, /* AirTies 3070 */
{USB_DEVICE(0x07D1,0x3C0A)}, /* D-Link 3072 */
{USB_DEVICE(0x07D1,0x3C0D)}, /* D-Link 3070 */
{USB_DEVICE(0x07D1,0x3C0E)}, /* D-Link 3070 */
{USB_DEVICE(0x07D1,0x3C0F)}, /* D-Link 3070 */
{USB_DEVICE(0x07D1,0x3C16)}, /* D-Link 3070 */
{USB_DEVICE(0x07D1,0x3C17)}, /* D-Link 8070 */
{USB_DEVICE(0x1D4D,0x000C)}, /* Pegatron Corporation 3070 */
{USB_DEVICE(0x1D4D,0x000E)}, /* Pegatron Corporation 3070 */
{USB_DEVICE(0x1D4D,0x0011)}, /* Pegatron Corporation 3072 */
{USB_DEVICE(0x5A57,0x5257)}, /* Zinwell 3070 */
{USB_DEVICE(0x5A57,0x0283)}, /* Zinwell 3072 */
{USB_DEVICE(0x04BB,0x0945)}, /* I-O DATA 3072 */
{USB_DEVICE(0x04BB,0x0947)}, /* I-O DATA 3070 */
{USB_DEVICE(0x04BB,0x0948)}, /* I-O DATA 3072 */
{USB_DEVICE(0x203D,0x1480)}, /* Encore 3070 */
{USB_DEVICE(0x20B8,0x8888)}, /* PARA INDUSTRIAL 3070 */
{USB_DEVICE(0x0B05,0x1784)}, /* Asus 3072 */
{USB_DEVICE(0x203D,0x14A9)}, /* Encore 3070*/
{USB_DEVICE(0x0DB0,0x899A)}, /* MSI 3070*/
{USB_DEVICE(0x0DB0,0x3870)}, /* MSI 3070*/
{USB_DEVICE(0x0DB0,0x870A)}, /* MSI 3070*/
{USB_DEVICE(0x0DB0,0x6899)}, /* MSI 3070 */
{USB_DEVICE(0x0DB0,0x3822)}, /* MSI 3070 */
{USB_DEVICE(0x0DB0,0x3871)}, /* MSI 3070 */
{USB_DEVICE(0x0DB0,0x871A)}, /* MSI 3070 */
{USB_DEVICE(0x0DB0,0x822A)}, /* MSI 3070 */
{USB_DEVICE(0x0DB0,0x3821)}, /* Ralink 3070 */
{USB_DEVICE(0x0DB0,0x821A)}, /* Ralink 3070 */
{USB_DEVICE(0x5A57,0x0282)}, /* zintech 3072 */
{USB_DEVICE(0x083A,0xA703)}, /* IO-MAGIC */
{USB_DEVICE(0x13D3,0x3307)}, /* Azurewave */
{USB_DEVICE(0x13D3,0x3321)}, /* Azurewave */
{USB_DEVICE(0x07FA,0x7712)}, /* Edimax */
{USB_DEVICE(0x0789,0x0166)}, /* Edimax */
Title: Re: [howto] compile your own wireless
Post by: arfgh on November 12, 2013, 05:04:59 PM
guys i am trying to learn howto compile for the gen1, and i think that i need the follow file:

Zorander's linux-kernel.config

the mediafire link on the first reply here is dead :)
can someone reshare it ?

thx in advance
Title: Re: [howto] compile your own wireless
Post by: arfgh on November 15, 2013, 03:18:02 AM
i need to know if using the tutorial i could compile my own wireless that is in this case a TL-WN821N wifi adapter.
I have seent hat this device that is the revision 2, works directly if i use it with the WD TV Live.

Please help