小荷

生活记录

0%

pdftk删除页码脚本

最近把《Linux命令行与shell脚本编程大全》翻了一遍,想演练一下,于是写出了下面这个脚本,用于调用pdftk删除给定页码生成新文档。编写调试过程中,对bash函数传参、位置参数调用等概念有了更深入的理解,特别是shift,用于处理数量未知的位置参数格外好用。

pdftool.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/bash
# 对pdftk的简单封装,用于删除指定的页码,以空格分隔,支持形如"5-7"的页码范围。页码输入不必按顺序,类似"12 6-8 1 3"输入是可以正常工作的。

#isPdftkinstalled作用为检查pdftk是否可用,若可用则执行pdftk --version
function isPdftkinstalled {
echo
if [ -z $(whereis pdftk | gawk '{print $2}') ]
then
echo "pdftk未安装或未加入PATH,请检查。"
echo "提示:pdftk已加入Deepin官方源,您可以通过 sudo apt install pdftk 简单安装。"
else
echo $(pdftk --version)
fi
echo
}

#getCouples作用为对输入的页码进行处理,支持输入单页或页码范围,将其转换为数对(获取范围前后页码,以冒号分隔)
function getCouples {
local couples=''
local left_end=''
local right_end=''
while [ -n "$1" ]
do
arg1=$(echo "$1" | gawk -F"[- ]" '{print $1}')
arg2=$(echo "$1" | gawk -F"[- ]" '{print $2}')
left_end=$[ $arg1 - 1 ]
#对应页码范围情况
if [ -n "$arg2" ]
then
right_end=$[ $arg2 + 1 ]
else
#对应单页情况
right_end=$[ $arg1 + 1 ]
fi
couples=$(echo $couples $left_end:$right_end)
shift
done
#数对排序处理,注意sort是针对行的排序,故需要将空格转换成换行
couples=$(echo $couples | tr " " "\n" | sort -t ':' -k 1 -n)
couples=$(refineCouples $couples)
echo $couples
}

#refineCouples作用为合并相邻数对,供getCouples调用
function refineCouples {
local args=''
local isNabour=''
local Num1=$(echo $1 | cut -d ":" -f1)
local Num2=$(echo $1 | cut -d ":" -f2)
local Num3=''
local Num4=''
shift
while [ -n "$1" ]
do
Num3=$(echo $1 | cut -d ":" -f1)
Num4=$(echo $1 | cut -d ":" -f2)
isNabour=$[ $Num2 - $Num3 ]
if [ $isNabour -eq 1 ]
then
Num2=$Num4
else
args=$(echo $args $Num1:$Num2)
Num1=$Num3
Num2=$Num4
fi
shift
done
args=$(echo $args $Num1:$Num2)
echo $args
}

#generateRanges作用为将数对转换为pdftk可用的页码范围
function generateRanges {
local first_Bit=$(echo $1 | cut -d ":" -f1)
local Num1=''
local Num2=''
local args=''
while [ -n "$1" ]
do
Num1=$(echo $1 | cut -d ":" -f2)
if [ -n "$2" ]
then
Num2=$(echo $2 | cut -d ":" -f1)
if [ $Num1 -gt $Num2 ]
then
Num2=$Num1
fi
else
Num2="end"
fi
shift
args=$(echo $args $Num1-$Num2)
done

if [ $first_Bit -gt 0 ]
then
args=$(echo 1-$first_Bit $args)
fi
echo $args
}

#此函数作用为合并相邻页码范围,在使用refineCouples后已无使用必要,可删除
function refineRanges {
local args=''
local isNabour=''
local Num1=$(echo $1 | cut -d "-" -f1)
local Num2=$(echo $1 | cut -d "-" -f2)
local Num3=''
local Num4=''
shift
while [ -n "$1" ]
do
Num3=$(echo $1 | cut -d "-" -f1)
Num4=$(echo $1 | cut -d "-" -f2)
isNabour=$[ $Num3 - $Num2 ]
if [ $isNabour -eq 1 ]
then
Num2=$Num4
else
args=$(echo $args $Num1-$Num2)
Num1=$Num3
Num2=$Num4
fi
shift
echo $Num1
done
args=$(echo $args $Num1-$Num2)
echo $args
}

pdfFile=$1
shift
if [ $# -lt 2 ]
then
echo "Usage:pdftool [filename] [discard pages]"
exit
fi

pagesConserved=$(generateRanges $(getCouples $*))
pdftk_command=$(echo pdftk $pdfFile cat $pagesConserved output new_$(basename ${pdfFile}))
#echo $pdftk_command
$pdftk_command

根据大佬指点,使用bash自身的字符串展开替代cut命令:

pdftool.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
# 对pdftk的简单封装,用于删除指定的页码,以空格分隔,支持形如"5-7"的页码范围。页码输入不必按顺序,类似"12 6-8 1 3"输入是可以正常工作的。

#isPdftkinstalled作用为检查pdftk是否可用,若可用则执行pdftk --version
function isPdftkinstalled {
echo
if [ -z $(whereis pdftk | gawk '{print $2}') ]
then
echo "pdftk未安装或未加入PATH,请检查。"
echo "提示:pdftk已加入Deepin官方源,您可以通过 sudo apt install pdftk 简单安装。"
else
echo $(pdftk --version)
fi
echo
}

#getCouples作用为对输入的页码进行处理,支持输入单页或页码范围,将其转换为数对(获取范围前后页码,以冒号分隔)
function getCouples {
local couples=''
local left_end=''
local right_end=''
while [ -n "$1" ]
do
arg1=$(echo "$1" | gawk -F"[- ]" '{print $1}')
arg2=$(echo "$1" | gawk -F"[- ]" '{print $2}')
left_end=$[ $arg1 - 1 ]
#对应页码范围情况
if [ -n "$arg2" ]
then
right_end=$[ $arg2 + 1 ]
else
#对应单页情况
right_end=$[ $arg1 + 1 ]
fi
couples=$(echo $couples $left_end:$right_end)
shift
done
#数对排序处理,注意sort是针对行的排序,故需要将空格转换成换行
couples=$(echo $couples | tr " " "\n" | sort -t ':' -k 1 -n)
couples=$(refineCouples $couples)
echo $couples
}

#refineCouples作用为合并相邻数对,供getCouples调用
function refineCouples {
local args=''
local isNabour=''
#local Num1=$(echo $1 | cut -d ":" -f1)
#local Num2=$(echo $1 | cut -d ":" -f2)
local Num1=${1%%:*}
local Num2=${1##*:}
local Num3=''
local Num4=''
shift
while [ -n "$1" ]
do
Num3=${1%%:*}
Num4=${1##*:}
isNabour=$[ $Num2 - $Num3 ]
if [ $isNabour -eq 1 ]
then
Num2=$Num4
else
args=$(echo $args $Num1:$Num2)
Num1=$Num3
Num2=$Num4
fi
shift
done
args=$(echo $args $Num1:$Num2)
echo $args
}

#generateRanges作用为将数对转换为pdftk可用的页码范围
function generateRanges {
local first_Bit=${1%%:*}
local Num1=''
local Num2=''
local args=''
while [ -n "$1" ]
do
Num1=${1##*:}
if [ -n "$2" ]
then
Num2=${2%%:*}
if [ $Num1 -gt $Num2 ]
then
Num2=$Num1
fi
else
Num2="end"
fi
shift
args=$(echo $args $Num1-$Num2)
done

if [ $first_Bit -gt 0 ]
then
args=$(echo 1-$first_Bit $args)
fi
echo $args
}

pdfFile=$1
shift
if [ $# -lt 2 ]
then
echo "Usage:pdftool [filename] [discard pages]"
exit
fi

pagesConserved=$(generateRanges $(getCouples $*))
pdftk_command=$(echo pdftk $pdfFile cat $pagesConserved output new_$(basename ${pdfFile}))
#echo $pdftk_command
pdftk_command

可见使用bash本身的字符串替换更加高效灵活,通过#或%的数量可以制定首次匹配或最长匹配,用来截取文件名或后缀很有用。

bash递归函数测试

recursion_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# using recursion

function factorial {
if [ $1 -lt 1 ]
then
echo 0
elif [ $1 -eq 1 ]
then
echo 1
else
local temp1=$1
local temp2=$(factorial $[ $1 - 1 ])
local result=$[ $temp1 * $temp2 ]
echo $result
fi
}

function sumn {
if [ $1 -lt 1 ]
then
echo 0
elif [ $1 -eq 1 ]
then
echo 1
else
local temp1=$1
local temp2=$(sumn $[ $1 - 1 ])
local result=$[ $temp1 + $temp2 ]
echo $result
fi
}

function fbnq {
if [ $1 -lt 1 ]
then
echo 0
elif [ $1 -lt 2 ]
then
echo 1
else
local temp1=$(fbnq $[ $1 - 1 ])
local temp2=$(fbnq $[ $1 - 2 ])
local result=$[ $temp1 + $temp2 ]
echo $result
fi
}

read -p "Enter value: " value
result=$(factorial $value)
totalsum=$(sumn $value)
fibon=$(fbnq $value)
echo "The factorial of $value is: $result"
echo "The total sum of $value is: $totalsum"
echo "FibonacciRecursive of $value is: $fibon"

递归实现只有2步:构造递归表达式以及设定初值。

bash中简单函数数组传递

array_test.sh
1
2
3
4
5
6
7
8
9
10
#!/bin/bash
# array variable to function test
function testit {
local newarray
newarray="$@"
echo "The new array value is: ${newarray[*]}"
}
myarray=(1 2 3 4 5)
echo "The original array is ${myarray[*]}"
testit ${myarray[*]}

书中使用命令展开进行传值

1
newarray=($(echo "$@"))

经过试验,这种方式也可以:

1
newarray=("$@")

从输出来看一致,不过内在是否存在区别?

我自己来解答:

  1. newarray="$@" : newarray不是数组;
  2. newarray=("$@") : newarray是数组(套了圆括号)
  3. newarray=("$*") : newarray不是数组

对于第3点可以回顾一下$@$*的区别。$@中每个元素是独立的,$*只有一个元素。另外无论newarray是否为数组,${newarray[*]}都可以完整输出内容,因为当newarray不是数组的情况下,全部内容都在${newarray[0]}中,从标准输出来看没区别。

对于for而言数组与否没区别,它只会根据当前IFS分割元素。

再次回顾书中的方式:

1
newarray=($(echo "$@"))

这种方式看似愚笨,实则非常鲁棒。通过命令展开将不确定的输入类型输出成普通字符串,再套括号变成数组,值得品味。

bash中简单的bc计算

bc_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

var1=3.14
var2=5.2

var3=$(bc << EOF
scale = 4
a1 = $var1 + $var2
a2 = $var1 * $var2
a1 + a2
EOF
)

echo The final result is $var3

结果毫无悬念,24.668。注意这里用到了here document语法,行内重定向的一大用途便是方便在行间传递参数调用程序,通常搭配命令替换使用。另外注意,bc中引用外部变量(bash变量)时需要加$,bc中声明的变量是不需要的。

bash中简单的for循环

1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash for_test.sh
sum=0
i=$(echo {1..5})
echo "The content of list:$i"
for var in $i
do
echo "The current value is:$var"
sum=$[$sum+$var]
echo "The sum is: $sum"
done
echo "The final sum is: $sum"

感觉bash更适合编程入门,足够简单,少量知识就可以写出实用脚本实现对系统的自动化管理。许多“现代”语言虽然语法看起来“简单”,但是隐藏了许多细节,初学者到头来只会机械地调用模块,对于实际发生了什么毫无头绪,反而容易迷失方向。

它被大家叫做“咪咪”,今天也一早就守在门口~

拆机图

盒子与遥控器合影

硬件配置

处理器:Amlogic S905M-B,4核1.5GHz
存储:4GB EMMC
内存:1GB DDR3
有线网口:100M
无线网卡(2.4G):RTL8189ETV
TF卡槽:1个
USB接口(2.0):1个microUSB,1个A口
HDMI接口:1个
AV接口:1个(RET键在接口底部)
散热:优秀
电源:12V 1A,5.5mmX2.5mm
蓝牙:无
随机遥控器:优秀(具备学习功能)

线刷方式

准备工具

  • microUSB数据线
  • 运行Windows系统的电脑,推荐使用Win7和USB2.0。
  • 棉签
  • TF卡
  • 下载安装晶晨Burning_Tool(部分固件需要license文件否则显示刷机剩余次数为0)
  • 刷机镜像

    刷机镜像推荐

  • 潜龙固件 20171210_Q5_G2-40F_S905-S905M_android4.42_root_qlzy.rar ,自带root和bootloader,刷机方便,可用于救砖。
  • 乐天固件 Q5_晶晨S905M-安卓4.4.2-支持8189和7601无线-当贝华为logo和动画-多遥控支持线刷包-20201126版.rar,可惜不带root,没法方便自行替换遥控文件。
  • ATV固件 MXQ_PRO_4K_p201_android_TV_by cOOLio_V2.5_MEE.7z。这个是真正的ATV固件,自带root开关,可惜R3300-M 4G的EMMC存储实在捉襟见肘所以不太实用。注意刷入这个固件后盒子会解锁4K@60fps(先前最大4K@30fps),CPU性能测试提升19%,美中不足没法遥控器开机了。

    备份EMMC分区

    刷机前,强烈建议使用Armbian对EMMC分区进行备份,以免后悔。利用testdisk等工具从原厂EMMC镜像中也可以提取出遥控文件。盒子在刷机前无法启动高版本Armbian,推荐使用Armbian_5.44_S9xxx_Ubuntu_bionic_3.14.29_server_20180729.imgArmbian_5.99_Aml-g12_Ubuntu_bionic_default_5.3.0_rtl8189ftv.tar.gz。开机前,用棉签(去掉一头棉布)按住RST键进入Armbian系统,执行ddbr命令备份mmcblk0。

注:Armbian镜像写入TF卡后需要进行配置,早期,中期,后期配置方式不同。Armbian_5.44_S9xxx_Ubuntu_bionic_3.14.29_server_20180729.img将gxbb_p200_1G_100M_RealtekWiFi.dtb复制到TF卡根目录,重命名为dtb.img即可,Armbian_5.99_Aml-g12_Ubuntu_bionic_default_5.3.0_rtl8189ftv.tar.gz修改uEnv.txt文件引用meson-gxbb-p201.dtb,后期Armbian20.10修改/extlinux/extlinux.conf并将u-boot-s905重命名为u-boot.ext。详情参见 https://forum.armbian.com/topic/12162-single-armbian-image-for-rk-aml-aw-aarch64-armv8/?ct=1613786525 ,其他用户自行编译(如恩山论坛)的可能存在差异。

首次刷机

  • 电脑上使用Burning_Tool导入镜像,默认配置不变,点击开始刷机;
  • 在棉签按住RST键的情况下,接通电源后迅速用microUSB数据线连接盒子与电脑,如无意外电脑会先自动安装驱动然后开始刷机进程,刷机进程显示100%后拔电源重启即可,视情况可能需要自行替换遥控文件:

/etc/remote.conf,remote1.conf,remote2.conf

我在原厂遥控文件基础上仅修改添加了menu键,余处未做改动。

刷机后,盒子可以引导Armbian20.10了。

二次刷机

在刷写第三方固件后不能按RST键进入刷机模式的情况下,网上流传的方式基本都是拆机短接强刷,其实没必要,有简单的方法。Armbian启动后,随便往mmcblk0头部写入一些数据,比如:
dd if=/dev/zero of=/dev/mmcblk0/ bs=4M count=30
这样下次开机只有电源灯亮。电脑上点击开始刷机,盒子拔掉电源,使用microUSB数据线连接电脑,会自动安装驱动并开始刷机进程。

Armbian镜像推荐

刚才已经列出了Armbian_5.44_S9xxx_Ubuntu_bionic_3.14.29_server_20180729.imgArmbian_5.99_Aml-g12_Ubuntu_bionic_default_5.3.0_rtl8189ftv.tar.gz。这2个都能驱动WIFI(8189es),但是内核版本比较老。我目前使用的是balbes150发布的Armbian_20.10_Arm-64_focal_current_5.9.0.img.xz,没有集成8189es驱动WIFI无法使用,不过当做headless server无所谓了。CSDN上倒是有RTL8189ES_linux_v5.8.9_35085.20191003.zip,要26块钱下载: https://download.csdn.net/download/rxgzh070207/11978856?utm_source=bbsseo

Coreelec测试

CoreELEC-Amlogic.arm-9.2.6-Generic.img.gz搭配gxbb_p200_1G_100M_RealtekWiFi.dtb可以使用,也能写入EMMC,我还特意制作了meson-ir遥控文件:

R3300M

点击展开查看
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# table R3300M, type: NEC
# ###################################################### #
# 遥控码 Keycode 实体按键 实现功能 #
# ###################################################### #
# 基本功能区(测试正常)
0xb3dc KEY_POWER #【待机】 开关机
0xb39c KEY_MUTE #【静音】 静音
0xb388 KEY_HOME #【首页】 HOME键
0xb382 KEY_MENU #【本地】 菜单键
0xb3ce KEY_OK #【确定】 确定
0xb3c5 KEY_BACK #【返回】 返回
0xb395 KEY_PLAYPAUSE #【播放暂停】 暂停/播放
0xb3ca KEY_UP #【上】 上
0xb3d2 KEY_DOWN #【下】 下
0xb399 KEY_LEFT #【左】 左
0xb3c1 KEY_RIGHT #【右】 右
0xb380 KEY_VOLUMEUP #【音量+】 音量增大
0xb381 KEY_VOLUMEDOWN #【音量-】 音量减小
0xb3dd KEY_PAGEUP #【上页】 向上翻页
0xb38c KEY_PAGEDOWN #【下页】 向下翻页
0xb385 KEY_CHANNELUP #【频道+】 向上调台
0xb386 KEY_CHANNELDOWN #【频道-】 向下调台
# 数字按键区(测试正常)
0xb387 KEY_0 #【0】 0
0xb392 KEY_1 #【1】 1
0xb393 KEY_2 #【2】 2
0xb3cc KEY_3 #【3】 3
0xb38e KEY_4 #【4】 4
0xb38f KEY_5 #【5】 5
0xb3c8 KEY_6 #【6】 6
0xb38a KEY_7 #【7】 7
0xb38b KEY_8 #【8】 8
0xb3c4 KEY_9 #【9】 9
# 快捷功能区(测试正常)
0xb3cd KEY_Red #【直播】 Kodi TV PVR(电视)
0xb391 KEY_Green #【回看】 Kodi Videos(视频)
0xb383 KEY_Yellow #【点播】 Kodi Music (音乐)
0xb3c3 KEY_BLUE #【信息】 Kodi Pictures(图片)
# 其他按键定义
0xb398 KEY_CONTEXT_MENU #【声道】 显示详细信息
0xb38d KEY_SUBTITLE #【设置】 字幕
0xb3d6 KEY_STOP #【交换】 停止播放
0xb3da KEY_REWIND #【*】 快退
0xb3d0 KEY_FASTFORWARD #【#】 快进
0x51806e KEY_INFO #【TV/IPTV】 显示信息

rc_maps.cfg

点击展开查看
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Keymaps table
#
# This table creates an association between a keycode file and a kernel
# driver. It can be used to automatically override a keycode definition.
#
#
# Format:
# driver - name of the driver provided via uevent - use * for any driver
# table - RC keymap table, provided via uevent - use * for any table
# file - file name. If directory is not specified, it is first looked up
# in /storage/.config/rc_keymaps, then /usr/lib/udev/rc_keymaps
#
# For example:
#
# driver table file
#
# gpio-rc-recv rc-streamzap streamzap
# gpio-rc-recv * justboom
# * rc-rc6-mce rc6_mce_new
# * * hauppauge_new
meson-ir * R3300M

Openwrt测试

测试了恩山Flippy为N1最后发布的49+镜像,配合meson-gbxx-p201.dtb启动没问题,但是写入emmc后无法启动,原因不明。

单位的流浪猫,去年夏天带2只小猫过来的,在一楼值班室安然过冬,大家平时会投喂。今年大概会生出一窝橘猫……

路由器主板正面

路由器主板背面

某小黄鱼上15元捡来的路由器,必虎路由器DC。

硬件配置

  • SOC:MT7628NN
  • FLASH:16MB
  • RAM:64M
  • 网口:3个
  • 天线:2个
  • USB:无
  • 供电:5V1A,圆口
  • 指示灯:蓝/紫色
  • 特色:磁铁

硬件上没啥好说的,主板与外壳没有任何连接方便拆卸,直接拿来刷机。

刷机工作

原厂固件自动开启收费共享WIFI无法修改,而且已经绑定了其他人手机号,必须刷机。原厂固件默认开启SSH,但是无法登录,用编程器备份固件后刷breed然后刷第三方固件。

编程器

diybcq.com 设计出品的CH341A v1.5 (论坛有网店),上手相当不错,配合SOP8烧录夹(带转接板)顺利读写闪存。注意:我操作的闪存是Winbond 25Q128JVSQ,按照软件说明应该使用3.3V电压操作,但实测此时路由器会启动,结果是无法识别读写闪存。经测试,电压设置为2.5V可正常读写闪存。

转接板,夹子

没有热风枪 + 怕麻烦,遂尝试了免拆机方案,CH341A配合最普通的SOP8烧录夹和转接板就行了。在免拆机条件下由于外围电路会有干扰,所以不一定能够成功读写闪存。

UART-USB?

原厂固件的UART也加密了,需要身份验证,无法直接操作。另外CH341A提供了TTL功能,不需要另外购买。

附上原厂固件启动日志:

点击展开查看
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
[BEGIN] 2021/3/4 21:11:07
[040±°08][0′0±0C0E]
DDR Ca&#47650;rati&#60320;DQS r&#18784;= 00°08788

&#1261;Boot ±.1.3 ¨Feb 2· 2017 - 14:21o39)

Boa2¤: &#6889;&#60000;&#1199;C DRAMo 64 MB
1&#255;t¥Α&#597;new interface driver usbfs
[ 1.272000] usbcore: registered new interface driver hub
[ 1.276000] usbcore: registered new device driver usb
[ 1.280000] bhu_tc_attach : end, g_bhu_tc_salt=-1536776869
[ 1.284000] Switching to clocksource MIPS
[ 1.288000] NET: Registered protocol family 2
[ 1.296000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[ 1.300000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[ 1.308000] TCP: Hash tables configured (established 512 bind 512)
[ 1.316000] TCP: reno registered
[ 1.316000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.324000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.332000] NET: Registered protocol family 1
[ 1.336000] MTK/Ralink EHCI/OHCI init.
[ 1.340000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 1.348000] jffs2: version 2.2. (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 1.360000] msgmni has been set to 118
[ 1.364000] io scheduler noop registered (default)
[ 1.376000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 1.384000] serial8250: ttyS0 at MMIO 0x10000d00 (irq = 21) is a 16550A
[ 1.392000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
[ 1.400000] led=43, on=1, off=5, blinks=1, rest=0, times=1
[ 1.404000] Ralink gpio driver initialized
[ 1.408000] flash manufacture id: ef, device id 40 18
[ 1.416000] W25Q128BV(ef 40180000) (16384 Kbytes)
[ 1.420000] mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
[ 1.428000] Creating 8 MTD partitions on "raspi":
[ 1.432000] 0x000000000000-0x000001000000 : "ALL"
[ 1.440000] 0x000000000000-0x000000040000 : "Bootloader"
[ 1.448000] 0x000000040000-0x000000050000 : "Config"
[ 1.452000] 0x000000050000-0x000000060000 : "Factory"
[ 1.460000] 0x000000060000-0x000000de0000 : "firmware"
[ 1.468000] 0x0000001a398a-0x000000de0000 : "rootfs"
[ 1.472000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 1.488000] mtd: partition "rootfs_data" created automatically, ofs=0x940000, len=0x4a0000
[ 1.496000] 0x000000940000-0x000000de0000 : "rootfs_data"
[ 1.504000] 0x000000de0000-0x000000fe0000 : "user"
[ 1.508000] 0x000000fe0000-0x000000ff0000 : "cfg"
[ 1.516000] 0x000000ff0000-0x000001000000 : "oem"
[ 1.524000] tun: Universal TUN/TAP device driver, 1.6
[ 1.528000] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[ 1.532000] GMAC1_MAC_ADRH -- : 0x00008482
[ 1.540000] GMAC1_MAC_ADRL -- : 0xf438c014
[ 1.544000] Ralink APSoC Ethernet Driver Initilization. v3.1 512 rx/tx descriptors allocated, mtu = 1500!
[ 1.552000] GMAC1_MAC_ADRH -- : 0x00008482
[ 1.556000] GMAC1_MAC_ADRL -- : 0xf438c014
[ 1.560000] PROC INIT OK!
[ 1.564000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.572000] ehci-pci: EHCI PCI platform driver
[ 1.576000] ehci-platform: EHCI generic platform driver
[ 1.600000] ******MT7628 mtk phy
[ 1.604000] *****run project phy.
[ 1.616000] FM_OUT value: u4FmOut = 0(0x00000000)
[ 1.628000] FM_OUT value: u4FmOut = 124(0x0000007C)
[ 1.632000] FM detection done! loop = 1
[ 1.644000] SR calibration value u1SrCalVal = 7
[ 1.648000] *********Execute mt7628_phy_init!!
[ 1.652000] ehci-platform ehci-platform: EHCI Host Controller
[ 1.656000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[ 1.664000] ehci-platform ehci-platform: irq 18, io mem 0x101c0000
[ 1.684000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[ 1.688000] hub 1-0:1.0: USB hub found
[ 1.692000] hub 1-0:1.0: 1 port detected
[ 1.696000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.724000] *********Execute mt7628_phy_init!!
[ 1.728000] ohci-platform ohci-platform: Generic Platform OHCI Controller
[ 1.736000] ohci-platform ohci-platform: new USB bus registered, assigned bus number 2
[ 1.744000] ohci-platform ohci-platform: irq 18, io mem 0x101c1000
[ 1.812000] hub 2-0:1.0: USB hub found
[ 1.816000] hub 2-0:1.0: 1 port detected
[ 1.820000] Ralink APSoC Hardware Watchdog Timer
[ 1.824000] gre: GRE over IPv4 demultiplexor driver
[ 1.832000] TCP: cubic registered
[ 1.832000] NET: Registered protocol family 10
[ 1.840000] NET: Registered protocol family 17
[ 1.844000] Bridge firewalling registered
[ 1.848000] 8021q: 802.1Q VLAN Support v1.8
[ 1.852000] registered taskstats version 1
[ 1.864000] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[ 1.872000] Freeing unused kernel memory: 220K (80389000 - 803c0000)
procd: Console i[ 2.556000] Started WatchDog Timer.
s alive
procd: - watchdog -
[ 3.904000] SCSI subsystem initialized
[ 3.916000] usbcore: registered new interface driver usb-storage
procd: - preinit -
[ 5.104000] jffs2: notice: (239) jffs2_build_xattr_subsystem: complete building xattr subsystem, 53 of xdatum (0 unchecked, 53 orphan) and 53 of xref (0 dead, 53 orphan) found.
[ 5.120000] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[ 5.128000] block: unable to load configuration (fstab: Entry not found)
[ 5.136000] block: attempting to load /tmp/jffs_cfg/etc/config/fstab
[ 5.140000] block: unable to load configuration (fstab: Entry not found)
[ 5.148000] block: attempting to load /etc/config/fstab
[ 5.288000] block: extroot: not configured
jffs2 is ready
No jffs2 marker was found
[ 5.452000] jffs2: notice: (236) jffs2_build_xattr_subsystem: complete building xattr subsystem, 53 of xdatum (0 unchecked, 53 orphan) and 53 of xref (0 dead, 53 orphan) found.
[ 5.836000] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[ 5.844000] block: unable to load configuration (fstab: Entry not found)
[ 5.848000] block: attempting to load /tmp/jffs_cfg/etc/config/fstab
[ 5.856000] block: unable to load configuration (fstab: Entry not found)
[ 5.864000] block: attempting to load /etc/config/fstab
[ 5.872000] block: extroot: not configured
switching to overlay
procd: - early -
procd: - watchdog -
procd: - ubus -
procd: - init -
Please press Enter to activate this console.
[ 7.052000] NTFS driver 2.1.30 [Flags: R/O MODULE].
[ 7.092000] Initializing XFRM netlink socket
[ 7.100000] NET: Registered protocol family 15
[ 7.156000] nf_conntrack version 0.5.0 (954 buckets, 3816 max)
[ 7.164000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 7.240000] Ebtables v2.0 registered
[ 7.248000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 7.252000] Type=Linux
[ 7.276000] rdm_major = 253
[ 7.300000] xt_time: kernel timezone is -0000
[ 7.316000] PPP generic driver version 2.4.2
[ 7.324000] NET: Registered protocol family 24
[ 7.384000] bhu_stat_register_netlink: family id is 19
[ 7.388000] BHUGenNetlink: bhu_gen_nl_register_netlink
[ 7.392000] bhu_gen_nl_register_netlink: succeed to register bhu gen netlink. family id is 20
[ 7.416000] BHUGenNetlink: bhu_gen_nl_register_netlink
[ 7.420000] bhu_gen_nl_register_netlink: BHU gen netlink has been registered. Family id is 20
[ 7.444000] FFFFFF84:FFFFFF82:FFFFFFF4:38:FFFFFFC0:14
[ 7.448000] Raeth v3.1 (Tasklet,SkbRecycle)
[ 7.452000]
[ 7.452000] phy_tx_ring = 0x0328a000, tx_ring = 0xa328a000
[ 7.460000]
[ 7.460000] phy_rx_ring0 = 0x0328c000, rx_ring0 = 0xa328c000
[ 7.484000] GMAC1_MAC_ADRH -- : 0x00008482
[ 7.488000] GMAC1_MAC_ADRL -- : 0xf438c014
[ 7.492000] RT305x_ESW: Link Status Changed
[ 7.492000] [bhu_esw_link_status_change][2061]: stat[0], stat_curr[81808100]
[ 7.492000] BHU ESW LAN link change
switch reg write offset=14, value=405555
switch reg write offset=50, value=2001
switch reg write offset=98, value=7f3f
switch reg write offset=e4, value=3f
switch reg write offset=40, value=1002
switch reg write offset=44, value=1001
switch reg write offset=48, value=1001
switch reg write offset=70, value=ffff417e
switch reg write offset=74, value=ffffffff
done.
Setting up networking on loopback device:
this file has been obseleted. please call "/sbin/block mount" directly
block: Fall back on RO mount. Permission denied.
block: /dev/mtdblock6 is already mounted
[ 8.180000] jffs2: notice: (641) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
/etc/rc.common: line 1: config_load: not found
block: /dev/mtdblock5 is already mounted
block: /dev/mtdblock6 is already mounted
block: /dev/mtdblock7 is already mounted
[ 8.980000] device eth5T entered promiscuous mode
[ 9.480000]
[ 9.480000]
[ 9.480000] === pAd = c078b000, size = 845504 ===
[ 9.480000]
[ 9.488000] <-- RTMPAllocTxRxRingMemory, Status=0, ErrorValue=0x
[ 9.496000] <-- RTMPAllocAdapterBlock, Status=0
[ 9.500000] RtmpChipOpsHook(492): Not support for HIF_MT yet!
[ 9.508000] mt7628_init()-->
[ 9.508000] mt7628_init(FW(8a00), HW(8a01), CHIPID(7628))
[ 9.516000] e2.bin mt7628_init(1135)::(2), pChipCap->fw_len(63888)
[ 9.520000] mt_bcn_buf_init(218): Not support for HIF_MT yet!
[ 9.528000] <--mt7628_init()
[ 9.528000] bhu_stainfo_register_callback: register callback successed
[ 9.540000] BHUGenNetlink: bhu_gen_nl_register_netlink
[ 9.544000] bhu_gen_nl_register_netlink: BHU gen netlink has been registered. Family id is 20
[ 9.568000] TX_BCN DESC a29d8000 size = 320
[ 9.572000] RX[0] DESC a29db000 size = 1024
[ 9.576000] RX[1] DESC a29dc000 size = 1024
[ 9.608000] cfg_mode=9
[ 9.612000] cfg_mode=9
[ 9.616000] wmode_band_equal(): Band Equal!
[ 9.620000] AndesSendCmdMsg: Could not send in band command due to diable fRTMP_ADAPTER_MCU_SEND_IN_BAND_CMD
[ 9.632000] APSDCapable[0]=1
[ 9.636000] APSDCapable[1]=1
[ 9.636000] APSDCapable[2]=1
[ 9.640000] APSDCapable[3]=1
[ 9.644000] APSDCapable[4]=1
[ 9.644000] APSDCapable[5]=1
[ 9.648000] APSDCapable[6]=1
[ 9.652000] APSDCapable[7]=1
[ 9.656000] APSDCapable[8]=1
[ 9.656000] APSDCapable[9]=1
[ 9.660000] APSDCapable[10]=1
[ 9.664000] APSDCapable[11]=1
[ 9.668000] APSDCapable[12]=1
[ 9.668000] APSDCapable[13]=1
[ 9.672000] APSDCapable[14]=1
[ 9.676000] APSDCapable[15]=1
[ 9.708000] load fw image from fw_header_image
[ 9.712000] AndesMTLoadFwMethod1(2182)::pChipCap->fw_len(63888)
[ 9.720000] FW Version:20151201
[ 9.720000] FW Build Date:20151201183641
[ 9.724000] CmdAddressLenReq:(ret = 0)
[ 9.732000] CmdFwStartReq: override = 1, address = 1048576
[ 9.736000] CmdStartDLRsp: WiFI FW Download Success
[ 9.740000] MtAsicDMASchedulerInit(): DMA Scheduler Mode=0(LMAC)
[ 9.748000] efuse_probe: efuse = 10000012
[ 9.752000] RtmpChipOpsEepromHook::e2p_type=0, inf_Type=4
[ 9.756000] RtmpEepromGetDefault::e2p_dafault=2
[ 9.760000] RtmpChipOpsEepromHook: E2P type(2), E2pAccessMode = 2, E2P default = 2
[ 9.768000] NVM is FLASH mode
[ 9.772000] 1. Phy Mode = 14
[ 9.936000] Country Region from e2p = ffff
[ 9.940000] tssi_1_target_pwr_g_band = 36
[ 9.944000] 2. Phy Mode = 14
[ 9.944000] 3. Phy Mode = 14
[ 9.948000] NICInitPwrPinCfg(11): Not support for HIF_MT yet!
[ 9.956000] NICInitializeAsic(651): Not support rtmp_mac_sys_reset () for HIF_MT yet!
[ 9.964000] mt_mac_init()-->
[ 9.964000] MtAsicInitMac()-->
[ 9.968000] mt7628_init_mac_cr()-->
[ 9.972000] MtAsicSetMacMaxLen(1276): Set the Max RxPktLen=1024!
[ 9.980000] <--mt_mac_init()
[ 9.980000] WTBL Segment 1 info:
[ 9.984000] MemBaseAddr/FID:0x28000/0
[ 9.988000] EntrySize/Cnt:32/128
[ 9.992000] WTBL Segment 2 info:
[ 9.996000] MemBaseAddr/FID:0x40000/0
[ 10.000000] EntrySize/Cnt:64/128
[ 10.004000] WTBL Segment 3 info:
[ 10.008000] MemBaseAddr/FID:0x42000/64
[ 10.012000] EntrySize/Cnt:64/128
[ 10.012000] WTBL Segment 4 info:
[ 10.016000] MemBaseAddr/FID:0x44000/128
[ 10.020000] EntrySize/Cnt:32/128
[ 10.024000] AntCfgInit(2947): Not support for HIF_MT yet!
[ 10.032000] MCS Set = ff ff 00 00 00
[ 10.032000] MtAsicSetChBusyStat(861): Not support for HIF_MT yet!
[ 10.540000] RT305x_ESW: Link Status Changed
[ 10.540000] [bhu_esw_link_status_change][2061]: stat[81808100], stat_curr[a190a110]
[ 10.540000] BHU ESW LAN link change
[ 10.600000] CmdSlotTimeSet:(ret = 0)
[ 12.696000] =====================================================
[ 12.700000] Channel 1 : Dirty = 258, False CCA = 0, Busy Time = 5134, Skip Channel = FALSE
[ 12.708000] Channel 2 : Dirty = 152, False CCA = 0, Busy Time = 6000, Skip Channel = FALSE
[ 12.716000] Channel 3 : Dirty = 222, False CCA = 0, Busy Time = 7537, Skip Channel = FALSE
[ 12.724000] Channel 4 : Dirty = 184, False CCA = 0, Busy Time = 7006, Skip Channel = FALSE
[ 12.732000] Channel 5 : Dirty = 244, False CCA = 0, Busy Time = 8647, Skip Channel = FALSE
[ 12.744000] Channel 6 : Dirty = 144, False CCA = 0, Busy Time = 12316, Skip Channel = FALSE
[ 12.752000] Channel 7 : Dirty = 356, False CCA = 0, Busy Time = 5557, Skip Channel = FALSE
[ 12.760000] Channel 8 : Dirty = 260, False CCA = 0, Busy Time = 5268, Skip Channel = FALSE
[ 12.768000] Channel 9 : Dirty = 310, False CCA = 0, Busy Time = 15987, Skip Channel = FALSE
[ 12.776000] Channel 10 : Dirty = 268, False CCA = 0, Busy Time = 11282, Skip Channel = FALSE
[ 12.784000] Channel 11 : Dirty = 490, False CCA = 0, Busy Time = 10399, Skip Channel = FALSE
[ 12.792000] Channel 12 : Dirty = 254, False CCA = 0, Busy Time = 6015, Skip Channel = TRUE
[ 12.800000] Channel 13 : Dirty = 192, False CCA = 0, Busy Time = 3918, Skip Channel = TRUE
[ 12.808000] =====================================================
[ 12.816000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 12.824000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 12.828000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 12.836000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 12.840000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 12.848000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 12.876000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 12.880000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 12.888000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 12.892000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 12.900000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 12.908000] Main bssid = 84:82:f4:38:c0:15
[ 12.912000] <==== rt28xx_init, Status=0
[ 12.920000] BHUGenNetlink: bhu_gen_nl_register_netlink
[ 12.924000] bhu_gen_nl_register_netlink: BHU gen netlink has been registered. Family id is 20
[ 12.948000] BHUGenNetlink: bhu_gen_nl_register_netlink
[ 12.952000] bhu_gen_nl_register_netlink: BHU gen netlink has been registered. Family id is 20
[ 12.972000] BHUGenNetlink: bhu_gen_nl_register_netlink
[ 12.976000] bhu_gen_nl_register_netlink: BHU gen netlink has been registered. Family id is 20
[ 12.984000] @@@ ed_monitor_exit : ===>
[ 12.988000] @@@ ed_monitor_exit : <===
[ 12.992000] mt7628_set_ed_cca: TURN OFF EDCCA mac 0x10618 = 0xd7083f0f
[ 13.000000] WiFi Startup Cost (wlan0): 3.432s
[ 15.496000] led=43, on=1, off=5, blinks=1, rest=0, times=1
[main] >>> Init dispather success!
BHU Software Version: AP902P07V1.6.0Build798_TU 2017-11-03-09:13 Revision: 798
procd: - init complete -
kill: you need to specify whom to kill
Mongoose web server v.3.9 started on port(s) 80 with web root [/usr/share/www]
main, 36, svn:798, version:10015, time:[Thu Nov 2 20:56:08 CST 2017]
wait for pa data initpa_data_init done[ 19.788000] bhuhttp_L2_init: register nl family ok
[ 19.796000] user space pid:799
[http_url_start_timer][269] http url age timer start..
[ 20.036000] cfg_mode=9
[ 20.036000] wmode_band_equal(): Band Equal!
[ 20.044000] AddTxSType: already registered TxSType (PID = 32, Format = 0
kmod: module is not loaded
[ 20.120000] cfg_mode=9
[ 20.124000] wmode_band_equal(): Band Equal!
[ 20.128000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 20.164000] cfg_mode=9
[ 20.164000] wmode_band_equal(): Band Equal!
[ 20.168000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 20.216000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 20.224000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 20.228000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 20.236000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 20.240000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 20.248000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 20.252000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 20.260000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 20.288000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 20.292000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 20.304000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 20.308000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 20.316000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 20.324000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 20.332000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 20.336000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 20.344000] Main bssid = 84:82:f4:38:c0:15
[ 20.376000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 20.380000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 20.388000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 20.392000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 20.400000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 20.404000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 20.412000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 20.416000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 20.456000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 20.460000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 20.468000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 20.472000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 20.480000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 20.488000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 20.496000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 20.500000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 20.508000] Main bssid = 84:82:f4:38:c0:15
[ 20.572000] device eth0 entered promiscuous mode
[ 20.580000] device wlan0 entered promiscuous mode
[ 20.592000] device wlan2 entered promiscuous mode
[ 20.600000] device wlan3 entered promiscuous mode
killall: dropbear: no process killed
kill: you need to specify whom to kill
[ 21.972000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 21.980000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 21.984000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 21.992000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 21.996000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 22.004000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 22.012000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 22.016000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 22.044000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 22.052000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 22.056000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 22.064000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 22.072000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 22.080000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 22.084000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 22.092000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTa¢¥μ&#189;&#1425;= 0xf0
[ 22.096000] Main bssid = 84:82:f4:38:c0:15
[ 22.104000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 22.112000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 22.116000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 22.124000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 22.128000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 22.136000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 22.144000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 22.148000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 22.176000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 22.180000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 22.188000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 22.196000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 22.200000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 22.208000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 22.216000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 22.224000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 22.228000] Main bssid = 84:82:f4:38:c0:15
[ 22.244000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 22.252000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 22.256000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 22.264000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 22.268000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 22.276000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 22.280000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 22.288000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 22.316000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 22.324000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 22.328000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 22.336000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 22.344000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 22.352000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 22.356000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 22.364000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 22.372000] Main bssid = 84:82:f4:38:c0:15
[ 23.416000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 23.424000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 23.428000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 23.436000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 23.440000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 23.448000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 23.452000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 23.460000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 23.488000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 23.492000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 23.500000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 23.504000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 23.512000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 23.520000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 23.528000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 23.532000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 23.540000] Main bssid = 84:82:f4:38:c0:15
[ 23.560000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 23.564000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 23.572000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 23.576000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 23.584000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 23.588000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 23.596000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 23.600000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 23.628000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 23.636000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 23.640000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 23.648000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 23.652000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 23.660000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 23.668000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 23.676000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 23.680000] Main bssid = 84:82:f4:38:c0:15
[ 24.724000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 24.732000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 24.736000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 24.744000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 24.748000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 24.756000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 24.760000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 24.768000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 24.796000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 24.800000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 24.808000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 24.812000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 24.820000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 24.828000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 24.836000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 24.840000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 24.848000] Main bssid = 84:82:f4:38:c0:15
[ 24.868000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
[ 24.872000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 24.880000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 24.884000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 24.892000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 24.896000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 24.904000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 24.908000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 24.936000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 24.944000] CmdLoadDPDDataFromFlash: Channel = 6, DoReload = 0
[ 24.948000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 24.956000] AddTxSType: already registered TxSType (PID = 32, Format = 0
[ 24.964000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 24.972000] AddTxSType: already registered TxSType (PID = 6, Format = 0
[ 24.976000] AddTxSType: already registered TxSType (PID = 8, Format = 0
[ 24.984000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 24.988000] Main bssid = 84:82:f4:38:c0:15
iptables: No chain/target/match by that name.
MASQUERADE all opt -- in * out eth1 0.0.0.0/0 -> 0.0.0.0/0 [24 bytes of unknown target data]
iptables: No chain/target/match by that name.
udhcpc (v1.22.1) started
route: SIOCDELRT: No such process
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
[ 27.408000] br-lan: port 2(wlan0) entered forwarding state
[ 27.412000] br-lan: port 2(wlan0) entered forwarding state
[ 27.420000] br-lan: port 1(eth0) entered forwarding state
[ 27.424000] br-lan: port 1(eth0) entered forwarding state
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
MASQUERADE all opt -- in * out [ 27.688000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
eth1 0.0.0.0/0 [ 27.700000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0x0
-> 0.0.0.0/0 [[ 27.704000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
24 bytes of unknown target data]
MASQUERADE all opt -- in * out eth1 192.168.62.0/24 -> 0.0.0.0/0 [24 bytes of unknown target data]
[ 27.936000] bhu_tc_send_q_tx: send skb failed, err=2
[ 28.032000] bhu_tc_send_q_tx: send skb failed, err=2
[ 28.240000] tx_kickout_fail_count = 0
[ 28.244000] tx_timeout_fail_count = 0
[ 28.244000] rx_receive_fail_count = 0
[ 28.248000] alloc_cmd_msg = 207
[ 28.252000] free_cmd_msg = 207
[ 28.260000] br-lan: port 2(wlan0) entered disabled state
iptables: No chain/target/match by that name.
[ 28.308000] TX_BCN DESC a29d8000 size = 320
[ 28.312000] RX[0] DESC a29db000 size = 1024
[ 28.316000] RX[1] DESC a29dc000 size = 1024
[ 28.332000] cfg_mode=9
[ 28.332000] cfg_mode=9
[ 28.336000] wmode_band_equal(): Band Equal!
[ 28.340000] AndesSendCmdMsg: Could not send in band command due to diable fRTMP_ADAPTER_MCU_SEND_IN_BAND_CMD
[ 28.352000] APSDCapable[0]=1
[ 28.356000] APSDCapable[1]=1
[ 28.360000] APSDCapable[2]=1
[ 28.360000] APSDCapable[3]=1
[ 28.364000] APSDCapable[4]=1
[ 28.368000] APSDCapable[5]=1
[ 28.368000] APSDCapable[6]=1
[ 28.372000] APSDCapable[7]=1
[ 28.376000] APSDCapable[8]=1
[ 28.380000] APSDCapable[9]=1
[ 28.380000] APSDCapable[10]=1
[ 28.384000] APSDCapable[11]=1
[ 28.388000] APSDCapable[12]=1
[ 28.392000] APSDCapable[13]=1
[ 28.392000] APSDCapable[14]=1
[ 28.396000] APSDCapable[15]=1
[ 28.428000] load fw image from fw_header_image
[ 28.432000] AndesMTLoadFwMethod1(2182)::pChipCap->fw_len(63888)
[ 28.440000] FW Version:20151201
[ 28.444000] FW Build Date:20151201183641
[ 28.448000] CmdReStartDLRsp: WiFI FW Download Success
[ 28.452000] CmdAddressLenReq:(ret = 0)
[ 28.456000] CmdFwStartReq: override = 1, address = 1048576
[ 28.464000] CmdStartDLRsp: WiFI FW Download Success
[ 28.468000] MtAsicDMASchedulerInit(): DMA Scheduler Mode=0(LMAC)
[ 28.472000] efuse_probe: efuse = 10000012
[ 28.476000] RtmpChipOpsEepromHook::e2p_type=2, inf_Type=4
[ 28.484000] RtmpEepromGetDefault::e2p_dafault=2
[ 28.488000] RtmpChipOpsEepromHook: E2P type(2), E2pAccessMode = 2, E2P default = 2
[ 28.496000] NVM is FLASH mode
[ 28.500000] 1. Phy Mode = 14
[ 28.660000] Country Region from e2p = ffff
[ 28.668000] tssi_1_target_pwr_g_band = 36
[ 28.672000] 2. Phy Mode = 14
[ 28.672000] 3. Phy Mode = 14
[ 28.676000] NICInitPwrPinCfg(11): Not support for HIF_MT yet!
[ 28.680000] NICInitializeAsic(651): Not support rtmp_mac_sys_reset () for HIF_MT yet!
[ 28.688000] mt_mac_init()-->
[ 28.692000] MtAsicInitMac()-->
[ 28.696000] mt7628_init_mac_cr()-->
[ 28.700000] MtAsicSetMacMaxLen(1276): Set the Max RxPktLen=1024!
[ 28.704000] <--mt_mac_init()
[ 28.708000] WTBL Segment 1 info:
[ 28.712000] MemBaseAddr/FID:0x28000/0
[ 28.716000] EntrySize/Cnt:32/128
[ 28.720000] WTBL Segment 2 info:
[ 28.724000] MemBaseAddr/FID:0x40000/0
[ 28.728000] EntrySize/Cnt:64/128
[ 28.732000] WTBL Segment 3 info:
[ 28.732000] MemBaseAddr/FID:0x42000/64
[ 28.736000] EntrySize/Cnt:64/128
[ 28.740000] WTBL Segment 4 info:
[ 28.744000] MemBaseAddr/FID:0x44000/128
[ 28.748000] EntrySize/Cnt:32/128
[ 28.752000] AntCfgInit(2947): Not support for HIF_MT yet!
[ 28.756000] MCS Set = ff ff 00 00 00
[ 28.760000] MtAsicSetChBusyStat(861): Not support for HIF_MT yet!
[ 31.416000] =====================================================
[ 31.420000] Channel 1 : Dirty = 254, False CCA = 0, Busy Time = 4969, Skip Channel = FALSE
[ 31.428000] Channel 2 : Dirty = 168, False CCA = 0, Busy Time = 4130, Skip Channel = FALSE
[ 31.436000] Channel 3 : Dirty = 208, False CCA = 0, Busy Time = 3210, Skip Channel = FALSE
[ 31.444000] Channel 4 : Dirty = 250, False CCA = 0, Busy Time = 3656, Skip Channel = FALSE
[ 31.452000] Channel 5 : Dirty = 280, False CCA = 0, Busy Time = 8862, Skip Channel = FALSE
[ 31.464000] Channel 6 : Dirty = 218, False CCA = 0, Busy Time = 6476, Skip Channel = FALSE
[ 31.472000] Channel 7 : Dirty = 432, False CCA = 0, Busy Time = 6117, Skip Channel = FALSE
[ 31.480000] Channel 8 : Dirty = 336, False CCA = 0, Busy Time = 5338, Skip Channel = FALSE
[ 31.488000] Channel 9 : Dirty = 366, False CCA = 0, Busy Time = 9826, Skip Channel = FALSE
[ 31.496000] Channel 10 : Dirty = 324, False CCA = 0, Busy Time = 4860, Skip Channel = FALSE
[ 31.504000] Channel 11 : Dirty = 598, False CCA = 0, Busy Time = 9220, Skip Channel = FALSE
[ 31.512000] Channel 12 : Dirty = 248, False CCA = 0, Busy Time = 6747, Skip Channel = TRUE
[ 31.520000] Channel 13 : Dirty = 216, False CCA = 0, Busy Time = 7909, Skip Channel = TRUE
[ 31.528000] =====================================================
[ 31.536000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 31.544000] [PMF]ap_pmf_init:: apidx=1, MFPC=0, MFPR=0, SHA256=0
[ 31.548000] [PMF]ap_pmf_init:: apidx=2, MFPC=0, MFPR=0, SHA256=0
[ 31.556000] [PMF]ap_pmf_init:: apidx=3, MFPC=0, MFPR=0, SHA256=0
[ 31.560000] MtAsicSetRalinkBurstMode(3047): Not support for HIF_MT yet!
[ 31.568000] MtAsicSetPiggyBack(796): Not support for HIF_MT yet!
[ 31.596000] reload DPD from flash , 0x9F = [c600] doReload bit7[0]
[ 31.600000] CmdLoadDPDDataFromFlash: Channel = 2, DoReload = 0
[ 31.608000] MtAsicSetTxPreamble(3026): Not support for HIF_MT yet!
[ 31.616000] The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4
[ 31.624000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 31.628000] Main bssid = 84:82:f4:38:c0:15
[ 31.632000] <==== rt28xx_init, Status=0
[ 31.636000] @@@ ed_monitor_exit : ===>
[ 31.640000] @@@ ed_monitor_exit : <===
[ 31.644000] mt7628_set_ed_cca: TURN OFF EDCCA mac 0x10618 = 0xd7083f0f
[ 31.652000] WiFi Startup Cost (wlan0): 3.344s
[ 31.656000] br-lan: port 2(wlan0) entered forwarding state
[ 31.660000] br-lan: port 2(wlan0) entered forwarding state
iptables: No chain/target/match by that name.
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: No such file or directory)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
serverctl: BHU Tunnel probably not started (Error: Connection refused)
[ 33.928000] led=43, on=0, off=1, blinks=0, rest=0, times=0
[ 33.984000] led=42, on=2, off=5, blinks=1, rest=0, times=1
wandetect: eth1 is running
wandetect: start pppoe_discovery_main thread ok.
wandetect: start dhcp detect thread ok.
udhcpc (v1.22.1) started
wlan_ol_sta_online_proc: add sta 74:97:81:ab:06:dd, count 1
assoced:74:97:81:ab:06:dd
[ 35.040000] led=43, on=2, off=5, blinks=1, rest=0, times=1
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
No lease, failing
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
wandetect: Timeout waiting for PADO packets
wandetect:
HOSTNAME login:

[END] 2021/3/4 21:13:04

breed

使用恩山论坛的breed-mt7688-reset38.bin。不能正确识别内存大小,此外没什么问题。这个路由器内存为一片EM68B16CWQH-25H,64MB,breed中识别为128MB,可以在编译openwrt前修改dts设置内存为64MB。

刷回原厂固件

breed中刷入一次刚才导出的编程器固件,此步骤作用是恢复mac地址与eeprom。

openwrt编译

使用lean/lede代码,选择MT76X8,GL.iNet VIXMINI配置。GL.iNet VIXMINI配置为MT7628NN 8+64,无USB,与必虎mini接近: https://www.gl-inet.cn/products/vixmini/

修改 lede/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network

1
2
3
4
5
glinet,microuter-n300|\
glinet,vixmini)
ucidef_add_switch "switch0" \
"0:lan" "6@eth0"
;;

修改为

1
2
3
4
5
glinet,microuter-n300|\
glinet,vixmini)
ucidef_add_switch "switch0" \
"4:lan" "2:lan" "0:wan" "6@eth0"
;;

因为vixmini只有一个网口,我们需要自行添加2个网口,注意对应交换机的2和4。注意MT7628只有一个网卡(interface),内置5口交换机,通过VLAN划分WAN与LAN,WAN一般对应0号口,LAN需要自己测试,本例中为2和4。

修改lede/target/linux/ramips/image/mt76x8.mk

1
2
3
4
5
6
7
define Device/glinet_vixmini
IMAGE_SIZE := 7872k
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := VIXMINI
SUPPORTED_DEVICES += vixmini
endef
TARGET_DEVICES += glinet_vixmini

修改为

1
2
3
4
5
6
7
define Device/glinet_vixmini
IMAGE_SIZE := 16064k
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := VIXMINI
SUPPORTED_DEVICES += vixmini
endef
TARGET_DEVICES += glinet_vixmini

VIXMINI闪存8M,不如此修改无法生成8M~16M大小的固件。

修改lede/target/linux/ramips/dts/mt7628an_glinet_vixmini.dts

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

#include "mt7628an_glinet_vixmini_microuter.dtsi"

/ {
compatible = "glinet,vixmini", "mediatek,mt7628an-soc";
model = "GL.iNet VIXMINI";

memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};
};

&led_power_blue {
label = "vixmini:blue:power";
};

&led_wlan_white {
label = "vixmini:white:wlan";
};

&firmware_part {
reg = <0x50000 0xfb0000>;
};

其中,

1
2
3
4
memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};

这一段是自己加的,本来内存容量应该由BootLoader获取传递给openwrt,不过由于breed识别错误,所以自己手动指定参数。

经过以上修改后就可以编译固件了,然而由于MT7628开源WIFI驱动贫弱的表现,你很可能会不满意,如此可以继续阅读:

刷GL-iNet GL-MT300N-V2固件

在GL-iNet官网下载:http://download.gl-inet.com/firmware/

GL-iNet应该是主打外贸的国内路由器厂商,路由器固件均基于openwrt,包含MTK私有驱动,WIFI表现良好,实测穿2道非承重墙非常轻松。

GL-MT300N-V2固件初始WIFI密码goodlife,管理页面登录密码admin。首次设置需要通过WIFI连接,通过SSH访问修改/etc/config/network,将vlan为1的交换机端口修改成以下的样子:

1
2
3
4
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '2 4 6t'

对应2和4。之后执行/etc/init.d/network restartLAN口就可用了。

下步折腾计划

恩山上看见有人通过刮U露出针脚的方式自己加焊了USB接口……查了下资料MT7628NN的Pin61,62分别对应USB_DP和USB_DM,如果这两个针脚在主板上已经引出就简单了,有空时拿万用表测下。