|
|

楼主 |
发表于 2007-10-6 00:29:58
|
显示全部楼层
三、无线网络
009.安装无线软件
- # [color=blue]emerge -av usbutils [/color]
- # [color=blue]emerge -av ipw2200-firmware [/color]
- # [color=blue]emerge -av wireless-tools [/color]
- # [color=blue]emerge bluez-libs bluez-utils[/color]
复制代码
010.Fn+F5(蓝牙+WiFi)
- # [color=blue]nano -w /etc/acpi/events/wifi[/color]
- # FN+F5 (bluetooth+wifi)
-
- event=ibm/hotkey HKEY 00000080 00001005
- action=/etc/acpi/actions/ibm-wireless.sh
复制代码
- # [color=blue]nano -w /etc/acpi/actions/wireless.sh[/color]
- #!/bin/sh
- # Find and toggle wireless of bluetooth devices on ThinkPads
- #. /etc/acpi/state-funcs
- # Return 0 if there is, allowing you to write if isAnyWirelessPoweredOn; then ...
- isAnyWirelessPoweredOn()
- {
- for DEVICE in /sys/class/net/* ; do
- if [ -d $DEVICE/wireless -a -r $DEVICE/device/power/state ] ; then
- # If any of the wireless devices are turned on then return success
- if [ "`cat $DEVICE/device/power/state`" -eq 0 ] ; then
- # Check if 'rf_kill' disagrees
- if [ -r $DEVICE/device/rf_kill ] ; then
- if [ "`cat $DEVICE/device/rf_kill`" -eq 0 ] ; then
- # And rf_kill has the radio on
- return 0
- fi
- else
- return 0
- fi
- fi
- fi
- done
- # otherwise return failure
- return 1
- }
- # Takes no parameters, toggles all wireless devices.
- # TODO: Should possible toggle all wireless devices to the state of the first one.
- # Attempts to use 'rf_kill' first, and then tries 'power/state', though that
- # will fail on >=2.6.18 kernels since upstream removed the functionality...
- toggleAllWirelessStates()
- {
- for DEVICE in /sys/class/net/* ; do
- if [ -d $DEVICE/wireless ] ; then
- # $DEVICE is a wireless device. Check if it's powered on:
- ON=0
- OFF=1 # 1 for rf_kill, 2 for power/state
- for CONTROL in $DEVICE/device/rf_kill $DEVICE/device/power/state ; do
- if [ -w $CONTROL ] ; then
- # We have a way of controlling the device, lets try
- if [ "`cat $CONTROL`" = 0 ] ; then
- # It's powered on. Switch it off.
- if echo -n $OFF > $CONTROL ; then
- break
- else
- OFF=2 # for power/state, second time around
- fi
- else
- # It's powered off. Switch it on.
- if echo -n $ON > $CONTROL ; then
- break
- fi
- fi
- fi
- done
- fi
- done
- }
- ##Find and toggle wireless of bluetooth devices on ThinkPads
- BLUETOOTH=/proc/acpi/ibm/bluetooth
- if [ -r $BLUETOOTH ]; then
- grep -q disabled $BLUETOOTH
- bluetooth_state=$?
- fi
- # Note that this always alters the state of the wireless!
- toggleAllWirelessStates;
- # Sequence is Both on, Bluetooth only, Wireless only, Both off
- if ! isAnyWirelessPoweredOn; then
- # Wireless was turned off
- if [ -w $BLUETOOTH ]; then
- if [ "$bluetooth_state" = 0 ]; then
- echo enable > $BLUETOOTH;
- else
- echo disable > $BLUETOOTH
- fi
- fi
- fi
复制代码
- # [color=blue]chmod a+x /etc/acpi/actions/wireless.sh[/color]
复制代码
011.蓝牙与Symbian手机连接
参考连接:http://www.thinkwiki.org/wiki/How_to_setup_Bluetooth
- # [color=blue]emerge -av obexfs p3nfs[/color]
复制代码- # [color=blue]nano -w /etc/bluetooth/rfcomm.conf[/color]
- # RFCOMM configuration file.
- #
-
- rfcomm0 {
- # Automatically bind the device at startup
- # bind no;
- bind yes;
-
- # Bluetooth address of the device
- device 00:18:8D:6F:0E:49;
-
- # RFCOMM channel for the connection
- channel 1;
-
- # Description of the connection
- comment "symbian connection";
- }
复制代码
- # [color=blue]modprobe uhci_hcd ; modprobe ehci_hcd ; modprobe hci_usb [/color]
- # [color=blue]hcitool scan [/color]
- # [color=blue]hcitool inq [/color]
- # [color=blue]l2ping 00:18:8D:6F:0E:49 [/color]
复制代码
- # [color=blue]nano -w /etc/bluetooth/hcid.conf[/color]
- # HCI daemon configuration file.
- #
- # HCId options
- options {
- autoinit yes;
- security auto;
- pairing;
- passkey "123456";
- }
- # Default settings for HCI
- device {
- name "Hooong (%d)"; ## 设定你的名字
- class 0x000100;
- iscan enable; pscan;
- lm;
- lp rswitch,hold,sniff,;
- }
复制代码
- # [color=blue]/etc/init.d/bluetooth start [/color]
复制代码
- # [color=blue]modprobe nfs[/color]
- # [color=blue]modprobe nfsd [/color]
- # [color=blue]/etc/init.d/portmap start[/color]
复制代码
从这里下载与你手机对应的软件:http://www.koeniglich.de/p3nfs.html,在手机安装。
- # [color=blue]obexftp -b 00:18:8D:6F:0E:49-p /home/tava/ablage/nfsapp* [/color]
- # [color=blue]p3nfsd -UIQ -tty /dev/rfcomm0 -dir /mnt/bluetooth[/color]
复制代码
012.安装红外
参考连接:http://www.thinkwiki.org/wiki/How_to_make_use_of_IrDA
参考连接:http://gentoo-wiki.com/HOWTO_mobile_phone_connected_with_IrDA
- # [color=blue]nano -w /etc/modules.d/nsc-irrc [/color]
- alias irda0 nsc-ircc
- options nsc-ircc dongle_id=0x09 io=0x2f8 irq=3 dma=3
复制代码
- # [color=blue]update-modules[/color]
- # [color=blue]modprobe nsc-ircc[/color]
复制代码- # [color=blue]nano -w /etc/modules.autoload.d/kernel-2.6[/color]
- nsc-ircc
复制代码
如果FIR模块不会加载,你需要如下操作挂载模块。
- # [color=blue]rmmod nsc_ircc[/color]
- # [color=blue]echo disable > /sys/devices/pnp0/00\:09/resources[/color]
- # [color=blue]echo activate > /sys/devices/pnp0/00\:09/resources[/color]
- # [color=blue]modprobe nsc_ircc [/color]
复制代码
增加PPP拨号支持。
- # [color=blue]modprobe irnet [/color]
- # [color=blue]echo 1 > /proc/sys/net/irda/max_tx_window [/color]
- 设置同时最大连接数
- # [color=blue]echo 4000000 > /proc/sys/net/irda/max_baud_rate [/color]
- 设置最大传输速度
复制代码
- # [color=blue]irattach irda0 -s [/color]
- # [color=blue]irdadump [/color]
复制代码
执行这个命令后,会搜索当前红外设备。
- # [color=blue]irdaping 26b088c6 [/color]
- # [color=blue]cat /proc/net/irda/irlap [/color]
复制代码
显示IRDA连接信息
- # [color=blue]ifconfig [/color]
复制代码
这里你会发现多出一个irda0网络接口
虽然这里显示有连接信息,但我还不会用来挂载手机或红外连接手机无线上网。呵呵!
013.USB数据线连接西门子M65手机 GPRS上网
参考连接:http://markus.wernig.net/en/it/usb-serial-handy-ppp.phtml
a.我用PL2301 芯片的数据线,内核配置:
- Device Drivers -> Networking Support -> Network Device Support
- CONFIG_PPP=m
- # CONFIG_PPP_MULTILINK is not set
- CONFIG_PPP_FILTER=y
- CONFIG_PPP_ASYNC=m
- CONFIG_PPP_SYNC_TTY=m
- CONFIG_PPP_DEFLATE=m
- CONFIG_PPP_BSDCOMP=m
- # CONFIG_PPPOE is not set
-
- Device Drivers -> USB support
- CONFIG_USB=m
- CONFIG_USB_ARCH_HAS_HCD=y
- CONFIG_USB_ARCH_HAS_OHCI=y
- CONFIG_USB_OHCI_HCD=m
- CONFIG_USB_UHCI_HCD=m
- CONFIG_USB_ACM=m
- CONFIG_USB_SERIAL=m
- CONFIG_USB_SERIAL_GENERIC=y
- CONFIG_USB_SERIAL_PL2303=m
- CONFIG_USB_PL2301=y
复制代码
b.加载模块
- # [color=blue]modprobe cdc-acm[/color]
- # [color=blue]modprobe usbserial [/color]
- # [color=blue]modprobe pl2303[/color]
复制代码
c.拨号设定
- # [color=blue]nano -w /etc/ppp/peers/siemens [/color]
- user jiang
- password 123456
- defaultroute
- /dev/ttyUSB0
- connect "/usr/sbin/chat -v -f /etc/ppp/siemens.chat"
- debug
- kdebug 4
- ipcp-no-addresses
- noipdefault
- noauth
- novj
- noccp
复制代码
- # [color=blue]nano -w /etc/ppp/siemens.chat [/color]
- 'ABORT' 'BUSY'
- 'ABORT' 'ERROR'
- 'ABORT' 'NO ANSWER'
- 'ABORT' 'NO CARRIER'
- 'ABORT' 'NO DIALTONE'
- 'ABORT' 'Invalid Login'
- 'ABORT' 'Login incorrect'
- '' 'ATZ'
- 'TIMEOUT' '10'
- 'OK' 'ATM1L1'
- 'OK' 'AT&f+cgdcont=1,"IP","cmnet","",0,0'
- 'OK' 'ATDT*99***1#'
- 'CONNECT' ''
复制代码
最后你在终端输入:pppd call siemens 就已经连接上网啦。 |
|