[vc_row][vc_column][vc_column_text]pcDuino3 can be used as the platform for software defined network research and development work. In this post, we show how to add more Ethernet ports to pcDuino3 by using the network USB adapter.
We installed three network USB adapters to pcDuino3 through a USB hub.
[/vc_column_text][vc_tour][vc_tab title=”Build kernel to Support the USB network adapter” tab_id=”1404193377-2-26″][vc_column_text]The USB network adapter is not supported by the pcDuino3 kernel. So we need to build the driver into the kernel. The detailed steps to build the kernel for pcDuino3 can be found at here.
Plug in the USB network adapter into the USB port, and check the USB network adapter model by:
$lsusb Bus 001 Device 002: ID 0bda:8179 Realtek Semiconductor Corp. Bus 004 Device 002: ID 0fe6:9700 Kontron (Industrial Computer Source / ICS Advent) DM9601 Fast Ethernet Adapter Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
We found out that the model is DM9601.
Next we need to configure the kernel:
Device Drivers —> [*] Network device support —> USB Network Adapters —> <M> Davicom DM9601 based USB 1.1 10/100 ethernet devices
We can also select other models so that other models can be used.
After done with the configuration, we proceed to build the kernel. Once its done, we will get two files: pcduino3_a20_hwpack_20140630.tar.xz and pcduino3_a20_kernel_livesuit_20140630.img.pcduino3_a20_kernel_livesuit_20140630.img is the kernel image that we will use to burn the kernel. Next step is to flash the roofts, which can still use the released version.
[/vc_column_text][/vc_tab][vc_tab title=”Replace Driver” tab_id=”1404193377-1-84″][vc_column_text]After done with the rootfs, reboot pcDuino, and copy pcduino3_a20_hwpack_20140630.tar.xz to the home directory of pcDuino.
Unzip the driver:
$sudo cp rootfs/lib/modules/3.4.79+/ /lib/modules/ -rf
Copy ko files to the driver location:
$sudo cp rootfs/lib/modules/3.4.79+/ /lib/modules/ -rf
With USB Ethernet adapter plug in, we reboot pcDuino3:
$lsmod
root@ubuntu:/home/ubuntu/sample# lsmod Module Size Used by sun4i_csi0 23751 0 videobuf_dma_contig 5503 1 sun4i_csi0 videobuf_core 15064 2 sun4i_csi0,videobuf_dma_contig gc2035 12186 1 gc0308 10570 0 g_ether 45227 0 sw_usb_udc 20366 0 udc_core 5289 2 g_ether,sw_usb_udc rt5370sta 617601 0 dm9601 7033 0 qf9700 6539 0 usbnet 16076 2 dm9601,qf9700 8188eu 475883 0 8192cu 433928 0 mali_drm 2095 1 drm 156592 2 mali_drm mali 91542 0 disp_ump 691 0 ump 44094 4 mali,disp_ump
When we have 3 adapters, we will get:
ubuntu@ubuntu:~$ ifconfig eth0 Link encap:Ethernet HWaddr 02:ca:06:83:13:fb UP 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) Interrupt:87 Base address:0xa000 eth1 Link encap:Ethernet HWaddr 00:e0:4c:53:44:58 UP 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) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:694 (694.0 B) TX bytes:694 (694.0 B) rename7 Link encap:Ethernet HWaddr 00:e0:4c:53:44:58 UP 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) rename9 Link encap:Ethernet HWaddr 00:e0:4c:53:44:58 UP 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) usb0 Link encap:Ethernet HWaddr 00:11:22:33:44:55 UP 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) wlan5 Link encap:Ethernet HWaddr cc:d2:9b:2f:eb:d4 inet addr:192.168.1.15 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::ced2:9bff:fe2f:ebd4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3182 errors:0 dropped:3343 overruns:0 frame:0 TX packets:1389 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:493743 (493.7 KB) TX bytes:1634861 (1.6 MB)
We can see that the other 2 USB Ethernet adapters have been displayed as rename7 and rename 8.
ubuntu@ubuntu:~$ leafpad /etc/udev/rules.d/70-persistent-net.rules[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.