Ubuntu16.04ワイヤレスカードドライバのインストール+ワイヤレスホットスポットの設定(AP)


目次

  • USBワイヤレスカードを選ぶ--rtl 8821 CU
  • 関連ドライバのダウンロード--[https://github.com/qslia/rtl8821CU](https://github.com/qslia/rtl8821CU).
  • 取付手順
  • ワイヤレスホットスポット(AP)の設置
  • 携帯電話/ノートパソコンで接続可能
  • RealtekシリーズワイヤレスNIC Linuxドライバをインストールするには:https://blog.csdn.net/opipa/article/details/51919847.

    USBワイヤレスカード–rtl 8821 CUを選択


    関連ドライブのダウンロード–https://github.com/qslia/rtl8821CU.


    圧縮ファイルを取得:rtl 8821 CU-master.zipは、後続の操作のために/homeの下に配置します.

    インストールプロセス

    xxx@xxx:~$ sudo apt-get install dkmsxxx@xxx:~$ DRV_NAME=rtl8821CUxxx@xxx:~$ DRV_VERSION=5.2.5.3xxx@xxx:~$ sudo mkdir /usr/src/${DRV_NAME}-${DRV_VERSION}xxx@xxx:~$ git archive master | sudo tar -x -C /usr/src/${DRV_NAME}-${DRV_VERSION}・このときに次のようなエラーが発生した場合
    fatal: Not a git repository (or any parent up to mount point /home)
    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
    tar:          tar     
    tar:

    または
    fatal: Not a valid object name
    tar:          tar     
    tar:       ,           
    

    xxx@xxx:~$ sudo unzip rtl8821CU-master.zip -d /usr/src/${DRV_NAME}-${DRV_VERSION}xxx@xxx:~$ sudo mv /usr/src/rtl8821CU-5.2.5.3/rtl8821CU-master/ /usr/src/rtl8821CU-5.2.5.4/xxx@xxx:~$ sudo rm -r /usr/src/rtl8821CU-5.2.5.3xxx@xxx:~$ sudo mv /usr/src/rtl8821CU-5.2.5.4 /usr/src/rtl8821CU-5.2.5.3続いてxxx@xxx:~$ sudo dkms add -m ${DRV_NAME} -v ${DRV_VERSION}表示情報は以下の通り.
    Creating symlink /var/lib/dkms/rtl8821CU/5.2.5.3/source ->
                     /usr/src/rtl8821CU-5.2.5.3
                     
    DKMS: add completed.
    
    xxx@xxx:~$ sudo dkms build -m ${DRV_NAME} -v ${DRV_VERSION}表示情報は以下の通り.
    Kernel preparation unnecessary for this kernel.  Skipping...
    
    Building module:
    cleaning build area....
    'make' KVER=4.15.0-101-generic......................
    Signing module:
     - /var/lib/dkms/rtl8821CU/5.2.5.3/4.15.0-101-generic/x86_64/module/8821cu.ko
    Secure Boot not enabled on this system.
    cleaning build area....
    
    DKMS: build completed.
    
    xxx@xxx:~$ sudo dkms install -m ${DRV_NAME} -v ${DRV_VERSION}表示情報は以下の通り.
    8821cu:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/4.15.0-101-generic/updates/dkms/
    
    depmod.......
    
    DKMS: install completed.
    

    解凍したファイルを開く:xxx@xxx:~/rtl8821CU-master$ make多くの内容が表示され、動作を終了する:
    make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-101-generic'
    
    xxx@xxx:~/rtl8821CU-master$ sudo make install表示結果は以下の通り.
    install -p -m 644 8821cu.ko  /lib/modules/4.15.0-101-generic/kernel/drivers/net/wireless/
    /sbin/depmod -a 4.15.0-101-generic
    
    xxx@xxx:~/rtl8821CU-master$ sudo modprobe 8821cuこのときUSBワイヤレスカードを差し込むxxx@xxx:~$ lsusb見える
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 004: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
    Bus 001 Device 002: ID 046d:c31d Logitech, Inc. Media Keyboard K200
    Bus 001 Device 022: ID 0bda:1a2b Realtek Semiconductor Corp. 
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

    Bus 001 Device 022:ID 0 bda:1 a 2 b Realtek Semiconductor Corp.この行にはUSBワイヤレスカード情報が表示され、''0 bda:1 a 2 b''が表示されます.最後にUSBカードを切り替えるモードは無線LANカードモード:xxx@xxx:~$ sudo usb_modeswitch -KW -v 0bda -p 1a2b出力成功結果表示:
    Take all parameters from the command line
    
    
     * usb_modeswitch: handle USB devices with multiple modes
     * Version 2.2.5 (C) Josua Dietze 2015
     * Based on libusb1/libusbx
    
     ! PLEASE REPORT NEW CONFIGURATIONS !
    
    DefaultVendor=  0x0bda
    DefaultProduct= 0x1a2b
    
    StandardEject=1
    NeedResponse=0
    
    Look for default devices ...
      found USB ID 1d6b:0003
      found USB ID 046d:c077
      found USB ID 046d:c31d
      found USB ID 0bda:1a2b
       vendor ID matched
       product ID matched
      found USB ID 1d6b:0002
      found USB ID 1d6b:0003
      found USB ID 1d6b:0002
     Found devices in default mode (1)
    Access device 025 on bus 001
    Current configuration number is 1
    Use interface number 0
    Use endpoints 0x0b (out) and 0x8a (in)
    
    USB description data (for identification)
    -------------------------
    Manufacturer: Realtek
         Product: DISK
      Serial No.: not provided
    -------------------------
    Sending standard EJECT sequence
    Looking for active driver ...
     OK, driver detached
    Set up interface 0
    Use endpoint 0x0b for message sending ...
    Trying to send message 1 to endpoint 0x0b ...
     OK, message successfully sent
    Read the response to message 1 (CSW) ...
     Response successfully read (13 bytes).
    Trying to send message 2 to endpoint 0x0b ...
     OK, message successfully sent
    Read the response to message 2 (CSW) ...
     Device seems to have vanished after reading. Good.
     Device is gone, skip any further commands
    -> Run lsusb to note any changes. Bye!
    

    いくつかの失敗した出力結果は次のように表示されます.
    Take all parameters from the command line
    
    
     * usb_modeswitch: handle USB devices with multiple modes
     * Version 2.2.5 (C) Josua Dietze 2015
     * Based on libusb1/libusbx
    
     ! PLEASE REPORT NEW CONFIGURATIONS !
    
    DefaultVendor=  0x0bda
    DefaultProduct= 0x1a2b
    
    StandardEject=1
    NeedResponse=0
    
    Look for default devices ...
      found USB ID 1d6b:0003
      found USB ID 046d:c077
      found USB ID 046d:c31d
      found USB ID 0bda:1a2b
       vendor ID matched
       product ID matched
      found USB ID 1d6b:0002
      found USB ID 1d6b:0003
      found USB ID 1d6b:0002
     Found devices in default mode (1)
    Access device 022 on bus 001
    Current configuration number is 1
    Use interface number 0
    Use endpoints 0x0b (out) and 0x8a (in)
    
    USB description data (for identification)
    -------------------------
    Manufacturer: Realtek
         Product: DISK
      Serial No.: not provided
    -------------------------
    Sending standard EJECT sequence
    Looking for active driver ...
     OK, driver detached
    Set up interface 0
    Use endpoint 0x0b for message sending ...
    Trying to send message 1 to endpoint 0x0b ...
     OK, message successfully sent
    Read the response to message 1 (CSW) ...
     Response reading failed (error -7)
     Device is gone, skip any further commands
    -> Run lsusb to note any changes. Bye!
    

    再起動後再設定lsusb表示
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 004: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
    Bus 001 Device 002: ID 046d:c31d Logitech, Inc. Media Keyboard K200
    Bus 001 Device 022: ID 0bda:1a2b Realtek Semiconductor Corp. 
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

    Bus 001 Device 022:ID 0 bda:1 a 2 b Realtek Semiconductor Corp.この行にはUSBワイヤレスカード情報が表示され、''0 bda:1 a 2 b''が表示されます.最後にUSBカードを切り替えるモードは無線LANカードモード:sudo usb_modeswitch -KW -v 0bda -p 1a2bダメなら何度も試してみると良い.

    ワイヤレスホットスポットの設定(AP)


    https://jingyan.baidu.com/article/03b2f78c5a3c975ea237ae09.html.デスクトップ右上隅のネットワークをクリックして接続を編集…Wi-Fiを追加新規作成…Wi-Fiに勝手にリンク名を記入SSID(パソコンからの無線識別名)を記入モードバー選択ホットスポット(Hotspot)でWi-Fiセキュリティタブに切り替えWPAとWPA 2人を選択パスワードにパスワードを記入しIPv 4設定に切り替え方法で他のコンピュータと共有してIPv 6設定に切り替えるそして方法の中でIを選んで保存を無視して最後に順番にデスクトップの右上隅のネットワークをクリックして隠れたWi-Fiネットワークに接続してSSID接続を選択します

    このホットスポットに接続できる携帯電話/ノートパソコン