Monthly Archives: February 2019

Beginner: OpenWrt 18.06.02 stable version

    1. Download from github,

      git clone https://github.com/openwrt/openwrt.git

    2. Checkout stable version 18.06.02, go to new openwrt folder then

      git checkout v18.06.2

    3. Install and  update LuCI, in openwrt folder,
      1. ./scripts/feeds update luci
      2. ./scripts/feeds install -a -p luci
    4. Install vocore2 patch to package, cd openwrt/package, 

      git clone https://github.com/vonger/vocore2.git

    5. Patch openwrt with VoCore2 addition feature support. in openwrt folder,

      patch -p1 < ./package/vocore2/mt7628/openwrt/000-vocore2-compatible.patch

    6. Patch LuCI with VoCore2 addition feature support. patch -p1 < ./package/vocore2/mt7628/openwrt/luci/*.patch

    7. Copy iwinfo patch to iwinfo folder

      1. mkdir ./package/network/utils/iwinfo/patches
      2. cp ./package/vocore2/mt7628/openwrt/080-iwinfo-compatible-ralink.patch ./package/network/utils/iwinfo/patches/
    8. Patch openwrt with VoCore2 es8388 patch for sound.
      1. patch -p1 < ./package/vocore2/es8388/openwrt/000-openwrt-compatible-sound.patch
      2. cp ./package/vocore2/es8388/openwrt/810-es8388-support.patch ./target/linux/ramips/patches-4.14/
    9. Follow the README.md in ./package/vocore2/README.md: 3. config mt7628 in make menuconfig

VoCore2: Develop on Qt Creator

For the people who do not like Java, now we can use Qt creator to make and debug our application remotely instead of Eclipse.

First, better to use 20190127.bin as your firmware, after the tutorial, once you connect VoCore2 to internet, it is easy for you to download applications from openwrt.

We need to install some packages on VoCore2:

opkg install openssh-sftp-server
opkg install libstdcpp
opkg install gdbserver

Now VoCore has setup.

Let’s setup Qt and openwrt on your PC.

  1. We need to patch gdb, I have submitted the patch to github.com/vonger/vocore2, just do all the compile as Beginner Tutorial, it will be ready.
  2. Install gdb. Ye, it is right, if we do not install gdb there will missing some package.
    1. goto path/to/openwrt/build_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/gdb-8.0.1
    2. call “make install”
  3. Make and install Qt.
    1. in make menuconfig -> Library -> Qt5, you can select qt5-core, and ‘M’ is OK, it is pretty big, so do not select as ‘*’
    2. make everything, takes pretty long time.
    3. goto path/to/build_dir/target-mipsel_24kc_musl/qt-everywhere-opensource-src-5.9.7
    4. call “make install”

Final step, setup Qt creator on your PC(path is just example, use your path of openwrt).

    1. Qt Creator -> Preferences -> Devices -> Devices -> Add -> Generic Linux Device
      • Name: VoCore2
      • Authentcation Type: Password
      • Host name: 192.168.61.1
      • SSH port: 22
      • Username: root
      • Password: vocore
    2. Qt Creator -> Preferences -> Kits -> Compilers -> Add -> GCC -> for both C/C++
      • Name: VoCore2 GCC and VoCore2 G++
      • Compiler path (GCC): openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-gcc
      • Compiler path (G++): openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-g++
    3. Qt Creator -> Preferences -> Kits -> Compilers -> Debuggers -> Add
      • Name: VoCore2 GDB
      • Path: path/to/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-gdb
    4. Qt Creator -> Preferences -> Kits -> Qt Versions -> Add.
      • Version Name: Qt 5.9.7 for VoCore2 mips
      • qmake location: path/to/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/qmake
    5.  Qt Creator -> Preferences -> Kits -> Kits -> Add.
      • Name: VoCore2 Qt 5.9.7 (gcc OpenWrt mips)
      • Device Type: Generic Linux Device
      • Device: Generic Linux Device (default for Generic Linux)
      • Compiler: C, VoCore2 GCC; C++, VoCore2 G++
      • Debugger: VoCore2 GDB
      • Qt version: Qt 5.9.7 for VoCore2 mips

Then create a project, in .pro file, add this lines:

target.path = /tmp
INSTALLS += target

Then you can debug it as your other Qt application.

note: for macos, you need to install texinfo, or gdb will fail to install.