Power & Source of Big Ideas

NanoPi Duo - Ethernet over USB OTG

Moderators: chensy, FATechsupport

Hi,

I'm trying to connect from my Linux machine to my NanoPi Duo over USB OTG using ethernet module.

I have loaded g_ether module:

Code: Select all

root@NanoPi-Duo:~# lsmod
Module                  Size  Used by
nls_ascii              16384  1
xradio_wlan           110592  1
g_ether                16384  0


I see it as Ethernet device from my Linux machine:

Code: Select all

# lsusb
...
Bus 001 Device 010: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget
...


On both machines

Code: Select all

# ls /sys/class/net

Lists usb0

I run following command on my Linux machine to start communication, but get:

Code: Select all

# pump -h usbether -i usb0 --no-dns --keep-up --no-resolvconf --no-ntp
Operation failed.


Some other information:

Code: Select all

root@NanoPi-Duo:~# dmesg | egrep "usb0|g_ether"
[    3.299153] usb0-vbus: disabling
[   12.166744] usb0: HOST MAC 1a:a8:b0:57:dd:70
[   12.171312] usb0: MAC 06:40:18:06:db:a1
[   12.189331] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[   12.196003] g_ether gadget: g_ether ready
[   12.829197] g_ether gadget: high-speed config #1: CDC Ethernet (EEM)


Code: Select all

root@NanoPi-Duo:~# ifconfig usb0
usb0      Link encap:Ethernet  HWaddr 06:40:18:06:db:a1
          BROADCAST MULTICAST  MTU:1500  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:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


What I'm missing? Ethernet over OTG with my mobile phone worked w/o any issues.

Thanks,
Gedas
Answering to my question as I managed to solve it :)
`pump` command is not needed. What did help is adding to /etc/network/interfaces:

Code: Select all

allow-hotplug usb0
iface usb0 inet static
        address 192.168.7.2
        netmask 255.255.255.0
        network 192.168.7.0
        broadcast 192.168.7.255
        gateway 192.168.7.1

On both machines, just with different IPs. .1 on host, and .2 on OTG.

Thanks!

Who is online

In total there are 21 users online :: 0 registered, 0 hidden and 21 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 21 guests