發表文章

NFS server and client setup on Ubuntu

Server: NFS server (ex: 192.168.0.1) Client: NFS client (ex: 192.168.0.2) Server [ 編輯  |  編輯原始碼 ] Install nfs server sudo apt-get install nfs-kernel-server nfs-common create share folder sudo mkdir -p /var/ota sudo chown nobody:nogroup /var/ota sudo vi /etc/exports, add following line to /etc/exports  NOTE: use 'tab' as seperator, do not use 'space' /var/ota 192 .168.0.2 ( rw,sync,no_subtree_check ) start nfs server sudo service nfs-kernel-server start Client [ 編輯  |  編輯原始碼 ] mount the shared folder sudo mkdir -p /mnt/nfs/ota sudo mount -t nfs 192 .168.0.1:/var/ota /mnt/nfs/ota/

GStreamer memo

Introduction Please use the default build-in gtreamer 1.0 on Jetson Nano. Nvidia upstream the Nvidia plugins (ex:  nv arguscamerasrc,  nv vidconv,  nv videosink etc) to gstreamer for easy maintain. GStreamer WIKI Tutorial If you are not familiar with the concept of "pipeline", please read the following URL. (Use the "translation", and you also can find some Chinese documents on web) GStreamer concepts, HelloWorld,  link Dynamic Pipeline,  link Make sure you understand the meaning of the followings: How to create elements with  gst_element_factory_make() How to create an empty pipeline with  gst_pipeline_new() How to add elements to the pipeline with  gst_bin_add_many() How to link the elements with each other with  gst_element_link() Useful Tips List all installed plugins $ gst-inspect-1.0 You can inspect any pipeline elements with  gst-inspect-1.0  to get more details $ gst-inspect-1.0 v4l2src ...

OpenCV memo

[2019.07.31] Jetson Nano build-in OpenCV is 3.3.1, and it came from ubuntu without CUDA enabling. How to install pre-built OpenCV ? prebuild opencv package will enable CUDA, gstreamer and V4L support. Remove Nano build-in OpenCV 3.3.1 sudo apt-get purge *libopencv* Download the pre-build deb package and install For using git on Nano, you will need to generate SSH key on Nano, and add key to gitLAB git clone git@172.18.18.18:Jetson_Nano/opencv-build.git cd opencv-build sudo apt install ./OpenCV-3.4.0-aarch64-dev.deb sudo apt install ./OpenCV-3.4.0-aarch64-libs.deb sudo apt install ./OpenCV-3.4.0-aarch64-python.deb After deb installation, OpenCV files can be found in the following folders and ready to be used, but if you need to re-build OpenCV by any reason, please refer to the following section. Include files: /usr/include/opencv /usr/include/opencv2 Libraries: /usr/lib TODO make install/strip to get smaller size How to compile/run OpenCV sa...

Use GDB to debug

What is GDB? GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed. https://sourceware.org/gdb/onlinedocs/gdb/index.html Off-line Debug When you got  segmentation fault , you can use  gdb  to load the  core dump  file to debug what happened. But Linux default did not enable core dump file, you will need to enable it by the following command. Beware, ulimit command will set the core dump file size to unlimited, and it will be only enabled in the current shell. ulimit -c unlimited sudo sysctl -w kernel.core_pattern = /tmp/core-%e.%p.%h.%t Compile your program with debug symbols, add "-g" to compile options. g++ -g -std = c++11 -o myprogram myprogram.cpp ` pkg-config opencv --cflags --libs ` Now, run your program again, then you will find the core dump file under /tmp Ex: /tmp/core-myprogram.17521.evan-desktop.1565936379 Use ...

在 VMware 上安裝 JetPack 3.3

圖片
本篇紀錄在 VMware 上安裝 Nvidia JetPack 時,遇到無法取得 TX2 target端的 IP address 的問題。 首先為了可以支援 USB 3.0,記得要 enable USB 3.0。 最主要網路不通的原因是原本是用 NAT,這樣 host 與 target 會不在同一個子網路內,所以要選 "Bridged",而且要把 "Replicate physical network connection state" 勾選起來,然後點選 "Configure Adapters" ,只勾選PC端的網路卡,確保可以對應到同一個子網路。 由於是將 PC (VMware端) 與 TX2 都接在 HUB上,所以安裝 JetPack 的時候選擇如下的 network layout。 接下來執行到 "Determining the IP address of target ..." 這個步驟時,稍等一下就可以看到抓到 target 端 (TX2) 的 IP了 (172.18.2.17) 全部安裝完畢訊息如下。

海思 Hi3521A SDK 的安裝及環境設定

本篇紀錄一下海思 Hi3521A SDK安裝相關問題。 安裝 Linux build server PC 端使用免費的 VMware Workstation Player ,安裝 ubuntu 14.04 64-bit server 版本 。安裝完畢後,enable share folder功能讓 windows 和 Linux 可以分享檔案,或者設定並啟動 samba server,方便 windows 與 Linux 分享檔案。 Q: vmware環境掛載 share folder 發生 mount: unknown filesystem type 'vmhgfs' A: sudo apt-get install git git clone https://github.com/rasa/vmware-tools-patches.git cd vmware-tools-patches sudo ./patched-open-vm-tools.sh 然後打 df,就可以看到 vmhgfs 可以正常使用 vmhgfs-fuse    483399676 97966528 385433148  21% /mnt/hgfs Q: 如何設定 samba server ? A: sudo apt-get install samba sudo vim /etc/samba/smb.conf sudo service smbd restart sudo smbpasswd -a user_name [my_user]  path = /home/my_user/ws  available = yes  valid users = user_name  read only = no  browseable = yes  public = no  writable = yes 安裝 Hi3521A_SDK 解開 tgz 之後, sudo su . sdk.unpack  <=== "." 後面要空格 安裝 cross compiler 进入Hi352...