Compiling new packages for OpenWrt. USB over IP for LinkIt 7688
There is certain information gap about compiling new packages for “OpenWrt” operating system especially for a people who are new in that…
Compiling new packages for OpenWrt. USB over IP for LinkIt 7688
There is certain information gap about compiling new packages for “OpenWrt” operating system especially for a people who are new in that area. This blog post will mirror my experience to that.
Recently I was participating in “MediaTek” challenge in which it was required to build some project |product using their development boards called LinkIt. In my case I’ve chosen LinkIt 7688 DUO, what is 40 pin breakout board supplied with 580MHz MIPS processor, 128MB DDR2 RAM, 32MB of flash memory, and WiFi stack. Since it is DUO version it also has Atmega MCU which can be programmed using Arduino IDE, and it is connected to CPU using serial interface. Such heterogeneous approach, let you run some functionality outside main CPU, say you need to process ADC or drive servo motors, you can use all power of Arduino community and libraries , what I see great benefit.
The board runs OpenWrt operating system, which is kind of OS for routers and embedded systems. It is pretty neat board , and it can be used in various kind of applications. I would say that this board is something between ESP an RaspberryPi.
So, getting back to my project. The idea was to using LinkIt as a bridge between LeapMotion controller and PC, since LeapMotion SDK can be used only on i386 or amd64 architectures. For that purposes I decided to use USBIP utility. This utility allows to encapsulate USB enumerations and data packets into TCP packets, and transfer them over network.Then on the other site it decapsulates packages and it is acting like you connected USB device directly to your computer. The only one thing — original LinkIt firmware image does not include this package. It is even not included in official repository, and can not be pulled down by ipkg utility. Second strange thing is that kernel modules exist for that package, such are kmod-usbip, kmod-usbip-client, kmod-usbip-server. Then there is only one option — compile this package manually.
I decided to build entire OpenWrt binary image for LinkIt board, with all necessary packages included. First thing first, it is necessary to setup build environment on Linux. In my case it was Ubuntu 14.04. It is also preferable to have good hardware, since compilation process could take some amount of time. Off course, I could use my laptop for that, but I had Microsoft Azure subscription (#WeAreInFlux) , and made setup of build server in cloud. Once you logged in bash console you can begin.
At first you need to get all necessary tools for building:
$ sudo apt-get install git g++ make libncurses5-dev subversion libssl-dev gawk libxml-parser-perl unzip wget python xz-utils
Then download OpenWrt sources, last version at the moment is 15.05:
$ git clone git://git.openwrt.org/15.05/openwrt.git
After, it is necessary to add so called feeds. Feeds are sources of modules which OpenWrt will consist from. Since we are using LinkIt 7688 we need to add feed for that. It is needed because it consist some hardware specific things such as WiFi driver.
By default feeds sources are store in feeds.conf file. So let’s make it:
$ cd openwrt
$ cp feeds.conf.default feeds.conf
Then add feed for LinkIt:
$ echo src-git linkit https://github.com/MediaTek-Labs/linkit-smart-7688-feed.git >> feeds.conf
The USBIP package is stored in other place, there is separate repository for packages. We can download all of packages, and then choose only needed.
$ cd ..
$ git https://github.com/openwrt/packages
Then we need to make folder customfeed and copy there usbip and eudev folders.
$ mkdir customfeed
$ cp -rf ./packages/net/usbip ./customfeed
$ cp -rf ./packages/utils/eudev ./customfeed
After, update feed source to getting stuff from local folder.
$ cd openwrt
$ echo src-link customfeed ../customfeed >> feeds.conf
And then we need to update and install.
$ ./scripts/feeds update
$ ./scripts/feeds install -a
Previous operations will take some time to execute, after it completes we can run menu config.
$ make menuconfig
Select LinkIt7688 board as shown in picture below:

Then it is necessary to select usbip so that * should appear in brackets, this will include package in binary image. It is under Network menu.

Save and exit. At this point we can almost start compilation. However I overcome with two errors during process. It can be fixed following:
$ cd feeds/linkit/mtk-sdk-wifi/wifi_binary
$ cp mt_wifi.ko_3.18.44 mt_wifi.ko_3.18.45
$ cp mt_wifi.ko_3.18.44_all mt_wifi.ko_3.18.45_all
$ cd ../../../../
Second fix you should apply to Makefile located in openwrt/package/network/services/samba36/ . In all links it is necessary to replace http to https.
Now it is moment to start compilation.
$ make V=99 -j 3
In last command by -j parameter we define number of threads used during compilation. This number should be number of CPUs + 1. Number of CPUs can be checked by nproc command.
Compilation process will take some amout of time. As resut binary image called openwrt-ramips-mt7688-LinkIt7688-squashfs-sysupgrade.bin will be located in bin/ramips folder.
To upgrade new firmware on LinkIt7688, you should rename this file to lks7688.img and copy it to flash stick.
Connect USB stick to LinkIt using OTG cable, and hold key 5 during boot. This will start to flashing new firmware to board.
After that usbip package will be available from command line on LinkIt.
Now it is time to check it connect some USB device to USB OTG cable. Use following command to list available devices to connect:
root@mylinkit:~# usbip list -l
- busid 1-1 (f182:0003)
Leap Motion : Controller (f182:0003)
Now we can bind this device.
root@mylinkit:~# usbip bind --busid=1-1
usbip: info: bind device on busid 1-1: complete
And start USBIP daemon:
root@mylinkit:~# usbipd -D
On host computer it is necessary to enable some kernel modules:
$ sudo modprobe usbip-core
$ sudo modprobe usbip-host
$ sudo modprobe vhci-hcd
Then you can attach device to host:
$ sudo usbip attach -r 192.168.43.195 --busid=1-1
After that we can check if device is connected:
$ lsusb
Bus 005 Device 010: ID f182:0003 Leap Motion Controller
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
As you can see LeapMotion is successfully attached to host PC. Unfortunately LeapMotion cannot run properly, since wireless bandwidth is not enough .
However it can be used in various kind of application, it still possible to connect HID devices, printers.
메타데이터
- post_id
- dab8bf393a93
- slug
- compiling-new-packages-for-openwrt-usb-over-ip-for-linkit-7688-dab8bf393a93
- url
- https://medium.com/@aleksandrslevinskis/compiling-new-packages-for-openwrt-usb-over-ip-for-linkit-7688-dab8bf393a93
- canonical_url
- https://medium.com/@aleksandrslevinskis/compiling-new-packages-for-openwrt-usb-over-ip-for-linkit-7688-dab8bf393a93
- author_url
- https://medium.com/@aleksandrslevinskis
- status
- ok
- fetched_at
- 2026-07-30 14:44:54