WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Pi Zero usb LAN adapter  (Read 26134 times)

Offline strebor

  • Newbie
  • *
  • Posts: 15
Pi Zero usb LAN adapter
« on: June 20, 2016, 05:29:40 PM »
Very new to the Raspery and Tiny Core and have not found out how to discover what hardware is compiled in.
I'm wanting to add wired Ethernet to the USB port

Thanks Strebor

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11321
Re: Pi Zero usb LAN adapter
« Reply #1 on: June 20, 2016, 08:48:31 PM »
Hi strebor
If you are looking for the kernel config, I think this is it:
http://tinycorelinux.net/8.x/armv7/releases/RPi/src/kernel/4.4.11-piCore_v7+_.config.xz

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Pi Zero usb LAN adapter
« Reply #2 on: June 21, 2016, 02:20:51 AM »
On the terminal type

Code: [Select]
sudo modprobe configs
zcat /proc/config.gz

It will display the actual kernel config file.
Béla
Ham Radio callsign: HA5DI

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

Offline mikedev

  • Newbie
  • *
  • Posts: 25
Re: Pi Zero usb LAN adapter
« Reply #3 on: June 21, 2016, 11:48:32 AM »
I'm wanting to add wired Ethernet to the USB port

Just for an example...
I am using pi Zero and a dirt cheap usb LAN adapter+USB 2.0 hub from ebay.

I use the piCore8.0beta

To support that dirt cheap usb LANadapter+USB2.0 3ports hub, I need to get http://tinycorelinux.net/8.x/armv6/releases/RPi/src/kernel/4.4.11-piCore+_modules.tar.xz and extract the
dm9601.ko
dm9601.ko.gz
into /usr/local/lib/modules/4.4.11-piCore+/kernel/dirvers/net/usb/
and remaster the core.gz

Then the usb LAN+USB2.0 3 ports hub is supported right from startup perfectly!
« Last Edit: June 21, 2016, 11:51:27 AM by mikedev »

Offline strebor

  • Newbie
  • *
  • Posts: 15
Re: Pi Zero usb LAN adapter
« Reply #4 on: June 21, 2016, 12:26:24 PM »
Thanks all for your answers.
What I actually have is piCorePlayer and a usb hub+Lan a la Mikedev.
I've gotten myself into a little bit of hole, as I only have ssh access (no spare hdmi monitor)

I see that the .img has a tce partition and I was wondering if I could use that to load a module at boot, rather than mess with kernel and have it overwritten with updates.

Anticipating your answers

Strebor

Offline mikedev

  • Newbie
  • *
  • Posts: 25
Re: Pi Zero usb LAN adapter
« Reply #5 on: June 21, 2016, 12:41:50 PM »
Thanks all for your answers.
What I actually have is piCorePlayer and a usb hub+Lan a la Mikedev.
I've gotten myself into a little bit of hole, as I only have ssh access (no spare hdmi monitor)

I see that the .img has a tce partition and I was wondering if I could use that to load a module at boot, rather than mess with kernel and have it overwritten with updates.

Anticipating your answers

Strebor

In 7.x, it is available as a separate module "net-usb-4.1.13-piCore+.tcz" and you can load it after boot.
In 8.x, it is NOT available in the repository yet, and I can't wait so I manually remaster it into the core and load automatically at boot.
So, if you are looking for the module, then you need to wait for a bit...

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Pi Zero usb LAN adapter
« Reply #6 on: June 21, 2016, 03:56:17 PM »
net-usb-KERNEL.tcz added to 8.x repo
Béla
Ham Radio callsign: HA5DI

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

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Pi Zero usb LAN adapter
« Reply #7 on: June 21, 2016, 08:38:19 PM »
Thanks all for your answers.
What I actually have is piCorePlayer and a usb hub+Lan a la Mikedev.
I've gotten myself into a little bit of hole, as I only have ssh access (no spare hdmi monitor)

I see that the .img has a tce partition and I was wondering if I could use that to load a module at boot, rather than mess with kernel and have it overwritten with updates.

Anticipating your answers

Strebor

hi Strebor,

I am assuming you are using piCorePlayer 2.06, so its linux 4.1.20-piCore+ / piCore v7.1beta4.

You need to load net-usb-4.1.20-piCore+.tcz, hopefully the required software is included for your particular hardware, but you need a network connection! maybe wifi?

Thru the web interface:
On [Main Page] in [Beta] mode, select [Extensions].
Scroll thru [Available extensions] until you find net-usb-4.1.20-piCore+.tcz. Click [Load].

Or, you could set up SD card on another Raspberry Pi B, but it needs to be using linux 4.1.20-piCore+ not linux 4.1.20-piCore_v7+

Or, if you are using a Linux computer elsewhere:
1. copy net-usb-4.1.20-piCore+.tcz to /mnt/mmcblk0p2/tce/optional
2. add  net-usb-4.1.20-piCore+.tcz  to file /mnt/mmcblk0p2/tce/onboot.lst

We will discuss if we need to add net-usb-4.1.20-piCore+.tcz to the standard image.

regards
Greg


Offline strebor

  • Newbie
  • *
  • Posts: 15
Re: Pi Zero usb LAN adapter
« Reply #8 on: June 22, 2016, 06:14:39 AM »
Greg et al, thanks, I will report success or failure. In woodworking mode  today as the drive units have arrived for the bespoke under cupboard kitchen player.
Strebor

Offline strebor

  • Newbie
  • *
  • Posts: 15
Re: Pi Zero usb LAN adapter
« Reply #9 on: June 23, 2016, 11:46:44 AM »
Update, well the module is loaded, and now to turn of wifi .
The adapter I have is based upon RT8152 so i should be picked up ::)

Nah, and now I'm cut off so I'm going to stop until I can see a console on the hdmi port


The list of hardware in the module is thus:
pegasus.ko.gz
zaurus.ko.gz
kalmia.ko.gz
r8152.ko.gz
ax88179_178a.ko.gz
gl620a.ko.gz
net1080.ko.gz
sierra_net.ko.gz
rtl8150.ko.gz
plusb.ko.gz
sr9800.ko.gz
ipheth.ko.gz
mcs7830.ko.gz
cx82310_eth.ko.gz
huawei_cdc_ncm.ko.gz
smsc75xx.ko.gz
catc.ko.gz
lg-vl600.ko.gz
qmi_wwan.ko.gz
sr9700.ko.gz
rndis_host.ko.gz
asix.ko.gz
kaweth.ko.gz
dm9601.ko.gz
int51x1.ko.gz
..........................................................................
« Last Edit: June 23, 2016, 11:53:49 AM by strebor »

Offline strebor

  • Newbie
  • *
  • Posts: 15
Re: Pi Zero usb LAN adapter
« Reply #10 on: June 27, 2016, 04:14:06 PM »
Well I have an hdmi monitor now so I can see

The USB-NET module is loaded and I can see in dmesg that the four port hub is recognised and the ethernet adapter is seen as r8152.
A CDC interface is registered with the core (cdc_ether) BUT ifcnfig run a root only shows the loopback.
Any ideas where I should look next?

Strebor


Offline strebor

  • Newbie
  • *
  • Posts: 15
Re: Pi Zero usb LAN adapter
« Reply #11 on: June 28, 2016, 12:06:28 PM »
Also should I see an available module from lsmod -l  I grep for 8152 or net-usb and don't find anything
cat /sys/class/net only shows the loopback

strebor

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Pi Zero usb LAN adapter
« Reply #12 on: June 29, 2016, 03:35:27 AM »
hi strebor,

After loading net-usb-4.1.20-piCore+.tcz, I plugged one of these USB LAN devices into my RPi0, got this:

Code: [Select]
[696615.083155] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[696615.184046] usb 1-1.3: New USB device found, idVendor=1a40, idProduct=0101
[696615.184078] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[696615.184093] usb 1-1.3: Product: USB 2.0 Hub
[696615.188807] hub 1-1.3:1.0: USB hub found
[696615.189031] hub 1-1.3:1.0: 4 ports detected
[696615.463154] usb 1-1.3.4: new high-speed USB device number 6 using dwc_otg
[696615.565014] usb 1-1.3.4: New USB device found, idVendor=0bda, idProduct=8152
[696615.565045] usb 1-1.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[696615.565059] usb 1-1.3.4: Product: USB 10/100 LAN
[696615.565073] usb 1-1.3.4: Manufacturer: Realtek
[696615.565499] usb 1-1.3.4: SerialNumber: 00E04C360941
[696615.641285] usbcore: registered new interface driver cdc_ether
[696615.723156] usb 1-1.3.4: reset high-speed USB device number 6 using dwc_otg
[696615.863965] r8152 1-1.3.4:1.0 eth0: v1.08.0 (2015/01/13)
[696615.864480] usbcore: registered new interface driver r8152

Plugged in Ethernet cable and got this:

Code: [Select]
tc@piCorePlayerHDMI:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:E0:4C:36:09:41
          inet addr:192.168.1.12  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:33 errors:0 dropped:1 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5200 (5.0 KiB)  TX bytes:1120 (1.0 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:87:35:1C:6F:85
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:190 errors:0 dropped:0 overruns:0 frame:0
          TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:32500 (31.7 KiB)  TX bytes:32723 (31.9 KiB)

lsmod gives this:

Code: [Select]
tc@piCorePlayerHDMI:~$ lsmod
Module                  Size  Used by    Not tainted
ctr                     4005  2
ccm                     8358  2
arc4                    1956  2
rt2800usb              18749  0
rt2x00usb              11916  1 rt2800usb
rt2800lib              81924  1 rt2800usb
rt2x00lib              48318  3 rt2800usb,rt2x00usb,rt2800lib
mac80211              624069  3 rt2x00usb,rt2800lib,rt2x00lib
cfg80211              500746  2 rt2x00lib,mac80211
snd_soc_bcm2708_i2s     7654  0
snd_soc_core          168317  1 snd_soc_bcm2708_i2s
r8152                  37386  0
rfkill                 22466  2 cfg80211
crc_ccitt               1620  1 rt2800lib
snd_pcm_dmaengine       5794  1 snd_soc_core
snd_compress            8861  1 snd_soc_core
regmap_mmio             3556  1 snd_soc_bcm2708_i2s
snd_bcm2835            22487  1
snd_pcm                93037  4 snd_soc_core,snd_pcm_dmaengine,snd_bcm2835
snd_timer              24444  1 snd_pcm
snd                    68803  6 snd_soc_core,snd_compress,snd_bcm2835,snd_pcm,snd_timer
cdc_ether               5582  0
i2c_bcm2708             6208  0
spi_bcm2835             7880  0
bcm2835_gpiomem         3703  0
bcm2835_rng             2207  0
uio_pdrv_genirq         3670  0
uio                    10078  1 uio_pdrv_genirq

It works!

regards
Greg

Offline strebor

  • Newbie
  • *
  • Posts: 15
Re: Pi Zero usb LAN adapter
« Reply #13 on: June 29, 2016, 07:43:02 AM »
Greg, thanks for the detained post. I don't think the module is loaded on the Pi Zero, now I know what I should see from lsmod I'll work on that.
Kind regards, Strebor.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Pi Zero usb LAN adapter
« Reply #14 on: June 29, 2016, 09:25:19 AM »
Is your USB adapter recognized? Check with lsusb.

Look for related messages in dmesg.

Béla
Ham Radio callsign: HA5DI

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