星期三, 5月 29, 2019

TX2 Kernel bug Ubuntu 16

https://discourse.osmc.tv/t/dhd-dpc-load-still-50/75585/8


2118 nvidia    20   0   94104  15036   6844 S  33.7  0.2   1850:58 python3
  827 root     -51   0       0      0      0 S  13.5  0.0 922:53.57 dhd_dpc
  829 root     -51   0       0      0      0 S   3.8  0.0 247:07.50 dhd_rxf
14225 nvidia    20   0    9340   3276   2564 R   3.8  0.0   0:02.18 top
    7 root      20   0       0      0      0 S   1.9  0.0  61:53.22 rcu_preempt
  114 root     -51   0       0      0      0 S   1.0  0.0  31:00.50 irq/69-15200000
  940 root      20   0 48.072g  33808  22184 S   1.0  0.4 256:47.72 Xorg

星期二, 5月 28, 2019

TI 3D ToF Calibration, Document





  • TI Designs People Counting for Demand Controlled Ventilation Using 3D Time-of-Flight (ToF) Reference Design

    • Wide field of view: H74.4° × V59.3°
    • 4.5.1.3 Image Subtraction
      • void Horus::clipBackground(Mat &dMat, Mat &iMat, float dThr, float iThr)
      • {
      •  for (int i = 0; i < dMat.rows; i++) {
      •  for (int j = 0; j < dMat.cols; j++) {
      •  float val = (iMat.at(i,j)>iThr && dMat.at(i,j)>dThr) ? 255.0 : 0.0;
      •  dMat.at(i,j) = val;
      •  }
      •  }
      • }
    • 4.5.2 Binary Image and Morphology Filter
      • 4.5.3.3 Region Growing
        • Figure 14. Region Growing Algorithm in People Counting [8]
      • 6.10 Install PCL
        •  freeglut3
        • • libboost-chrono1.55.0
        • • libboost-date-time1.55.0
        • • libboost-filesystem1.55.0
        • • libboost-iostreams1.55.0
        • • libboost-system1.55.0
        • • libboost-thread1.55.0
        • • libc6 (≥ 2.9)
        • • libgcc1 (≥ 1:4.4.0)
        • • libgl1-mesa-glx | libgl1
        • • libgomp1 (≥ 4.9)
        • • libpng12-0 (≥ 1.2.13-4)
        • • libqhull6 (≥ 2012.1)
        • • libstdc++6 (≥ 4.9)
        • • libusb-1.0-0 (≥ 2:1.0.8)
        • • libvtk5.8
        • If all the dependencies are met, install the pre-built PC

      • Install Voxel SDK 
        • debian# ./install_voxelsdk.sh
        • debian# cd /usr/local/include debian# sudo ln ±s voxel-0.6.0 voxel
        • debian# export VOXEL_SDK_PATH=/home/debian/Software/voxelsdk/build 
        •  debian# vi ~/.bashrc
        • export VOXEL_SDK_PATH=/home/debian/Software/voxelsdk/build 
      • 8.1 Frame Size and Frame Rate Performance
      • 8.2.1 OPT8241 CDK Power Profile
      • Simple People Tracking algorithm
    • Getting Started with  3D Time-of-Flight Sensing Session 5 System offset calibration
      • 3D-TOF Calibration Flow
        • Lens Calibration
        • – Find radial and tangential distortions so pin-hole camera
        • model can be used to compute point clouds from depths.
        • Frequency Calibration
        • – Compensate distance error arise from frequency error.
        • Nonlinearity Calibration
        • – Compensate for nonlinearity from imperfect sinusoids.
        • Common Phase Calibration
        • – Determine common phase offset at image center and
        • correlate that phase to a known distance.
        • Pixel-wise Calibration
        • – Determine expected additional offsets for off-center pixels
        • so distance to off-center pixels can be correlated.
        • Temperature Calibration
        • – Compensate for phase drift from temperature.


    星期四, 5月 23, 2019

    nmcli NMCLI






    Ethernet:

    • sudo nmcli  c add autoconnect yes save yes type ethernet ifname eth0 con-name jeth ip4 192.168.2.210/24 gw4 192.168.2.1 
    • sudo nmcli c mod jeth ipv4.addresses "192.168.2.210/24"
    • sudo nmcli c mod jeth ipv4.gateway 192.168.2.1
    • sudo nmcli c mod jeth ipv4.dns 168.95.1.1 
    • sudo nmcli c mod jeth ipv4.method manual
    • sudo nmcli con up jeth
    • nmcli connection show
    • modify
      • sudo nmcli con modify jeth ipv4.address "192.168.1.198/24"
      • sudo nmcli con mod jeth ipv4.gateway 192.168.1.201
      • sudo nmcli con up jeth
    Wifi:
    • sudo nmcli con add autoconnect yes save yes con-name jwifi ifname wlan0 type wifi ssid iSSA_ASUS_50_2.4G
    • sudo nmcli con mod jwifi wifi-sec.key-mgmt wpa-psk
    • sudo nmcli con mod jwifi wifi-sec.psk 54098542   
    • sudo nmcli con up jwifi  (很多秒)
    • nmcli connection show
    • Modify
      • sudo nmcli con mod jwifi wifi.ssid iSSA_ASUS_50_2.4G
      • sudo nmcli con mod jwifi wifi-sec.psk 54098542 
    Extend:
    • sudo nmcli c reload jack
    • nmcli -p con show my-con-em1
    • Example 1. Listing available Wi-Fi APs
      • nmcli device wifi list  ( Signal Bar)
      • nmcli -f all dev wifi list ( All Signal Bar)
    • Example 2. Showing general information and properties for a Wi-Fi interface
      • nmcli -p -f general,wifi-properties device show wlan0



    Renew eth0 connection status, if incorrect:

    • nmcli dev | grep "ethernet"


    Dispatcher: put in /etc/NetworkManager/dispatcher.d/70-wifi-wired-exclusive.sh 
    #!/bin/bash
    export LC_ALL=C
    
    enable_disable_wifi ()
    {
        result=$(nmcli dev | grep "ethernet" | grep -w "connected")
        if [ -n "$result" ]; then
            nmcli radio wifi off
        else
            nmcli radio wifi on
        fi
    }
    
    if [ "$2" = "up" ]; then
        enable_disable_wifi
    fi
    
    if [ "$2" = "down" ]; then
        enable_disable_wifi
    fi
          

    nmcli dev show eth0|grep CARRIER|tr -s ' '|cut -d ' ' -f2

    星期二, 5月 21, 2019

    TX2 GPIO




    1. sudo  cat /sys/kernel/debug/gpio
    2. echo 314 > /sys/class/gpio/export
    3. echo in >direction


    Reference:

    星期二, 5月 14, 2019

    Cuda+Cudnn + open3.4+contrib3.4 + camke + VS2017 +Win10


    Cuda+ Cudnn

    1. https://dotblogs.com.tw/cylcode/2018/09/20/163005
    2. CUDA下載:https://developer.nvidia.com/cuda-toolkit-archive
    3. cuDNN下載:https://developer.nvidia.com/rdp/cudnn-download
    4. visual studio下載https://my.visualstudio.com/Downloads/Featured
    5. env Path
    6. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
      C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64
      D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64
    7. nvcc -V


    opencv3.4+contrib3.4+cmake+VS2017+win10

    Prepare:

    1. opencv3.4源码https://github.com/opencv/opencv/archive/3.4.0.zip 
    2. opencv_contrib3.4源码https://github.com/opencv/opencv_contrib/archive/3.4.0.zip 
    3. cmake https://cmake.org/download/ 
    4. visual studio 2017 
    5. win10
    Cmake:
    • Configure check 
      • NVIDIA CUDA: YES (ver 10.1, CUFFT CUBLAS)
    • Generate
    • open project (Current Generator: Visual Studio 15 2017)
      • 用這個




    星期五, 5月 10, 2019

    Setup static network on the Jetson TX2

    Setup static network on the Jetson TX2

    sudo ifdown eth0
    /etc/network/interfaces.d/eth0
    sudo ifup eth0

    mosquitto MQTT





    1. sudo apt-get install mosquitto mosquitto-clients
    2. service mosquitto status
      1. /etc/mosquitto/mosquitto.conf


    星期三, 5月 01, 2019

    Xen server add new HBA storage


    Xen server add new HBA storage 

    Show storage device ID
    1. ll /dev/disk/by-id
    2. scsi-SATA_TOSHIBA_DT01ACA_395JNRRFS -> ../../sdc
    3.  scsi-SATA_TOSHIBA_MG03ACA_26P4KK76F -> ../../sdb
    4. Host-T5600-S0-103   6688a26f-1746-419d-b49a-157bb85e4418


    create new SR
    1.  xe sr-create content-type=user device-config:device=/dev/disk/by-id/scsi-SATA_TOSHIBA_DT01ACA_395JNRRFS host-uuid=6688a26f-1746-419d-b49a-157bb85e4418 name-label="96new_storage" shared=false type=ext