메뉴 건너뛰기

모듈 알아보기 - RaspberryPi.NCLab

Ubuntu 14.04 LTS(32bit), ArchLinuxARM Kernel 3.18.9+에서 진행

크로스컴파일러는 gcc-arm-linux-gnueabi 패키지를 사용

RaspberryPi가 192.168.1.231라는 주소로 Host와 통신할 수 있다고 가정

 

 

IMG_3658 사본.jpg

 

 

 

 

 

1. Ubuntu에서 MT7601 디바이스 드라이버 소스코드 다운도르

 

$ sudo apt-get install git -y
$ git clone https://github.com/porjo/mt7601.git

'mt7601' 이라는 디렉토리에 소스코드가 다운로드 됨

 

'ls'로 잘 다운로드 됐는지 확인

 

$ cd mt7601/src
$ ls

캡처.PNG

 

 

 

 

2. Makefile 수정

 

$ vim Makefile

 

약 198번째 줄에 있는 부분 중 크게 세 가지를 수정해야 함

 

ifeq ($(PLATFORM),PC)
# Linux 2.6
LINUX_SRC = /lib/modules/$(shell uname -r)/build
# Linux 2.4 Change to your local setting
#LINUX_SRC = /usr/src/linux-2.4
LINUX_SRC_MODULE = /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless/
CROSS_COMPILE =
endif

 

LINUX_SRC = ArchLinuxARM의 소스코드가 있는 디렉토리

 

$ git clone https://github.com/raspberrypi/linux.git

 

으로 받을 수 있음

 

LINUX_SRC_MODULE = 모듈이 설치된 디렉토에서 wireless에 관련된 모듈이 존재하는 디렉토리

 

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=../modules modules_install

이렇게 컴파일 했을때 ../modules/lib/modules/lib/modules/(RaspberryPi의 커널 버전)/kernel/drivers/net/wireless의 '절대경로'를 적어줘야 함
 

 

CROS_COMPILE = RaspberryPi에서 실행될 수 있도록 컴파일해 주는 크로스컴파일러의 접두사

 

$ sudo apt-get install -y gcc-arm-linux-gnueabi

로 설치할 수 있음

 

(예시)

 

ifeq ($(PLATFORM),PC)
# Linux 2.6
LINUX_SRC = /home/daekyeong/raspberry/linux
# Linux 2.4 Change to your local setting
#LINUX_SRC = /usr/src/linux-2.4
LINUX_SRC_MODULE = /home/daekyeong/raspberry/modules/lib/modules/3.18.9+/kernel/drivers/net/wireless/
CROSS_COMPILE = arm-linux-gnueabi-
endif

 

 

3. 크로스컴파일

이렇게 고쳐놓고 그냥 make를 하게 되면 다음과 같은 오류에 직면

daekyeong@ubuntu:~/raspberry/mt7601/src$ make
make -C tools
make[1]: Entering directory `/home/daekyeong/raspberry/mt7601/src/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/daekyeong/raspberry/mt7601/src/tools'
/home/daekyeong/raspberry/mt7601/src/tools/bin2h
cp -f os/linux/Makefile.6 /home/daekyeong/raspberry/mt7601/src/os/linux/Makefile
make -C /home/daekyeong/raspberry/linux SUBDIRS=/home/daekyeong/raspberry/mt7601/src/os/linux modules
make[1]: Entering directory `/home/daekyeong/raspberry/linux'
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_profile.o
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘-m64’
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘-mno-red-zone’
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘-mcmodel=kernel’
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘-mno-sse’
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘-mno-mmx’
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘-mno-sse2’
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘-mno-3dnow’
make[2]: *** [/home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_profile.o] 오류 1
make[1]: *** [_module_/home/daekyeong/raspberry/mt7601/src/os/linux] 오류 2
make[1]: Leaving directory `/home/daekyeong/raspberry/linux'
make: *** [LINUX] 오류 2


ARCH를  arm으로 지정해 줘서 해결

 

$ make ARCH=arm

 

 

daekyeong@ubuntu:~/raspberry/mt7601/src$ make ARCH=arm
make -C tools
make[1]: Entering directory `/home/daekyeong/raspberry/mt7601/src/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/daekyeong/raspberry/mt7601/src/tools'
/home/daekyeong/raspberry/mt7601/src/tools/bin2h
cp -f os/linux/Makefile.6 /home/daekyeong/raspberry/mt7601/src/os/linux/Makefile
make -C /home/daekyeong/raspberry/linux SUBDIRS=/home/daekyeong/raspberry/mt7601/src/os/linux modules
make[1]: Entering directory `/home/daekyeong/raspberry/linux'
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_profile.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/assoc.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/auth.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/auth_rsp.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/sync.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/sync.c: In function ‘PeerBeacon’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/sync.c:2183:12: warning: passing argument 8 of ‘StaAddMacTableEntry’ from incompatible pointer type [enabled by default]
In file included from /home/daekyeong/raspberry/mt7601/src/include/rt_config.h:59:0,
                 from /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/sync.c:28:
/home/daekyeong/raspberry/mt7601/src/include/rtmp.h:7892:9: note: expected ‘struct IE_LISTS *’ but argument is of type ‘struct BCN_IE_LIST **’
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/sanity.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/rtmp_data.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/rtmp_data.c: In function ‘STAHandleRxDataFrame’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/rtmp_data.c:523:4: warning: passing argument 2 of ‘MacTableLookup’ from incompatible pointer type [enabled by default]
In file included from /home/daekyeong/raspberry/mt7601/src/include/rt_config.h:59:0,
                 from /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/rtmp_data.c:28:
/home/daekyeong/raspberry/mt7601/src/include/rtmp.h:8429:18: note: expected ‘UCHAR *’ but argument is of type ‘UCHAR (*)[6]’
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/connect.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/wpa.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/sta_cfg.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/sta_cfg.c: In function ‘RtmpIoctl_rt_ioctl_siwgenie’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../sta/sta_cfg.c:7618:13: warning: assignment from incompatible pointer type [enabled by default]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/crypt_md5.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/crypt_sha2.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/crypt_hmac.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/crypt_aes.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/crypt_arc4.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/mlme.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_wep.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/action.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_data.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtmp_init.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtmp_init.c: In function ‘NICInitializeAsic’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtmp_init.c:1656:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtmp_init_inf.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_tkip.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_aes.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_sync.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/eeprom.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_sanity.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_info.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_info.c: In function ‘set_rf’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_info.c:5730:3: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 5 has type ‘UCHAR *’ [-Wformat]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_cfg.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_wpa.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_radar.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/spectrum.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtmp_timer.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rt_channel.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_profile.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_asic.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/scan.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_cmd.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/uapsd.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/ps.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../rate_ctrl/ra_ctrl.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../rate_ctrl/alg_legacy.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../rate_ctrl/alg_ags.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../chips/rtmp_chip.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/txpower.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../mac/rtmp_mac.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../mgmt/mgmt_hw.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../mgmt/mgmt_entrytb.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../phy/rtmp_phy.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../phy/rlt_phy.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../phy/rlt_rf.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/ba_action.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../mgmt/mgmt_ht.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rt_os_util.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/sta_ioctl.o
In file included from /home/daekyeong/raspberry/mt7601/src/include/os/rt_linux.h:56:0,
                 from /home/daekyeong/raspberry/mt7601/src/include/rtmp_os.h:44,
                 from /home/daekyeong/raspberry/mt7601/src/include/rtmp_comm.h:75,
                 from /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/sta_ioctl.c:30:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/sta_ioctl.c: In function ‘rt_ioctl_giwscan’:
include/net/iw_handler.h:542:9: warning: array subscript is below array bounds [-Warray-bounds]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_linux.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpDrvAllRFPrint’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_linux.c:2054:4: warning: passing argument 2 of ‘file_w->f_op->write’ from incompatible pointer type [enabled by default]
/home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_linux.c:2054:4: note: expected ‘const char *’ but argument is of type ‘UINT32 *’
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_main_dev.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_mac_usb.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPAllocTxRxRingMemory’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_mac_usb.c:562:31: warning: initialization from incompatible pointer type [enabled by default]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/cmm_data_usb.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtusb_io.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtusb_data.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtusb_bulk.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtusb_bulk.c: In function ‘RTUSBCancelPendingBulkOutIRP’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtusb_bulk.c:1680:15: warning: assignment from incompatible pointer type [enabled by default]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_usb.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_usb.c: In function ‘cmd_rsp_event_tasklet’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_usb.c:537:22: warning: assignment from incompatible pointer type [enabled by default]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/ee_prom.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/ee_efuse.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_and.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c: In function ‘MCUBurstWrite’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c:32:2: warning: passing argument 3 of ‘RTUSBMultiWrite_nBytes’ from incompatible pointer type [enabled by default]
In file included from /home/daekyeong/raspberry/mt7601/src/include/rt_config.h:59:0,
                 from /home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c:28:
/home/daekyeong/raspberry/mt7601/src/include/rtmp.h:7553:10: note: expected ‘PUCHAR’ but argument is of type ‘UINT32 *’
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c: In function ‘ChipOpsMCUHook’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c:64:25: warning: assignment from incompatible pointer type [enabled by default]
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c:71:25: warning: assignment from incompatible pointer type [enabled by default]
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c:72:27: warning: assignment from incompatible pointer type [enabled by default]
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c: In function ‘MCURandomWrite’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c:41:1: warning: control reaches end of non-void function [-Wreturn-type]
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c: In function ‘MCUBurstWrite’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_mcu.c:33:1: warning: control reaches end of non-void function [-Wreturn-type]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../mcu/rtmp_M51.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rt_rf.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../chips/mt7601.o
/home/daekyeong/raspberry/mt7601/src/os/linux/../../chips/mt7601.c: In function ‘MT7601DisableTxRx’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../chips/mt7601.c:1491:3: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
/home/daekyeong/raspberry/mt7601/src/os/linux/../../chips/mt7601.c: In function ‘MT7601_Init’:
/home/daekyeong/raspberry/mt7601/src/os/linux/../../chips/mt7601.c:3387:24: warning: assignment from incompatible pointer type [enabled by default]
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../mac/ral_omac.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/rt_usb_util.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../os/linux/usb_main_dev.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/rtusb_dev_id.o
  CC [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/../../common/frq_cal.o
  LD [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/mt7601Usta.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/daekyeong/raspberry/mt7601/src/os/linux/mt7601Usta.mod.o
  LD [M]  /home/daekyeong/raspberry/mt7601/src/os/linux/mt7601Usta.ko
make[1]: Leaving directory `/home/daekyeong/raspberry/linux'
cp -f /home/daekyeong/raspberry/mt7601/src/os/linux/mt7601Usta.ko /tftpboot 2>/dev/null || :

 

 

4. 디바이스 드라이버 모듈 및 데이터 전송

RaspberryPi로 RT2870STA.datmt7601Usta.ko 파일 전송

 

$ scp RT2870STA.dat root@192.168.1.231:/root
$ scp os/linux/mt7601Usta.ko root@192.168.1.231:/root

 

 

 

5. RaspberryPi에서 설치

ssh를 통해 RaspberryPi에 접속

 

$ ssh root@192.168.1.231


파일을 수신한 디렉토리로 이동

 

# cd /root

 

다음과 같이 입력하여 설치

 

# rm -rf /etc/Wireless/RT2870STA
# mkdir /etc/Wireless
# mkdir /etc/Wireless/RT2870STA
# cp RT2870STA.dat /etc/Wireless/RT2870STA/.
# install -d /lib/modules/$(uname -r)/kernel/drivers/net/wireless/
# install -m 644 -c mt7601Usta.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/
# /sbin/depmod -a $(uname -r)

 

 

 

 

 

6. usb.ids 업데이트

USB의 VID와 PID에 대한 최신 정보를 가져오기 위해 usb.ids를 업데이트

 

# cd /usr/share/hwdata/
# rm usb.ids
# wget http://www.linux-usb.org/usb.ids

 

 

7. 적용 확인

이제 본격적으로 RaspberryPi가 ipTime N150UA 무선랜카드를 인식하는지 확인할 것이므로

RaspberryPi에 ipTime N150UA를 연결

 

USB 장치에서 제대로 된 정보를 가져오는지 확인

 

# lsusb
Bus 001 Device 008: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

커널 메시지 확인

 

# dmesg
[ 7659.233355] usb 1-1.3: new high-speed USB device number 8 using dwc_otg
[ 7659.355106] usb 1-1.3: New USB device found, idVendor=148f, idProduct=7601
[ 7659.367373] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7659.382416] usb 1-1.3: Product: 802.11 n WLAN
[ 7659.393963] usb 1-1.3: Manufacturer: MediaTek
[ 7659.403975] usb 1-1.3: SerialNumber: 1.0
[ 7659.468432] rtusb init rt2870 --->
[ 7659.482435] ===>rt2870_probe()!
[ 7659.493395] --> RTMPAllocAdapterBlock
[ 7659.505049] 

=== pAd = dd37f000, size = 849704 ===

[ 7659.536773] --> RTMPAllocTxRxRingMemory
[ 7659.548219] <-- RTMPAllocTxRxRingMemory, Status=0
[ 7659.561019] <-- RTMPAllocAdapterBlock, Status=0
[ 7659.572120] NumEndpoints=8
[ 7659.581547] BULK IN MaxPacketSize = 512
[ 7659.591872] EP address = 0x84
[ 7659.601225] BULK IN MaxPacketSize = 512
[ 7659.611212] EP address = 0x85
[ 7659.620135] BULK OUT MaxPacketSize = 512
[ 7659.630239] EP address = 0x 8  
[ 7659.639440] BULK OUT MaxPacketSize = 512
[ 7659.649487] EP address = 0x 4  
[ 7659.658644] BULK OUT MaxPacketSize = 512
[ 7659.668416] EP address = 0x 5  
[ 7659.677360] BULK OUT MaxPacketSize = 512
[ 7659.687030] EP address = 0x 6  
[ 7659.695713] BULK OUT MaxPacketSize = 512
[ 7659.705285] EP address = 0x 7  
[ 7659.712893] BULK OUT MaxPacketSize = 512
[ 7659.723080] EP address = 0x 9  
[ 7659.731840] RTMP_COM_IoctlHandle():pAd->BulkOutEpAddr=0x8
[ 7659.743026] RTMP_COM_IoctlHandle():pAd->BulkOutEpAddr=0x4
[ 7659.754163] RTMP_COM_IoctlHandle():pAd->BulkOutEpAddr=0x5
[ 7659.764199] RTMP_COM_IoctlHandle():pAd->BulkOutEpAddr=0x6
[ 7659.775805] RTMP_COM_IoctlHandle():pAd->BulkOutEpAddr=0x7
[ 7659.786642] RTMP_COM_IoctlHandle():pAd->BulkOutEpAddr=0x9
[ 7659.797330] STA Driver version-3.0.0.3
[ 7659.807109] -->MT7601_Init():
[ 7659.815828] Chip specific bbpRegTbSize=0!
[ 7659.825688] Chip VCO calibration mode = 0!
[ 7659.836353] NVM is EFUSE
[ 7659.844498] Efuse Size=0x1d [Range:1e0-1fc] 
[ 7659.854419] Endpoint(8) is for In-band Command
[ 7659.864294] Endpoint(4) is for WMM0 AC0
[ 7659.872348] Endpoint(5) is for WMM0 AC1
[ 7659.882171] Endpoint(6) is for WMM0 AC2
[ 7659.891203] Endpoint(7) is for WMM0 AC3
[ 7659.900133] Endpoint(9) is for WMM1 AC0
[ 7659.908845] Endpoint(84) is for Data-In
[ 7659.917492] Endpoint(85) is for Command Rsp
[ 7659.926509] Allocate a net device with private data size=0!
[ 7659.937058] Allocate net device ops success!
[ 7659.947874] The name of the new ra interface is ra0...
[ 7659.958053] RtmpOSNetDevAttach()--->
[ 7659.975365] <---RtmpOSNetDevAttach(), ret=0
[ 7659.994345] <===rt2870_probe()!
[ 7660.009193] usbcore: registered new interface driver rt2870


삽입된 모듈 확인

 

# lsmod
Module                  Size  Used by
mt7601Usta            836087  0 
cfg80211              460399  0 
rfkill                 22202  1 cfg80211
binfmt_misc             7097  1 
snd_soc_wm8804          8209  0 
snd_soc_tas5713         5866  0 
snd_soc_pcm512x_i2c     2134  0 
snd_soc_pcm512x         8468  1 snd_soc_pcm512x_i2c
regmap_spi              2307  1 snd_soc_wm8804
regmap_i2c              2913  3 snd_soc_wm8804,snd_soc_pcm512x_i2c,snd_soc_tas5713
snd_soc_bcm2708_i2s     7360  0 
regmap_mmio             3548  1 snd_soc_bcm2708_i2s
spi_bcm2708             5961  0 
snd_soc_core          173464  4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_tas5713,snd_soc_bcm2708_i2s
i2c_bcm2708             6144  0 
snd_compress            8683  1 snd_soc_core
snd_pcm_dmaengine       5826  1 snd_soc_core
snd_bcm2835            21062  0 
snd_pcm                90116  4 snd_bcm2835,snd_soc_wm8804,snd_soc_core,snd_pcm_dmaengine
snd_timer              22618  1 snd_pcm
snd                    66018  5 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_compress
bcm2708_rng             1196  0 
ipv6                  350516  0 


어떤 인터페이스로 인식되었는지 확인

 

# cat /proc/net/wireless 
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
   ra0: 0000    0     0     0        0      0      0      0      0        0

ra0 라는 인터페이스로 인식되었음을 알 수 있음

 

 

8. Wi-Fi 쉬운 연결

가장 간단한 방법은 'wifi-menu -o'를 이용하는 것

 

# wifi-menu -o
Scanning for networks... 

 

연결할 AP 선택

캡처1.PNG

 

프로파일 이름 선택(추후 '/etc/netctl/파일 이름' 에 저장됨)

캡처2.PNG

 

암호 입력

캡처3.PNG

 

잘 연결 됐는지 확인

 

 

# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.231  netmask 255.255.255.0  broadcast 192.168.1.255
        ether b8:27:eb:6f:16:43  txqueuelen 1000  (Ethernet)
        RX packets 62060  bytes 80628678 (76.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 33639  bytes 4302410 (4.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ra0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.11.117  netmask 255.255.255.0  broadcast 192.168.11.255
        ether 64:e5:99:f8:8f:2c  txqueuelen 1000  (Ethernet)
        RX packets 3880  bytes 628131 (613.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 114  bytes 13144 (12.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



8-1. Wi-Fi 수동 연결

숨겨진 네트워크에 연결하거나 IP 주소를 static으로 설정하려면

/etc/netctl/ 디렉토리 아래에 설정 파일을 생성

 

# cd /etc/netctl
# nano ra0-nclab_g300

'ra0'는 위에서 확인했던 네트워크 인터페이스 이름

'nclab_g300'은 접속할 AP 이름

 

다음과 같이 작성하되,

static 주소를 사용하려면 IP 부분을 수정하고 Address, gateway, DNS를 추가해야 함

 

Description='Automatically generated profile by wifi-menu'
Interface=ra0
Connection=wireless
Security=wep
ESSID=nclab_g300
IP=dhcp
Key=암호

 

Description='Automatically generated profile by wifi-menu'
Interface=ra0
Connection=wireless
Security=wep
ESSID=nclab_g300
IP=static
Key=암호
Address=('192.168.1.77/24')
gateway=('192.168.1.1')
DNS=('8.8.8.8' '203.253.31.1' '168.126.63.1')

SecurityESSID는 연결하려는 AP의 보안 종류나 SSID에 따라 다를 수 있음

 

생성한 파일 이름으로 다음과 같이 입력하면 AP에 연결됨

# netctl start ra0-nclab_g300

 

만약 RaspberryPi가 부팅될 때 자동으로 연결하고 싶다면 다음과 같이 입력

# netctl enable ra0-nclab_g300
 

참고자료 : 

Rants & Raves - The Blog!.pdf

mt7601-master.zip

 

참고링크 : 

http://raspberrypi.stackexchange.com/questions/7987/wifi-configuration-on-arch-linux-arm

http://qdosmsq.dunbar-it.co.uk/blog/2013/06/beginners-guide-to-arch-linux-on-the-raspberry-pi-part-2/comment-page-1/

 

 

 

 

 

위로