VoCore2: Hack the Driver

Current VoCore2 default are using a blob wifi driver from link-it. So it is not very stable sometimes. Recently I just find MTK OPENWRT source code online and find there is an open-sourced wifi driver just in the dl folder, which is tested to be very stable. 🙂 Wahaha, let start the hack!!

Here is the clone of the source:  http://vonger.cn/misc/vocore2/mt7628-p4rev-113862.tar.bz2 (I find it by searching baidu(link here: http://www.openwrtdl.com/wordpress/mt76xx-p4rev%E7%B3%BB%E5%88%97%E4%B8%8B%E8%BD%BD), do not know wether or not ralink intent to public this, if not, please email to support@vocore.io. I will delete it. This source is only for study. )

I will spend hours on this driver everyday, and will show what I find on my blog. :p

Fix VoCore2 LuCI no WPA Issue

WPA

Everything works, just add two lines to file: /usr/lib/lua/luci/model/cbi/admin_network/wifi.lua

+encr:value("psk", translate("WPA PSK"), {mode="ap"}, {mode="sta"})
+encr:value("psk2", translate("WPA2 PSK"), {mode="ap"}, {mode="sta"})

 

Here is the patch:

--- a/usr/lib/lua/luci/model/cbi/admin_network/wifi.lua
+++ b/usr/lib/lua/luci/model/cbi/admin_network/wifi.lua 

@@ -689,6 +689,8 @@
encr:value("none", "No Encryption")
encr:value("wep-open", translate("WEP Open System"), {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"}, {mode="ahdemo"}, {mode="wds"})
encr:value("wep-shared", translate("WEP Shared Key"), {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"}, {mode="ahdemo"}, {mode="wds"})
+encr:value("psk", translate("WPA PSK"), {mode="ap"}, {mode="sta"})
+encr:value("psk2", translate("WPA2 PSK"), {mode="ap"}, {mode="sta"})

if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
local supplicant = fs.access("/usr/sbin/wpa_supplicant")

 

I will add this patch to later firmware at Apr 🙂

Lite: Shipping…

Just in short, we are shipping them 😉

Once it is online(around next Monday), please trace it at bottom of vocore.io by your email.

PoE Version Ready

Finally find the problem, it is simple and stupid, I place an electrolytic capacitor at wrong direction… 🙂

Continue do more test…Hopefully tomorrow I will get good result.

PS: we contacted the factory about the lite version, sadly, they find the sample is not work, reason is simple,  crystal and a capacitor are short circuit, have to delay two days.

VoCore2: Process..

Good news is VoCore2 Lite batch almost done 🙂 The factory will start test them tomorrow,  and we can ship all of them in this month.

Bad news is I get a lot of trouble when develop the PoE version… The heat, the strong EMC all solved but still something wrong.. Just feel like back to the noob time. :'(

I know, you know, everybody knows, as a developer,  we always have couple of days every month — everywhere is a dead end…

Hope this pass soooon…

This is also why I love this job.

can not write anymore…work, work 🙂

VoCore2 Firmware: Compile from Source

How stupid I am… I could do this months ago. Just remove the folder named bin, staging_dir, build_dir, dl, then compress, the source code is small enough to download.

 

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

3. download openwrt at vonger.cn/misc/vocore2/openwrt.tar.bz2

4. call “tar -jxvf openwrt.tar.bz2” to uncompress the package.

5. call “make menuconfig” in the openwrt folder, configure openwrt in menu, choose MT7688/28/VoCore2 in menu.

6. call “make” in the openwrt folder, start the make process

 

PS: recently I have no word about the lame post carrier…

VoCore2: EAGLE version PCB

Now, we convert the raw PCB file to EAGLE. I guess this should help a lot of people who are using EAGLE 🙂

Source could download here: http://vonger.cn/misc/vocore2/source.zip, in the zip file name is vocore-eagle.pcb.

eagle

VoCore2: Convert into NAS

It is very simple to make SD card or a hard disk into Network Attached Storage.

Here is mine: I use it as a tiny git server to storage code, save some money to rent the private cloud on github 🙂

1. insert your microsd card(or USB disk) to VoCore2

IMG_0241
IMG_0245
IMG_0244

once you insert the card or disk, you will find it mounted in /mnt.

Screen Shot 2016-12-02 at 09.24.02
mmcblk0p2 is for the SD card, sda2 is for USB disk.

2. setup ap+sta: read this blog http://vonger.cn/?p=2691
Or read the tutorial on vocore.io/v2u.html(do not forget setup /etc/config/firewall). If you do not use wireless connect to your local network, ignore this step.

3. enable samba on VoCore2(latest firmware already have samba, please download at http://vonger.cn/misc/vocore2/ultimate.20161114.bin

Or call “opkg update; opkg install luci-app-samba”

Screen Shot 2016-12-02 at 09.23.04

Screen Shot 2016-12-02 at 09.24.37
Fill the path and any name you want, enable guest will allow everybody in your network view the share folder, be careful.
Note: do not forget click “Save & Apply”.

4. Now you can find your NAS every where 🙂

On Mac or PC:
Screen Shot 2016-12-02 at 09.57.37

note1: you might need to setup your VoCore2 local ip. mine is 192.168.1.113.
uci set samba.@samba[0].interface=’127.0.0.1/8 lo 192.168.1.113/24 br-lan’
uci commit samba
/etc/init.d/samba restart

note2: you might need to setup your VoCore2 firewall.

On Phone:
S61202-093152

VoCore2: AP + STA

It is not same as VoCore v1.

 

Just run this script every time you start VoCore2, you will able to make it into AP + STA mode.

If you do not run this script, it will go to AP mode.


uci set wireless.sta.ssid=[HOME AP SSID]
uci set wireless.sta.key=[AP PASSWORD]
uci set wireless.sta.network=wwan
uci set wireless.sta.disabled=0
uci commit
/etc/init.d/network restart
sleep 10
uci set wireless.sta.disabled=1
uci commit

This is not the best solution.
So I just remember one day Vernon Van Steenkist send me one script for VoCore.


#!/bin/sh
#
# Fix loss of AP when STA (Client) mode fails by reverting to default
# AP only configuration. Default AP configuration is assumed to be in
# /etc/config/wireless.ap-only
#

TIMEOUT=30
SLEEP=3

sta_err=0

while [ $(iwinfo | grep -c “ESSID: unknown”) -ge 1 ]; do
let sta_err=$sta_err+1
if [ $((sta_err * SLEEP)) -ge $TIMEOUT ]; then
cp /etc/config/wireless.ap-only /etc/config/wireless
wifi up
# uncomment the following lines to try AP+STA after reboot
# sleep 3
# cp /etc/config/wireless.ap+sta /etc/config/wireless
break
fi

sleep $SLEEP

done

This code is clever, using iwinfo to check if the STA is in normal state.
If after 30 seconds we still can not get into STA mode, we back to AP mode.
This works for VoCore.

For VoCore2, it is slightly different. If we failed to connect to STA, it will not block AP mode.

We can do this to setup your home AP one time:


uci set wireless.sta.ssid=[HOME AP SSID]
uci set wireless.sta.key=[AP PASSWORD]
uci set wireless.sta.network=wwan
uci set wireless.sta.disabled=1
uci commit

then put the following code into /etc/rc.local(run at every startup)


uci set wireless.sta.disabled=0
uci commit
/etc/init.d/network restart
sleep 10
uci set wireless.sta.disabled=1
uci commit

After this, your VoCore2 is able to connect/disconnect STA automatically. Even carry VoCore2 to another position without your home ap, it will still working.