Planex GW-900Dのドライバモジュールの登録が前回うまく行えませんでした(raspberry piへのWi-Fiドングル「Planex GW-900D」のドライバモジュールの登録 )。web上で引き続きrtl8812auのドライバモジュールを探していると、ubuntuですが、githubからrtl8812auのドライバモジュールをダウンロードして、raspberry piにドライバモジュールとして登録する方法が載っていました(installing rtl8812au on ubuntu for wireless dual-band usb adapters)。これに基づき、再度ドライバのコンパイルから実施したところうまくいきました。

あらかじめraspberry piでドライバプログラムをコンパイルする環境を「Raspberry Piのデバイスドライバ開発環境の構築 」に従って構築しておきます。

更新されたrtl8812auのドライバモジュールをgithubからダウンロードします。

# git clone https://github.com/gnab/rtl8812au

ダウンロードしたrtl8812auのドライバモジュールをコンパイルします。

# cd rtl8812au
# vi os_dep/linux/usb_intf.c
237 行に
{USB_DEVICE(0x2019, 0xAB30),.driver_info = RTL8812}, /* Planex – Abocom */
が登録されていることを確認。
# make

コンパイルしたrtl8812auのドライバモジュールをインストールします。

# make install
# modprobe 8812au

ここでiwconfig コマンドでwlan0が登録されているかを調べます。modprobeコマンドを入力する前と後で、出力された結果を比較するとwlan0が登録されていることが分かります。

root@raspberrypi:/home/pi/GW-900D/rtl8812au# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

root@raspberrypi:/home/pi/GW-900D/rtl8812au# sudo modprobe 8812au
root@raspberrypi:/home/pi/GW-900D/rtl8812au# iwconfig
wlan0     unassociated  Nickname:""
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

lo        no wireless extensions.

eth0      no wireless extensions.

root@raspberrypi:/home/pi/GW-900D/rtl8812au#

dmesgコマンドでログで確認しました。上から2行でPlanex GW-900Dのドライバが読み込まれ、USBドングルを差し込むと、「 usb 1-1.2.1: new high-speed…」から認識されたログが出力されています。

root@raspberrypi:/home/pi/GW-900D/rtl8812au# dmesg
             ・
             ・
             ・
[  231.001319] RTL871X: rtl8812au driver version=v4.2.2_7502.20130517
[  231.001542] usbcore: registered new interface driver rtl8812au
[  269.577236] usb 1-1.2.1: new high-speed USB device number 6 using dwc_otg
[  269.666161] usb 1-1.2.1: New USB device found, idVendor=2019, idProduct=ab30
[  269.666196] usb 1-1.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  269.666213] usb 1-1.2.1: Product: GW-900D
[  269.666227] usb 1-1.2.1: Manufacturer: Planex Communications Inc.
[  269.666241] usb 1-1.2.1: SerialNumber: 123456
[  269.677495] RTL871X:
[  269.677495] usb_endpoint_descriptor(0):
[  269.677526] RTL871X: bLength=7
[  269.677536] RTL871X: bDescriptorType=5
[  269.677545] RTL871X: bEndpointAddress=81
[  269.677553] RTL871X: wMaxPacketSize=512
[  269.677561] RTL871X: bInterval=0
[  269.677569] RTL871X: RT_usb_endpoint_is_bulk_in = 1
[  269.677578] RTL871X:
[  269.677578] usb_endpoint_descriptor(1):
[  269.677589] RTL871X: bLength=7
[  269.677595] RTL871X: bDescriptorType=5
[  269.677603] RTL871X: bEndpointAddress=2
[  269.677610] RTL871X: wMaxPacketSize=512
[  269.677617] RTL871X: bInterval=0
[  269.677626] RTL871X: RT_usb_endpoint_is_bulk_out = 2
[  269.677634] RTL871X:
[  269.677634] usb_endpoint_descriptor(2):
[  269.677645] RTL871X: bLength=7
[  269.677654] RTL871X: bDescriptorType=5
[  269.677662] RTL871X: bEndpointAddress=3
[  269.677669] RTL871X: wMaxPacketSize=512
[  269.677676] RTL871X: bInterval=0
[  269.677684] RTL871X: RT_usb_endpoint_is_bulk_out = 3
[  269.677692] RTL871X:
[  269.677692] usb_endpoint_descriptor(3):
[  269.677703] RTL871X: bLength=7
[  269.677710] RTL871X: bDescriptorType=5
[  269.677717] RTL871X: bEndpointAddress=4
[  269.677724] RTL871X: wMaxPacketSize=512
[  269.677731] RTL871X: bInterval=0
[  269.677738] RTL871X: RT_usb_endpoint_is_bulk_out = 4
[  269.677746] RTL871X:
[  269.677746] usb_endpoint_descriptor(4):
[  269.677757] RTL871X: bLength=7
[  269.677764] RTL871X: bDescriptorType=5
[  269.677771] RTL871X: bEndpointAddress=85
[  269.677779] RTL871X: wMaxPacketSize=64
[  269.677787] RTL871X: bInterval=1
[  269.677796] RTL871X: RT_usb_endpoint_is_int_in = 5, Interval = 1
[  269.677805] RTL871X: nr_endpoint=5, in_num=2, out_num=3
[  269.677805]
[  269.677817] RTL871X: USB_SPEED_HIGH
[  269.677879] RTL871X: CHIP TYPE: RTL8812
[  269.677946] RTL871X: register rtw_netdev_ops to netdev_ops
[  269.678611] RTL871X: ReadChipVersion8812A SYS_CFG(0xF0)=0x04411135
[  269.678865] RTL871X: Chip Version Info: CHIP_8812_Normal_Chip_TSMC_C_CUT_2T2R_RomVer(0)
[  269.678884] RTL871X: RF_Type is 2!!
[  269.678903] RTL871X: _ConfigChipOutEP_8812 OutEpQueueSel(0x07), OutEpNumber(3)
[  269.678913] RTL871X: ====> ReadAdapterInfo8812AU
[  269.679093] RTL871X: Boot from EFUSE, Autoload OK !
[  270.106760] RTL871X: EEPROM ID=0x8129
[  270.106790] RTL871X: VID = 0x2019, PID = 0xAB30
[  270.106800] RTL871X: Customer ID: 0x00, SubCustomer ID: 0xCD
[  270.106819] RTL871X: hal_ReadMACAddress_8812AU MAC Address from EFUSE = 00:22:cf:df:98:21
[  270.106855] RTL871X: ==>mpt_GetChnlGroup8812A in 5G, but Channel 163 in Group not found
[  270.106875] RTL871X: ==>mpt_GetChnlGroup8812A in 5G, but Channel 163 in Group not found
[  270.106893] RTL871X: ==>mpt_GetChnlGroup8812A in 5G, but Channel 163 in Group not found
[  270.106910] RTL871X: ==>mpt_GetChnlGroup8812A in 5G, but Channel 163 in Group not found
[  270.106923] RTL871X: EEPROMRegulatory = 0x1 TxPwrCalibrateRate=0x0
[  270.106932] RTL871X: Board Type: 0x 0
[  270.106942] RTL871X: mlmepriv.ChannelPlan = 0x26
[  270.106952] RTL871X: CrystalCap: 0x20
[  270.106961] RTL871X: ThermalMeter = 0x21
[  270.106971] RTL871X: SWAS: bHwAntDiv = 0, TRxAntDivType = 3
[  270.106984] RTL871X: pHalData->PAType_2G is 0x3, pHalData->ExternalPA_2G = 0
[  270.106994] RTL871X: pHalData->PAType_5G is 0x3, pHalData->ExternalPA_5G = 1
[  270.107005] RTL871X: pHalData->LNAType_2G is 0x0, pHalData->ExternalLNA_2G = 0
[  270.107015] RTL871X: pHalData->LNAType_5G is 0x88, pHalData->ExternalLNA_5G = 1
[  270.107024] RTL871X: RFE Type: 0x 0
[  270.107035] RTL871X: PID= 0xab30, VID=  2019
[  270.107045] RTL871X: PID= 0xab30, VID=  2019
[  270.107053] RTL871X: Customer ID: 0x 0
[  270.114836] RTL871X: ReadAdapterInfo8812AU <====
[  270.115101] RTL871X: init_channel_set ChannelPlan ID 26 Chan num:32
[  270.116016] RTL871X: can't get autopm:
[  270.116046] RTL871X: rtw_macaddr_cfg MAC Address  = 00:22:cf:df:98:21
[  270.116061] RTL871X: bDriverStopped:1, bSurpriseRemoved:0, bup:0, hw_init_completed:0
[  270.120630] RTL871X: _rtw_drv_register_netdev, MAC Address (if1) = 00:22:cf:df:98:21
[  278.611696] RTL871X: rtw_wx_get_rts, rts_thresh=2347
[  278.611732] RTL871X: rtw_wx_get_frag, frag_len=2346
root@raspberrypi:/home/pi/GW-900D/rtl8812au#

lsmodコマンドで、カーネルのモジュールリストを表示します。「8812au」がPlanex GW-900Dのドライバプログラムのようです。

root@raspberrypi:/home/pi/GW-900D/rtl8812au# lsmod
Module                  Size  Used by
8812au               1049826  0
snd_bcm2835            17297  0
snd_pcm                63700  1 snd_bcm2835
snd_page_alloc          3612  1 snd_pcm
snd_seq                43926  0
snd_seq_device          4981  1 snd_seq
snd_timer              15936  2 snd_pcm,snd_seq
snd                    45195  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
soundcore               4827  1 snd
evdev                   9240  1
root@raspberrypi:/home/pi/GW-900D/rtl8812au#

lsusbでUSBに接続されているデバイスを検出します。PLANEXのWiFi無線LANのドライバがインストールされても、されていなくとも表示上の変化はありません。

root@raspberrypi:/home/pi/GW-900D/rtl8812au# lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 006: ID 2019:ab30 PLANEX
Bus 001 Device 005: ID 046d:c315 Logitech, Inc. Classic New Touch Keyboard