Daily Archives: 2019-01-24

Beginner: OpenWrt 18.06 stable version 3

OK, now install luci for noobs 🙂

install LuCI for openwrt.

./scripts/feeds update luci
./scripts/feeds install -a -p luci

note: if you download speed is slow from openwrt.org, you can modify ./feeds.conf.default, change its ‘https://git.openwrt.org/feed/’ to ‘https://github.com/openwrt/’, then do it feeds update/install again, github should be much faster.

After this we have LuCI, as usual, patch it…
patch is at ./feeds/vocore2/mt7628/openwrt/luci/010-luci-vocore2-compatible.patch

note: this patch is to enable LuCI setting WPA2 for wireless.

This is for latest LuCI, so do not compatible with 18.06, need a little change, because some people change the folder name from luci-mod-admin-full to luci-mod-network. So we just change luci-mod-network in the patch back to luci-mod-admin-full.

After the change, now we can patch it, run patch in openwrt folder.


patch -p1 < ./package/kernel/mt7628/openwrt/luci/*.patch

Now make menuconfig, select LuCI -> Collections -> luci
Then compile, you will get firmware at ./bin/targets/ramips/mt76x8/openwrt-ramips-mt76x8-vocore2-squashfs-sysupgrade.bin

Beginner: OpenWrt 18.06 stable version 2

Continue…

Why we can not use official version:

1. its wifi is default disabled.
2. it do not have default password.
3. its wifi driver is not works well.

And point 1,2,3, openwrt do not allow me submit patch, because it will broken other device. Point 3 is pretty important, use official mt76 driver, wireless speed only 5~10Mbps, and frequently disconnect…

So as openwrt community suggested, I have to use external patch. Some patch like SD card fix etc that they allow to submit, already in the openwrt source code.

=================================================================

Now, we need to port mt7628 driver to replace official mt76 driver for better speed and experience.

PS: use non-official driver also brings new problem, because it do not support standard linux wireless interface, have to patch LuCI and iwinfo to make it work…that is a lot of work and bring in bugs. So best way is to fix that mt76 driver. I am trying, but it is very long code hard to read…

I have tutorial about how to imply mt7628 driver, it is at https://github.com/vonger/vocore2, just copy it here

How to use it
1. add this feeds to your openwrt source.

cd ~/openwrt
cp feeds.conf.default feeds.conf
echo src-git vocore2 https://github.com/vonger/vocore2.git >> feeds.conf
./scripts/feeds update vocore2
cp -r ./feeds/vocore2/mt7628 ./package/kernel

2. patch your openwrt with necessary patches to use this driver.

cd ~/openwrt
patch -p1 < ./package/kernel/mt7628/openwrt/000-*.patch

mkdir ./package/network/utils/iwinfo/patches
cp ./package/kernel/mt7628/openwrt/080-*.patch ./package/network/utils/iwinfo/patches

3. config mt7628 in make menuconfig Kernel modules -> Wireless Drivers -> kmod-mt7628
Target System: MediaTek Ralink MIPS
Subtarget: MT76x8 based boards
Kernel modules -> Wireless Drivers -> unselect kmod-mt76 / select kmod-mt7628 -> select WiFi Operation Mode -> enable AP-Client support for AP+STA mode; enable SNIFFER for monitor mode.
Base System -> select wireless-tools (need its iwpriv)
Network(option): unselect wapd-mini/hostapd-common (mt7628.ko already have WPA support)
Global build settings(option): Kernel build options -> /dev/mem virtual device support(enable /dev/mem for easy debug)
Global build settings(option): unselect Cryptographically signed package lists (this will block compile)

When apply the patch, there is an small warning: openwrt/target/linux/ramips/base-files/etc/board.d/01_leds
PS: It is because my patch is for latest trunk, so it not patch well.

just delete openwrt/target/linux/ramips/base-files/etc/board.d/01_leds.orig, and modify openwrt/target/linux/ramips/base-files/etc/board.d/01_leds

1. remove this if there is any:

vocore2)
set_wifi_led "$boardname:fuchsia:status"
;;
vocore2lite)
set_wifi_led "$boardname:green:status"
;;

2. keep this lines:

vocore2)
set_wifi_led "$boardname:fuchsia:status" "ra0"
;;
vocore2lite)
set_wifi_led "$boardname:green:status" "ra0"
;;

If you can not do this, please read some tutorials about “How to use patch”
Or lazy way, just remove 01_led patch from the pacth file in openwrt/package/kernel/mt7628/openwrt/000-vocore2-compatible.patch it will cause VoCore2 LED do not flash after wifi connected.

Finally, we can make, after that, we can get a firmware with mt7628 driver support.
PS: make will take hours, so be patient…

Beginner: OpenWrt 18.06 stable version 1

Actually there is a lot of tutorials already, but maybe we need to restart a full version. And some people just want to use the final firmware without compile, sooooo, anyway, OK, now let’s start compile 18.06 from scratch..

note: I assume you already have some knowledge about Linux and compile(such as gcc, makefile). If not, come back later, I will release a firmware, you can directly upgrade your VoCore2.

Prepare a develop environment, which is necessary 🙂
I have write this in vocore.io/v2.html

Prepare VM for VoCore2
video tutorial: https://youtu.be/ocl6yFtKSNs

1. install Ubuntu 14.04 64bit Server to Virtual Machine.

2. in virtualbox, we will need install some packages to compile openwrt:

sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev ncurses-term zlib1g-dev libssl-dev python git

We need to compile from openwrt 18.06 stable version, need to get its source code, type this command in console of Ubuntu.

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

It will show something like this:

Cloning into 'openwrt'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 452174 (delta 11), reused 0 (delta 0), pack-reused 452155
Receiving objects: 100% (452174/452174), 156.94 MiB | 8.31 MiB/s, done.
Resolving deltas: 100% (306772/306772), done.
Checking out files: 100% (8172/8172), done.

Now we have openwrt trunk in current folder, but we need to switch it back to old version v18.06.1, we need to use git.

git checkout v18.06.1

It is version 18.06.1 now, once we compile it, it is the ‘stable’ version.

call “make menuconfig”

note: for macos, already embed getopt, it will report error: –long do not support. so we need to install gnugetopt and add its path to $PATH to cover default system one.

now, we can select in menu:

Target System (MediaTek Ralink MIPS)
Subtarget (MT76x8 based boards)
Target Profile (VoCore VoCore2)

Exit and compile by make, we have the official version.
Official version wifi is not very good, have to continue the fix. 🙂

PS: VoCore2 and VoCore2 Ultimate both using “VoCore VoCore2” config, because they both have same 128MB memory and 16MB flash. VoCore2 Lite is 8MB flash and 64MB memory, so need to use other configure.