#13 2009-10-08 13:16:11
Re: Lly 韌體 (Oleg 韌體分支)
延續CDMA@wifi使用usb_modeswitch 1.0.5的文章, 仿照其流程, 嘗試於Lly下使用3G上網. 因CDMA@wifi與Lly除核心不同外, 驅動3G modem的核心模組, usb_modeswitch版本也不同. 這次我就用比對, 仿照, 套用的方式, 更進一步探索驅動與撥號流程, 給甚麼都沒有的DD-WRT, Tomato預作準備.
機型: 華碩WL-500gx
韌體: 1.9.2.7-d-r617
3G modem: 華為E220
Optware套件: modutils, usbutils, minicom, libcurl, tree, findutils
1. 核心模組
1-1) 下載, 解壓縮, 搬移
$ cd /opt/Download/Lly/
$ curl -Ov http://wl500g.googlecode.com/files/modules-1.9.2.7-d-r655.tgz
$ tar -xzvf modules-1.9.2.7-d-r655.tgz
$ chown -R admin:root lib/
$ mv lib/modules/ /opt/lib/
$ rmdir lib
$ cd ~
1-2) 查看核心模組樹狀架構
$ tree /opt/lib/modules/2.4.37.6/
/opt/lib/modules/2.4.37.6/
|-- kernel
| |-- drivers
| | |-- bluetooth
| | | |-- bfusb.o
| | | |-- hci_uart.o
| | | |-- hci_usb.o
| | | `-- hci_vhci.o
| | |-- char
| | | `-- gpiortc.o
| | |-- ide
| | | |-- ide-core.o
| | | |-- ide-detect.o
| | | `-- ide-disk.o
| | |-- input
| | | |-- evdev.o
| | | |-- input.o
| | | |-- joydev.o
| | | |-- mousedev.o
| | | `-- uinput.o
| | |-- media
| | | `-- video
| | | `-- videodev.o
| | |-- net
| | | |-- et
| | | | `-- et.o
| | | |-- imq.o
| | | |-- irda
| | | | |-- irda-usb.o
| | | | |-- irtty.o
| | | | `-- stir4200.o
| | | |-- tun.o
| | | `-- wl
| | | `-- wl.o
| | |-- scsi
| | | |-- scsi_mod.o
| | | `-- sd_mod.o
| | |-- sound
| | | `-- soundcore.o
| | `-- usb
| | |-- acm.o
| | |-- audio.o
| | |-- hid.o
| | |-- host
| | | |-- ehci-hcd.o
| | | |-- usb-ohci.o
| | | `-- usb-uhci.o
| | |-- ov511_decomp.o
| | |-- ov518_decomp.o
| | |-- ov51x.o
| | |-- printer.o
| | |-- pwc.o
| | |-- pwcx.o
| | |-- scanner.o
| | |-- serial
| | | |-- ftdi_sio.o
| | | |-- ipw.o
| | | |-- option.o
| | | |-- pl2303.o
| | | |-- sierra.o
| | | `-- usbserial.o
| | |-- storage
| | | `-- usb-storage.o
| | |-- usbcore.o
| | |-- usbkbd.o
| | `-- usbmouse.o
| |-- fs
| | |-- cifs
| | | `-- cifs.o
| | |-- fuse
| | | `-- fuse.o
| | |-- hfsplus
| | | `-- hfsplus.o
| | |-- isofs
| | | `-- isofs.o
| | |-- jffs
| | | `-- jffs.o
| | |-- jffs2
| | | `-- jffs2.o
| | |-- lockd
| | | `-- lockd.o
| | |-- nfs
| | | `-- nfs.o
| | |-- nfsd
| | | `-- nfsd.o
| | |-- nls
| | | `-- nls_koi8-r.o
| | |-- reiserfs
| | | `-- reiserfs.o
| | |-- smbfs
| | | `-- smbfs.o
| | |-- ufs
| | | `-- ufs.o
| | `-- xfs
| | `-- xfs.o
| |-- lib
| | |-- crc32.o
| | `-- firmware_class.o
| `-- net
| |-- bluetooth
| | |-- bluez.o
| | |-- bnep
| | | `-- bnep.o
| | |-- hidp
| | | `-- hidp.o
| | |-- l2cap.o
| | |-- rfcomm
| | | `-- rfcomm.o
| | `-- sco.o
| |-- ipv4
| | |-- ip_gre.o
| | |-- ipip.o
| | `-- netfilter
| | |-- ip_conntrack_ftp.o
| | |-- ip_nat_ftp.o
| | |-- ip_set.o
| | |-- ip_set_iphash.o
| | |-- ip_set_ipmap.o
| | |-- ip_set_ipporthash.o
| | |-- ip_set_ipportiphash.o
| | |-- ip_set_ipportnethash.o
| | |-- ip_set_iptree.o
| | |-- ip_set_iptreemap.o
| | |-- ip_set_macipmap.o
| | |-- ip_set_nethash.o
| | |-- ip_set_portmap.o
| | |-- ip_set_setlist.o
| | |-- ipt_CLASSIFY.o
| | |-- ipt_IMQ.o
| | |-- ipt_MIRROR.o
| | |-- ipt_NETMAP.o
| | |-- ipt_SET.o
| | |-- ipt_TARPIT.o
| | |-- ipt_TOS.o
| | |-- ipt_TTL.o
| | |-- ipt_condition.o
| | |-- ipt_layer7.o
| | |-- ipt_length.o
| | |-- ipt_multiport.o
| | |-- ipt_nth.o
| | |-- ipt_psd.o
| | |-- ipt_quota.o
| | |-- ipt_random.o
| | |-- ipt_recent.o
| | |-- ipt_set.o
| | |-- ipt_string.o
| | |-- ipt_tos.o
| | |-- ipt_ttl.o
| | `-- ipt_webstr.o
| |-- irda
| | `-- irda.o
| |-- sched
| | |-- cls_route.o
| | |-- cls_tcindex.o
| | |-- sch_cbq.o
| | |-- sch_dsmark.o
| | |-- sch_hfsc.o
| | `-- sch_prio.o
| `-- sunrpc
| `-- sunrpc.o
`-- modules.dep
44 directories, 116 files
1-3) 查看驅動3G modem所需要的核心模組敘述與參數
$ modinfo usbserial
filename: //opt/lib/modules/2.4.37.6/kernel/drivers/usb/serial/usbserial.o
description: "USB Serial Driver core"
author: "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux-usb/"
license: "GPL"
parm: maxSize int, description "User specified USB endpoint size"
parm: product short, description "User specified USB idProduct"
parm: vendor short, description "User specified USB idVendor"
parm: debug int, description "Debug enabled or not"
vendor, product, maxSize參數, 分別對應CDMA@wifi WebUI的USB device Vendor ID, USB device Product ID, USB device packet size
$ modinfo option
filename: //opt/lib/modules/2.4.37.6/kernel/drivers/usb/serial/option.o
description: "USB Driver for GSM modems"
author: "Matthias Urlichs "
license: "GPL"
parm: debug int, description "Debug messages"
Lly使用option.o, CDMA@wifi使用modem.o(GSM/CDMA modem driver v0.1)
1-4) 搜尋韌體內建核心模組
$ find /lib/modules/ -name usbserial*
/lib/modules/2.4.37.6/usbserial.o
$ find /lib/modules/ -name option*
/lib/modules/2.4.37.6/option.o
嗯, 韌體已內建, 那就不需再費心.
1-5) 載入核心模組
這有二種方式. 若使用韌體內建核心模組/lib/modules/2.4.37.6/, 因無modules.dep, 只能使用insmod命令, 並注意載入順序. 若使用modules-1.9.2.7-d-r655.tgz解壓縮後, 置於/opt/lib/modules/2.4.37.6/的核心模組, 因有modules.dep可參照關聯性, 所以使用modprobe命令來載入, 會自動參照modules.dep而載入必要的其他核心模組.
例如: 未載入前
$ lsmod
Module Size Used by Tainted: P
usb-storage 63080 2
sd_mod 12660 4
scsi_mod 72624 2 [usb-storage sd_mod]
printer 13060 0 (unused)
ehci-hcd 28212 0 (unused)
usb-uhci 27412 0 (unused)
usbcore 78840 1 [usb-storage printer ehci-hcd usb-uhci]
ip_nat_ftp 3136 0 (unused)
ip_conntrack_ftp 4584 1
wl 897336 0 (unused)
et 29088 0 (unused)
$ modprobe option
$ lsmod
Module Size Used by Tainted: P
option 14752 0 (unused)
usbserial 24208 0 [option]
usb-storage 63080 2
sd_mod 12660 4
scsi_mod 72624 2 [usb-storage sd_mod]
printer 13060 0 (unused)
ehci-hcd 28212 0 (unused)
usb-uhci 27412 0 (unused)
usbcore 78840 1 [option usbserial usb-storage printer ehci-hcd usb-uhci]
ip_nat_ftp 3136 0 (unused)
ip_conntrack_ftp 4584 1
wl 897336 0 (unused)
et 29088 0 (unused)
瞧, 自動載入usbserial
注意usbserial後面的[option], 由此得知需先載入usbserial, 再載入option. 同理, 請觀察usbcore載入option前與載入後的變化.
所以, 使用的命令在於自己設備(USB硬碟等)環境的需求而不同.
2. E220 偵測
這部分算是比較頭疼的問題, 因為若偵測不到, 底下步驟就甭談了.
先插入再開機, 開機中插入, 先插入外接式USB Hub再開機, 或開機中插入USB Hub的port, 核心模組載入時機, 是否核心模組載入後才能正確偵測等等. 這會依照機器的USB port, 外接USB Hub與韌體的不同, 而產生不同的結果. 而核心模組的載入驅動, 又得先了解整個開機啟動順序, 判斷哪個系統啟動檔可以用來載入核心模組, 載入的時機點等. 如果使用/opt來載入, 情況變的更混亂. 總之, 要能在dmesg, /tmp/syslog.log正確的顯示偵測訊息, 並且成功建立串列埠.
2-1) 偵測識別
$ dmesg
hub.c: new USB device 01:02.0-1, assigned address 2
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: HUAWEI Model: Mass Storage Rev: 2.31
Type: CD-ROM ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
usb.c: USB disconnect on device 01:02.0-1 address 2
USB device disconnected from the SCSI subsystem
hub.c: new USB device 01:02.0-1, assigned address 3
Vendor: HUAWEI Model: Mass Storage Rev: 2.31
Type: CD-ROM ANSI SCSI revision: 02
USB device connected to the SCSI subsystem
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
$ cat /tmp/syslog.log
Oct 2 21:50:25 kernel: hub.c: new USB device 01:02.0-1, assigned address 2
Oct 2 21:50:26 kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Oct 2 21:50:26 kernel: Vendor: HUAWEI Model: Mass Storage Rev: 2.31
Oct 2 21:50:26 kernel: Type: CD-ROM ANSI SCSI revision: 02
Oct 2 21:50:31 admin: /dev/discs/disci0/part5:
Oct 2 21:50:31 admin: The superblock could not be read or does not describe a correct ext2
Oct 2 21:50:31 admin: filesystem. If the device is valid and it really contains an ext2
Oct 2 21:50:31 admin: filesystem (and not swap or ufs or something else), then the superblock
Oct 2 21:50:31 admin: is corrupt, and you might try running e2fsck with an alternate superblock:
Oct 2 21:50:31 admin: e2fsck -b 8193
Oct 2 21:50:31 kernel: usb.c: USB disconnect on device 01:02.0-1 address 2
Oct 2 21:50:31 kernel: USB device disconnected from the SCSI subsystem
Oct 2 21:50:32 USB storage: removed
Oct 2 21:50:33 kernel: hub.c: new USB device 01:02.0-1, assigned address 3
Oct 2 21:50:34 kernel: Vendor: HUAWEI Model: Mass Storage Rev: 2.31
Oct 2 21:50:34 kernel: Type: CD-ROM ANSI SCSI revision: 02
Oct 2 21:50:34 kernel: USB device connected to the SCSI subsystem
2-2) 載入核心模組, 建立串列埠
$ dmesg
usb.c: registered new driver serial
usbserial.c: USB Serial support registered for Generic
usbserial.c: USB Serial Driver core v1.4
usbserial.c: USB Serial support registered for Option GSM modem
usbserial.c: Option GSM modem converter detected
usbserial.c: Option GSM modem converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usbserial.c: Option GSM modem converter detected
usbserial.c: Option GSM modem converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
option.c: USB Driver for GSM modems: v0.7.2a
$ cat /tmp/syslog.log
Oct 2 22:11:42 kernel: usb.c: registered new driver serial
Oct 2 22:11:42 kernel: usbserial.c: USB Serial support registered for Generic
Oct 2 22:11:42 kernel: usbserial.c: USB Serial Driver core v1.4
Oct 2 22:11:42 kernel: usbserial.c: USB Serial support registered for Option GSM modem
Oct 2 22:11:42 kernel: usbserial.c: Option GSM modem converter detected
Oct 2 22:11:42 kernel: usbserial.c: Option GSM modem converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
Oct 2 22:11:42 kernel: usbserial.c: Option GSM modem converter detected
Oct 2 22:11:42 kernel: usbserial.c: Option GSM modem converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
Oct 2 22:11:42 kernel: option.c: USB Driver for GSM modems: v0.7.2a
$ ls -l /dev/usb/tts/
total 0
crw------- 1 admin root 188, 0 Jan 1 1970 0
crw------- 1 admin root 188, 1 Jan 1 1970 1
$ lsusb
Bus 003 Device 001: ID 0000:0000
Bus 003 Device 002: ID 0409:0056 NEC Corp.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 003: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem
因上述紀錄是不同環境的測試結果, 所以記錄的時間點不一. 如果您搞出符合自己環境的流程, 則載入(核心模組), 辨識(E220), 驅動(E220), 建立(串列埠)等, 記錄的時間應該是連續的.
3. minicom 測試
這部分主要是判斷使用哪個串列埠下達AT command, 串列埠的連接速度. 額外的AT command功能等. 若不想深入探索3G modem, 這部分可忽略.
比對CDMA@wifi + E169, 產生四組串列埠.
Sep 25 12:15:58 kernel: usbserial.c: Generic converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
Sep 25 12:15:58 kernel: usbserial.c: Generic converter detected
Sep 25 12:15:58 kernel: usbserial.c: Buffer size for bulk_in is 2048 modem reports 64
Sep 25 12:15:58 kernel: usbserial.c: Buffer size for bulk_out is 2048 modem reports 64
Sep 25 12:15:58 kernel: usbserial.c: Generic converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
Sep 25 12:15:58 kernel: usbserial.c: Generic converter detected
Sep 25 12:15:58 kernel: usbserial.c: Buffer size for bulk_in is 2048 modem reports 64
Sep 25 12:15:58 kernel: usbserial.c: Buffer size for bulk_out is 2048 modem reports 64
Sep 25 12:15:58 kernel: usbserial.c: Generic converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
Sep 25 12:15:58 kernel: usbserial.c: Generic converter detected
Sep 25 12:15:58 kernel: usbserial.c: Buffer size for bulk_in is 2048 modem reports 64
Sep 25 12:15:58 kernel: usbserial.c: Buffer size for bulk_out is 2048 modem reports 64
Sep 25 12:15:58 kernel: usbserial.c: Generic converter now attached to ttyUSB3 (or usb/tts/3 for devfs)
Sep 25 12:15:58 kernel: usbserial.c: USB Serial Driver core v1.4
Sep 25 12:15:58 kernel: usbserial.c: USB Serial support registered for Modem
Sep 25 12:15:58 kernel: modem.c: GSM/CDMA modem driver v0.1
而E220只建立二組串列埠, 參閱3-2. 我想, 除能真正下達AT command的串列埠(command port)外, 其餘的串列埠也有其他作用. 這必須到廠商的網站找資料. AT command也是. 好, 暫時擺一旁.
查閱CDMA@wifi是使用/dev/usb/tts/0, 那就假設此為command port, 使用minicom測試.
$ minicom --help
Usage: minicom [OPTION]... [configuration]
A terminal program for Linux and other unix-like systems.
-s, --setup : enter setup mode (only as root)
-o, --noinit : do not initialize modem & lockfiles at startup
-m, --metakey : use meta or alt key for commands
-M, --metakey8 : use 8bit meta key for commands
-l, --ansi : literal; assume screen uses non IBM-PC character set
-L, --iso : don't assume screen uses ISO8859
-w, --wrap : Linewrap on
-z, --statline : try to use terminal's status line
-7, --7bit : force 7bit mode
-8, --8bit : force 8bit mode
-c, --color=on/off : ANSI style color usage on or off
-a, --attrib=on/off : use reverse or highlight attributes on or off
-t, --term=TERM : override TERM environment variable
-S, --script=SCRIPT : run SCRIPT at startup
-d, --dial=ENTRY : dial ENTRY from the dialing directory
-p, --ptty=TTYP : connect to pseudo terminal
-C, --capturefile=FILE : start capturing to FILE
-T, --disabletime : disable display of online time
-v, --version : output version information and exit
configuration : configuration file to use
These options can also be specified in the MINICOM environment variable.
This variable is currently unset.
The configuration directory for the access file and the configurations
is compiled to /opt/etc.
Report bugs to .
$ minicom -s
Serial port setup-->
Serial Device: /dev/usb/tts/0
Bps/Par/Bits: 115200 8N1
Hardware Flow Control: Yes
Welcome to minicom 2.3
OPTIONS:
Compiled on Apr 29 2008, 05:44:59.
Port /dev/usb/tts/0
Press CTRL-A Z for help on special keys
AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
OK
再改變baud rate, 查看modem是否初始化成功, 從而判斷能使用的連接速率. 如果能由廠商網站獲得進一步的資料, 則以廠商公佈的連接速率為準. 另外可切換不同的串列埠, 使用不同的AT command, 進一步查看除3G功能外, 還有沒有額外功能. 例如: 華為在Windows下的撥號程式, 可顯示電信網路的訊號強度, 那在Lly下如何獲得此資訊, 甚至900/1800等的頻道切換. 有沒有機會如同DD-WRT, Tomato一樣, 更改發射功率等.
4. USB_ModeSwitch 切換
主要是將3G modem由ZeroCD切換為數據機功能.(ZeroCD這名稱, 想想也蠻妙的) Lly r655內建1.0.5, CDMA@wifi 1.71內建0.9.4. 使用新版usb_modeswitch的用途在於支援更廣泛的3G modem. USB_ModeSwitch作者建議使用SniffUSB, 於windows下嗅出切換方法.
4-1) 執行檔
$ which usb_modeswitch
/usr/sbin/usb_modeswitch
$ usb_modeswitch --help
* usb_modeswitch: handle USB devices with multiple modes
* Version 1.0.5 (C) Josua Dietze 2009
* Based on libusb 0.1.12
Usage: usb_modeswitch [-hvpVPmMrdHn] [-c filename]
-h, --help this help
-e, --version print version number and exit
-v, --default-vendor [nr] vendor ID to look for (mandatory)
-p, --default-product [nr] product ID to look for (mandatory)
-V, --target-vendor [nr] target vendor (optional, for success check)
-P, --target-product [nr] target model (optional, for success check)
-C, --target-class [nr] target device class
-m, --message-endpoint [nr] where to direct the message (optional)
-M, --message-content [str] command to send (hex number as string)
-n, --need-response read a response to the message transfer
-r, --response-endpoint [nr] where from read the response (optional)
-d, --detach-only just detach the storage driver
-H, --huawei-mode apply a special procedure
-S, --sierra-mode apply a special procedure
-O, --sony-mode apply a special procedure
-R, --reset-usb reset the device in the end
-c, --config [filename] load different config file
-Q, --quiet don't show progress or error messages
-W, --verbose print all settings before running
-s, --success [nr] check switching result after [nr] secs
-I, --no-inquire do not get device details (default on)
-i, --interface select initial USB interface (default 0)
-u, --configuration select USB configuration
-a, --altsetting select alternative USB interface setting
觀察執行檔的參數選項, 有三種廠牌專用模式. 另外, 可選擇不同的USB interface. 那這是否意味著可插入二支以上3G modem(Multi WAN)? 還是切換不同的串列埠(3G modem其他特異功能)?
4-2) 設定檔
usb_modeswitch.conf, 可參閱USB_ModeSwitch官網這裡, 依照您的3G modem廠牌, 型號, 複製該3G modem的設定參數(記得看說明). 建立於/usr/local/etc/usb_modeswitch.conf(請想想, 為何要建立於/usr/local/etc/目錄內?)
$ nano /usr/local/etc/usb_modeswitch.conf
DefaultVendor=0x12d1;
DefaultProduct=0x1001
HuaweiMode=1
5. chat 通訊
觀察CDMA@wifi, /tmp/ppp/gprs/dial--> /tmp/ppp/gprs/update--> /tmp/ppp/peers/gprs.chat
$ cat /tmp/ppp/peers/gprs.chat
'' ''
'' 'ATZ'
'OK' 'ATI'
'OK' 'AT+COPS?'
'OK' 'AT+CGDCONT=1,"IP","internet"'
'OK' 'ATD*99#'
'CONNECT' ''
使用AT command與3G modem通訊. 包含初始化, 撥號號碼等. 換句話說, 若要使用3G modem特異功能, 可由此著手.
通訊紀錄
$ cat /tmp/chat.log
ATZ
OK
ATI
Manufacturer: huawei
Model: E169
Revision: 11.314.13.00.00
IMEI: xxxxxxxxxxxxxxx
+GCAP: +CGSM,+DS,+ES
OK
AT+COPS?
+COPS: 0,2,"46692",2
OK
AT+CGDCONT=1,"IP","internet"
OK
ATD*99#
CONNECTSerial connection established.
...
Lly也內建chat. 將CDMA@wifi的通訊檔(/tmp/ppp/peers/gprs.chat)先拿來用. 一樣放在/usr/local/etc/, 命名為e220.chat(或自己喜歡且能辨識的檔名).
$ which chat
/usr/sbin/chat
$ chat --help
Usage: chat [-e] [-E] [-v] [-V] [-t timeout] [-r report-file]
[-T phone-number] [-U phone-number2] {-f chat-file | chat-script}
6. pppd 撥號
使用Point-to-Point通訊協定與ISP通訊, 取得IP. 同樣先觀察CDMA@wifi.
/tmp/ppp/gprs/dial--> /tmp/ppp/gprs/update--> /tmp/ppp/chap-secrets, /tmp/ppp/pap-secrets, /tmp/ppp/peers/gprs
$ cat /tmp/ppp/peers/gprs
460800
debug
crtscts
noipdefault
ipcp-accept-local
lcp-echo-interval 60
lcp-echo-failure 5
usepeerdns
noauth
nodetach
user ""
connect "/usr/sbin/chat -s -S -V -t 30 -f /tmp/ppp/peers/gprs.chat 2>/tmp/chat.log"
pppd還有其他的設定說明, 可在其他Linux發行套件(例如: Mandriva)man之.
而Lly當然會內建pppd, 否則如何使用PPPoE.
$ which pppd
/usr/sbin/pppd
$ pppd --help
pppd version 2.4.5
Usage: pppd [ options ], where options are:
Communicate over the named device
Set the baud rate to
: Set the local and/or remote interface IP
addresses. Either one may be omitted.
asyncmap Set the desired async map to hex
auth Require authentication from peer
connect Invoke shell command
to set up the serial line
crtscts Use hardware RTS/CTS flow control
defaultroute Add default route through interface
file Take options from file
modem Use modem control lines
mru Set MRU value to for negotiation
See pppd(8) for more options.
在這部分有個需要注意的技巧. CDMA@wifi有USB Connection選項, 可將3G modem當作WAN. Lly WebUI並此選項. 但綜觀到目前為止的追蹤, 都是使用pppd與ISP撥號通訊. 所以, 在Lly一樣選用PPPoE, 才能產生pppd的process.
$ ps
pppd file /tmp/ppp/options.wan0
PPPoE有無帳號密碼而撥號成功與否不是重點, 重點在於置換/tmp/ppp/options.wan0, 讓pppd使用3G modem當成WAN. 所以, 抄襲CDMA@wifi的/tmp/ppp/peers/gprs, 置換Lly的/tmp/ppp/options.wan0. 注意最後一行, chat的路徑, 設定檔(e220.chat)的路徑, 必須改為符合自己於Lly下的設定. 如果由3G modem撥號不成功, 請自行檢查相關紀錄(dmesg, /tmp/syslog.log, /tmp/chat.log), 找出問題並解決.
7. script
好了, 到目前為止, 如果您自己更換相關設定, 使用3G modem手動撥號或PPPoE重撥, 確實能經由3G modem上網, 那就該準備將設定檔案存放到flashfs. 請先理解開機系統啟動檔流程.
7-1) 核心模組載入
參閱1-5說明, 若使用Lly韌體內建核心模組, 在/usr/local/sbin/post-boot使用insmod命令載入必要的核心模組; 若使用/opt/lib/modules/的核心模組, 在/usr/local/sbin/post-mount, 掛載/opt後, 使用modprobe或insmod命令載入必要的核心模組.
7-2) 設定檔
有usb_modeswitch.conf(切換), e220.chat(通訊), options.wan0(撥號), 放在/usr/local/etc/
7-3) options.wan0 置換
依照環境不同, 若不使用/opt, 在/usr/local/sbin/pre-mount中置換; 若使用/opt, 在/usr/local/sbin/post-mount中置換.
7-4) flashfs
$ flashfs save
注意是否有壓縮到相關設定檔. 壓縮後, 觀察flash.tar.gz大小.
$ flashfs commit
$ reboot
8. 驗證
重新開機後, 查閱相關紀錄檔, 檢查整個運作流程, 是否取得IP, Routing Table是否正確.
至此完工. 如能理解整個運作過程, 則取得前往DD-WRT, Tomato 3G的門票.
另外, 再提出一個小問題, 如何利用EzSetup按鈕, 作PPPoE與3G的切換? 聰明的您應該會有答案.
離線
#15 2010-02-10 23:04:37
Re: Lly 韌體 (Oleg 韌體分支)
hippo 提到:
(刪)
例如: 華為在Windows下的撥號程式, 可顯示電信網路的訊號強度, 那在Lly下如何獲得此資訊
LCD4Linux HUAWEI Plugin可顯示訊號強度等資訊, 有華為3G modem的網友可試試看.
離線
#16 2010-05-29 22:53:30
#19 2010-08-01 11:51:26
Re: Lly 韌體 (Oleg 韌體分支)
r1825釋出, 參閱History of Changes.
之前r1612在WL-500gx的WebUI無3G, r1825就有3G/CDMA了. 有3G modem的網友可以試試看.
離線
#20 2010-08-01 22:30:37
Re: Lly 韌體 (Oleg 韌體分支)
hippo 提到:
r1825釋出, 參閱History of Changes.
之前r1612在WL-500gx的WebUI無3G, r1825就有3G/CDMA了. 有3G modem的網友可以試試看.
千呼萬喚始出來
終於等到支援3G了
印象中lly也可以裝NTFS-3G對吧
這樣就完整了...
離線
相關討論主題
主題 | 回覆 | 點閱 | 最後發表 |
---|---|---|---|
置頂 |
152 | 531901 | 2015-09-26 19:03:04 作者 nune |
N16 刷 OLEG 1.9.2.7-rtn-4149 求助 作者 sb5101e
|
1 | 10391 | 2012-05-02 18:53:41 作者 sb5101e |
那位大侠帮忙把 Vuze 移植到 Oleg ? 作者 zhao.am
|
0 | 7453 | 2011-10-14 13:50:03 作者 zhao.am |
請問有人用 Oleg 灌osCommerce 2.2 ms2 作者 winsom
|
1 | 11174 | 2011-06-08 08:43:48 作者 Aven |
如何在 Tomato 下改刷 Oleg 韌體? 作者 dpeng678
|
2 | 15560 | 2009-12-12 06:03:50 作者 dpeng678 |