*** 今日折腾这个小路由器,前几天给它刷了openwrt的固件,做打印服务器挺好,小小的,可以粘在打印机后面(不过技术有限,不会从打印机取5V供电,不然就不用带个小尾巴了)***
打印机是HP的P1008,主机型,需要给打印机固件里传固件。固件放在“/usr/lib/sihpP1008.dl”。
更改启动目录,添加一行命令,放在/etc/hotplug.d/usb/下面,命名“10-hplj1008”。
(固件下载网址http://oleg.wl500g.info/hplj/)
下面是文件内容:
#!/bin/sh
set -e
#change this to the location where you put the .dl file:
FIRMWARE=/usr/lib/sihpP1008.dl
DEVICE=/dev/lp0
LOGFILE=/tmp/hp-fm
if [ “
P
R
O
D
U
C
T
"
=
"
3
f
0
/
4917
/
100
"
−
a
"
PRODUCT" = "3f0/4917/100" -a "
PRODUCT"="3f0/4917/100"−a"ACTION” = “add” -a “
D
E
V
T
Y
P
E
"
=
"
u
s
b
i
n
t
e
r
f
a
c
e
"
]
;
t
h
e
n
e
c
h
o
"
DEVTYPE" = "usb_interface" ]; then echo "
DEVTYPE"="usbinterface"];thenecho"(date): STARTING” > $LOGFILE
for i in
(
s
e
q
30
)
;
d
o
e
c
h
o
"
(seq 30); do echo "
(seq30);doecho"(date): Attempt number $i on $DEVICE" » $LOGFILE
if [ -c
D
E
V
I
C
E
]
;
t
h
e
n
e
c
h
o
"
DEVICE ]; then echo "
DEVICE];thenecho"(date): Device $DEVICE found." » $LOGFILE
if [ -z “usb_printerid $DEVICE | grep FWVER
” ]; then
echo “$(date): No firmware found on $DEVICE” »
L
O
G
F
I
L
E
e
c
h
o
"
LOGFILE echo "
LOGFILEecho"(date): Sending firmware to printer…" » $LOGFILE
cat $FIRMWARE >
D
E
V
I
C
E
e
c
h
o
"
DEVICE echo "
DEVICEecho"(date): done." »
L
O
G
F
I
L
E
e
l
s
e
e
c
h
o
"
LOGFILE else echo "
LOGFILEelseecho"(date): Firmware already there on $DEVICE" »
L
O
G
F
I
L
E
f
i
e
c
h
o
"
LOGFILE fi echo "
LOGFILEfiecho"(date): EXITING" » $LOGFILE
exit
fi
sleep 1
done
fi
打不开13信道,是因为固件的限制,需要打补丁,这里有些曲折,网上下载的版本都不行。今天终于找到了。下载地址 https://euer.krebsco.de/extra/reghack/reghack.mips.elf。注意直接搜到的那个Github上的版本是不能用的。(也可能只是我刷的版本上不能用)。
下面就简单了,ssh登录路由器,我用的winscp,拖文件到路由的tmp目录,然后用winscp的命令行执行:
cd /tmp/
wget http://luci.subsignal.org/~jow/reghack/reghack.mips.elf (这一步不需要了)
chmod +x reghack.mips.elf
./reghack.mips.elf /lib/modules//ath.ko
./reghack.mips.elf /lib/modules//cfg80211.ko
reboot