Franka Ubuntu使用準備


使用コマンドの準備

$sudo apt update
$sudo apt upgrade

ifconfig
$ sudo apt install net-tools

ssh-login
$ sudo apt install openssh-server

ユーザー追加してsudo可能に設定
$ sudo adduser masumi
$ sudo gpasswd -a masumi sudo

gitとgitのグローバル設定
$ sudo apt install git
$ git config --global credential.helper store
$ git config --global user.email "[email protected]" メルアドを設定
$ git config --global user.name "Taro Nihon" 氏名を設定

AWS CodeCommit
$ git clone https://git-codecommit.us-east-2.amazonaws.com/v1/repos/franka_test1
Cloning into 'franka_test1'...
Username for 'https://git-codecommit.us-east-2.amazonaws.com': ユーザー名入力
Password for 'https://ユーザー名@git-codecommit.us-east-2.amazonaws.com': パスワード入力
remote: Counting objects: 277, done.
Receiving objects: 100% (277/277), 66.21 KiB | 96.00 KiB/s, done.
Resolving deltas: 100% (162/162), done.

キーバインド変更(一部のPCで効かない)
$ setxkbmap -option ctrl:swapcpas
キーバインド戻す
$ setxkbmap -option

キーバインド変更(一部のPCで効かない)
$ sudo vi /etc/default/keyboard
XKBOPTIONS="ctrl:swapcaps"
$ sudo systemctl restart console-setup
Ubuntu再起動

gcc,g++,make
$ sudo apt install gcc
$ sudo apt install g++
$ sudo apt install make

menuconfig
$ sudo apt-get install libncurses5-dev

bash-alias
$ vi ~/.bash_aliases
alias l='ls -l'
alias la='ls -al'
alias lt='ls -lt'
alias lsrc='ls -l *.c *.h *.cpp'
alias d='dirs'
alias da='date'
alias h='history'
alias pd='pushd'
alias pd2='pushd +2'
alias pd3='pushd +3'
alias pd4='pushd +4'
alias md='mkdir'
alias j='jobs'

sudo権限でのLD_LIBRARY_PATH追加
$ sudo vi /etc/ld.so.conf
/opt/ros/melodic/lib この行を追加
$ sudo ldconfig

動作クロック確認
$ sudo apt install cpufrequtils

Ethernetリンク速度表示
$ sudo apt install ethtool

時刻が9時間ずれるので対応

BIOSの時刻を日本時間に合わせる
WindowsはBIOS日本時間を使う
UbuntuはBIOS時間をローカル時間として解釈するように設定する

$ timedatectl set-local-rtc true

EPSON EndeavorのEthernet使用

Intel I219-Vのドライバを以下からダウンロード
https://www.intel.com/content/www/us/en/download/14611/15817/intel-network-adapter-driver-for-pcie-intel-gigabit-ethernet-network-connections-under-linux.html

ビルドとインストール

$ tar xf e1000e-3.8.4.tar.gz
$ cd e1000e-3.8.4/src/
$ vi nvm.c
s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw)
{
        return 0; /* この関数を無処理にする */
} 
$ sudo make install
$ sudo modprobe -r e1000e
$ sudo modprobe e1000e
$ dmesg | grep -i e1000
[  470.573246] e1000e: loading out-of-tree module taints kernel.
[  470.573502] e1000e: module verification failed: signature and/or required key missing - tainting kernel
[  470.577509] e1000e: Intel(R) PRO/1000 Network Driver - 3.8.4-NAPI
[  470.577510] e1000e: Copyright(c) 1999 - 2020 Intel Corporation.
[  470.577996] e1000e 0000:00:1f.6: Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
[  471.023527] e1000e 0000:00:1f.6 0000:00:1f.6 (uninitialized): registered PHC clock
[  471.114089] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) d8:97:ba:39:15:e2
[  471.114091] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection
[  471.114280] e1000e 0000:00:1f.6 eth0: MAC: 13, PHY: 12, PBA No: FFFFFF-0FF
[  471.117633] e1000e 0000:00:1f.6 eno1: renamed from eth0
[  556.332827] e1000e 0000:00:1f.6 eno1: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.102/0.131/0.306/0.015 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.099/0.131/0.219/0.015 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.104/0.132/0.231/0.013 ms

参照
https://qiita.com/matsuo7005/items/b0037b6450d752378316

Realtek8821auのWLAN使用

$ git clone https://github.com/gnab/rtl8812au
$ cd rtl8812au
$ make
$ sudo make install

以下はちょっと古い

$ git clone https://github.com/scrivy/rtl8812AU_8821AU_linux.git
$ cd rtl8812AU_8821AU_linux
$ make
$ sudo make install

PCIeのEthernet使用 TP-Link

$ lspci
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Device 8161 (rev 15)
$ ethtool enp3s0
Settings for enp3s0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
                                         1000baseT/Full 
    Link partner advertised pause frame use: Symmetric Receive-only
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000033 (51)
                   drv probe ifdown ifup
    Link detected: yes
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.123/0.282/0.360/0.023 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.136/0.282/0.396/0.015 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.121/0.283/0.438/0.022 ms
マザーボードのEthernetコントローラよりも遅い

PCIeのEthernet使用 NoBland

$ lspci
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 02)
$ ethtool enp3s0
Settings for enp3s0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
                                         1000baseT/Full 
    Link partner advertised pause frame use: Symmetric Receive-only
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000033 (51)
                   drv probe ifdown ifup
    Link detected: yes
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.126/0.316/0.406/0.021 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.126/0.316/0.409/0.018 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.112/0.315/0.401/0.023 ms
マザーボードのEthernetコントローラよりも遅い

不要なカーネルを削除する

$ dpkg --get-selections | grep linux-
$ sudo apt-get autoremove --purge linux-image-3.13.0-{65,71}

メモ

keyswap
https://linuxfan.info/capslock-ctrl
apt apt-get 違い
https://qiita.com/quzq/items/8e47414bf95d1fcfa24a