Jump to content


Photo

Ubuntu driver for HG20F9 USB ethernet dongle


  • Please log in to reply
45 replies to this topic

#1 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 18 January 2013 - 04:45 AM

If you have a HG20F9 USB ethernet dongle, for example from ########### or dx.com:

http://<###########-addr>/itm/External-USB-Lan-RJ45-Ethernet-Network-Card-Adapter-10-100-Mbps-Laptop-PC-/170896745782?_trksid=p5197.m1992&_trkparms=aid%3D111000%26algo%3DREC.CURRENT%26ao%3D1%26asc%3D14%26meid%3D4958697353438599722%26pid%3D100015%26prg%3D1006%26rk%3D1%26sd%3D170896745782%26

http://dx.com/p/usb-...le-black-161542

then I have a good news for you. I compiled a driver for it. https://github.com/linuxerwang/HG20F9

This dongle is really low price, but with very high speed (100mbps). I tested it on Picuntu pre alpha 0.3 and the transfer speed can reach >11M bytes per second. DHCP works perfectly.

Edited by linuxerwang, 18 January 2013 - 04:47 AM.


#2 aloksinha2001

aloksinha2001

    Developer

  • FW Developer
  • PipPipPip
  • 247 posts

Posted 18 January 2013 - 07:36 AM

If you have a HG20F9 USB ethernet dongle, for example from ########### or dx.com:

http://<###########-addr>/itm/External-USB-Lan-RJ45-Ethernet-Network-Card-Adapter-10-100-Mbps-Laptop-PC-/170896745782?_trksid=p5197.m1992&_trkparms=aid%3D111000%26algo%3DREC.CURRENT%26ao%3D1%26asc%3D14%26meid%3D4958697353438599722%26pid%3D100015%26prg%3D1006%26rk%3D1%26sd%3D170896745782%26

http://dx.com/p/usb-...le-black-161542

then I have a good news for you. I compiled a driver for it. https://github.com/linuxerwang/HG20F9

This dongle is really low price, but with very high speed (100mbps). I tested it on Picuntu pre alpha 0.3 and the transfer speed can reach >11M bytes per second. DHCP works perfectly.


Great - lets introduce it in our next release of PicUntu.

Alok

#3 4nubis

4nubis

    Newbie

  • Jr. Member
  • Pip
  • 4 posts

Posted 19 January 2013 - 01:26 AM

then I have a good news for you. I compiled a driver for it. https://github.com/linuxerwang/HG20F9


Is it possible to add the driver in the finless 1.6 for the mk808?

#4 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 19 January 2013 - 01:58 PM

Is it possible to add the driver in the finless 1.6 for the mk808?


I believe so, as long as the kernel version is the same. There's a post mentioning about using adb to transfer a driver file to android, google it.

#5 4nubis

4nubis

    Newbie

  • Jr. Member
  • Pip
  • 4 posts

Posted 21 January 2013 - 06:49 AM

Now i installed ubuntu, but can you tell me how to install the driver?

#6 Raymond Day

Raymond Day

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 185 posts

Posted 21 January 2013 - 06:14 PM

Now i installed ubuntu, but can you tell me how to install the driver?


I order 1 they are like only $5 free shipping too. I guess to install it you would do this:

wget https://github.com/l...hive/master.zip
unzip master.zip
cd HG20F9-master
make
make install
modprobe HG20F9


But I am not sure I don't have on yet. But I will try this when I get it or I guess the next picuntu will come with it.

I tested out the commands some. To get the make to work some what I had to fix a link it was:

/home/andrew/UG802/rk3066-kernel


So I fixed it with 3 lines:

cd /lib/modules/3.0.8+
ln -f -s /home/ubuntu/rk3066-kernel build
ln -f -s /home/ubuntu/rk3066-kernel source


But the make still gets some errors. I guess because I don't have the USB to Ethernet yet to plug in.

-Raymond Day

Edited by Raymond Day, 21 January 2013 - 06:36 PM.

  • 4nubis likes this

#7 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 22 January 2013 - 01:25 AM

Now i installed ubuntu, but can you tell me how to install the driver?


You can simply download from github the HG20F9.ko and copy it to /lib/modules/3.0.8+/kernel/drivers/net/usb and run "sudo depmod -a".

Now plug in your device, wait for about 15 seconds, the light should flash and you are on!

You can also compile it yourself. Note that the kernel magic version must match, so you need to change the "EXTRAVERSION = +" $KERNEL/Makefile and "make modules" before you compile the HG20F9 driver. There might be better ways to handle the magic version and hope somebody would tell us. The way I am using (EXTRAVERSION = +) works for HG20F9 driver but the other drivers in the kernel source tree will have magic version 3.0.8++ and thus won't work.
  • 4nubis likes this

#8 Raymond Day

Raymond Day

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 185 posts

Posted 22 January 2013 - 04:45 AM

So then the commands would be:

wget wget https://github.com/l...hive/master.zip
unzip master.zip
mv HG20F9-master HG20F9.ko
cp -rpt HG20F9.ko /lib/modules/3.0.8+/kernel/driver/net/usb/
depmod -a


I will do that when I get mine.

-Raymond Day

Edited by Raymond Day, 22 January 2013 - 05:59 PM.

  • 4nubis likes this

#9 4nubis

4nubis

    Newbie

  • Jr. Member
  • Pip
  • 4 posts

Posted 22 January 2013 - 05:44 AM

Raymond Day

when i do:
depmod -a

i get an error:
WARNING: Can't read module /lib/modules/3.0.8+/HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0/HG20F9.ko: Invalid argument


linuxerwang

is the HG20F9.ko ok? Because it seems to be empty?

#10 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 22 January 2013 - 03:31 PM

Raymond Day

when i do:
depmod -a

i get an error:
WARNING: Can't read module /lib/modules/3.0.8+/HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0/HG20F9.ko: Invalid argument


linuxerwang

is the HG20F9.ko ok? Because it seems to be empty?



You copied in a wrong way. HG20F9.ko is a file, you need to put it into /lib/modules/3.0.8+/kernel/driver/net/usb/. Don't do the "HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0". And then run "sudo depmod -a".

The driver is good. I tested it on rikomagic III and mk808.

#11 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 22 January 2013 - 03:34 PM

You copied in a wrong way. HG20F9.ko is a file, you need to put it into /lib/modules/3.0.8+/kernel/driver/net/usb/. Don't do the "HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0". And then run "sudo depmod -a".

The driver is good. I tested it on rikomagic III and mk808.


Whoops, I know what happened. Looks the file failed to upload. Will upload again when I get a chance.

#12 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 22 January 2013 - 03:46 PM

Whoops, I know what happened. Looks the file failed to upload. Will upload again when I get a chance.


Re-uploaded. The file size should be 55.37kb.

And you need to copy the HG20F9.ko file (and only this file) to /lib/modules/3.0.8+/kernel/drivers/net/usb.

#13 Raymond Day

Raymond Day

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 185 posts

Posted 22 January 2013 - 06:06 PM

Like I said do just these commands. Just copy and paste them when you long in with like putty.

wget wget https://github.com/l...hive/master.zip
unzip master.zip
mv HG20F9-master HG20F9.ko
cp -rpt HG20F9.ko /lib/modules/3.0.8+/kernel/driver/net/usb/
depmod -a


Each is one line and press Enter at the end of each line.

The first line downloads it.
The 2ND line unzips it.
The 3RD line renames the folder.
The 4TH line copys the folder HG20F9.ko to the right place.
The 5Th line makes it work.

If you not log in as root you have to put sudo before each line.

I don't have one yet. So some one should post back if this is right.

-Raymond Day

Edited by Raymond Day, 22 January 2013 - 06:08 PM.


#14 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 22 January 2013 - 06:24 PM

Like I said do just these commands. Just copy and paste them when you long in with like putty.



Each is one line and press Enter at the end of each line.

The first line downloads it.
The 2ND line unzips it.
The 3RD line renames the folder.
The 4TH line copys the folder HG20F9.ko to the right place.
The 5Th line makes it work.

If you not log in as root you have to put sudo before each line.

I don't have one yet. So some one should post back if this is right.

-Raymond Day



Raymond, I disagree with you on lines 2 and 3. You don't need to whole folder. Only copy the file HG20F9.ko, not the folder.

#15 Raymond Day

Raymond Day

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 185 posts

Posted 22 January 2013 - 06:36 PM

Raymond, I disagree with you on lines 2 and 3. You don't need to whole folder. Only copy the file HG20F9.ko, not the folder.


Can't you post the right lines then like I did? That would be very good. It's like a easy step-by-step way.

-Raymond Day

#16 Raymond Day

Raymond Day

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 185 posts

Posted 22 January 2013 - 06:42 PM

So would the commands be like this:

wget wget https://github.com/l...hive/master.zip
unzip master.zip
cd HG20F9.ko/binaries-rk3066-3.0.8+/v1.0.0/
cp HG20F9.ko /lib/modules/3.0.8+/kernel/drivers/net/usb/
depmod -a


Because the unzip make a "HG20F9.ko" folder and in that folder the only file can find with the name HG20F9.ko is at: /HG20F9.ko/binaries-rk3066-3.0.8+/v1.0.0/HG20F9.ko

But looks like the HG20F9.ko file is blank.

root@small3:~/USB-to-Ethernet/HG20F9.ko/binaries-rk3066-3.0.8+/v1.0.0# ls -l
total 0
-rw-r--r-- 1 root root 0 Jan 18 01:42 HG20F9.ko
root@small3:~/USB-to-Ethernet/HG20F9.ko/binaries-rk3066-3.0.8+/v1.0.0#


-Raymond Day

Edited by Raymond Day, 22 January 2013 - 06:50 PM.


#17 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 22 January 2013 - 07:35 PM

So would the commands be like this:



Because the unzip make a "HG20F9.ko" folder and in that folder the only file can find with the name HG20F9.ko is at: /HG20F9.ko/binaries-rk3066-3.0.8+/v1.0.0/HG20F9.ko

But looks like the HG20F9.ko file is blank.



-Raymond Day


Re-download the zip file you'll get the correct file.

Here's the complete command lines:

$ wget https://github.com/l...hive/master.zip
$ unzip master.zip
$ sudo cp HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0/HG20F9.ko /lib/modules/3.0.8+/kernel/drivers/net/usb/
$ sudo depmod -a

#18 Raymond Day

Raymond Day

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 185 posts

Posted 22 January 2013 - 08:25 PM

Looks like it works good. Thank you. Here is my command line with your commands.

root@small3:~/USB-to-Ethernet# wget https://github.com/l...hive/master.zip
--2013-01-22 20:21:57-- https://github.com/l...hive/master.zip
Resolving github.com (github.com)... 207.97.227.239
Connecting to github.com (github.com)|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://nodeload.git...20F9/zip/master [following]
--2013-01-22 20:21:57-- https://nodeload.git...20F9/zip/master
Resolving nodeload.github.com (nodeload.github.com)... 207.97.227.252
Connecting to nodeload.github.com (nodeload.github.com)|207.97.227.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 60433 (59K) [application/zip]
Saving to: `master.zip'

100%[======================================>] 60,433 332K/s in 0.2s

2013-01-22 20:21:58 (332 KB/s) - `master.zip' saved [60433/60433]

root@small3:~/USB-to-Ethernet# ls
master.zip
root@small3:~/USB-to-Ethernet# unzip master.zip
Archive: master.zip
bc17912aebc2b0281f9cb5e654510dad6e4c2a24
creating: HG20F9-master/
inflating: HG20F9-master/70-persistent-net.rules
inflating: HG20F9-master/HG20F9.c
inflating: HG20F9-master/HG20F9.h
inflating: HG20F9-master/Makefile
inflating: HG20F9-master/axusbnet.c
inflating: HG20F9-master/axusbnet.h
creating: HG20F9-master/binaries-rk3066-3.0.8+/
creating: HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0/
inflating: HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0/HG20F9.ko
inflating: HG20F9-master/readme
root@small3:~/USB-to-Ethernet# cp HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0/HG20F9.ko /lib/modules/3.0.8+/kernel/drivers/net/usb/
root@small3:~/USB-to-Ethernet# depmod -a
root@small3:~/USB-to-Ethernet#


When mine comes in the mail I guess it will work now. All I have to do is plug it in and do the command "depmod -a" Then is should work. Thank you.

I had to click MultiQuote to get the wget command to copy and paste it.

-Raymond Day

Edited by Raymond Day, 22 January 2013 - 08:30 PM.


#19 aloksinha2001

aloksinha2001

    Developer

  • FW Developer
  • PipPipPip
  • 247 posts

Posted 22 January 2013 - 09:30 PM

Re-download the zip file you'll get the correct file.

Here's the complete command lines:

$ wget https://github.com/l...hive/master.zip
$ unzip master.zip
$ sudo cp HG20F9-master/binaries-rk3066-3.0.8+/v1.0.0/HG20F9.ko /lib/modules/3.0.8+/kernel/drivers/net/usb/
$ sudo depmod -a



linuxerwang - you may want to add the sha1 check sum, for people to be assured that they have the complete file, the correct file.

Alok

#20 linuxerwang

linuxerwang

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 44 posts

Posted 22 January 2013 - 10:40 PM

linuxerwang - you may want to add the sha1 check sum, for people to be assured that they have the complete file, the correct file.

Alok


Good point. Will do.