發表文章

Linux UVC 兩個 video node, 哪一個可使用 ?

圖片
 UVC 裝置會有個video node, 哪一個可用? 用 v4l2-ctl 可以看出 device caps 不同 struct v4l2_capability cam_cap; ioctl(fd, VIDIOC_QUERYCAP, &cam_cap); videodev2.h /* Values for 'capabilities' field */ #define V4L2_CAP_VIDEO_CAPTURE 0x00000001  /* Is a video capture device */ #define V4L2_CAP_META_CAPTURE 0x00800000  /* Is a metadata capture device */ PS:  VIDIOC_QUERYCAP 要確認的是 device_caps 而不是 capabilities   reference:  https://askubuntu.com/questions/1294041/why-only-one-usb-camera-shows-two-video4linux-devices https://bugzilla.kernel.org/show_bug.cgi?id=199575

如何 reset USB host ??

echo 0 > /sys/bus/usb/devices/usb1/authorized echo 1 > /sys/bus/usb/devices/usb1/authorized

同步 github/gitlab fork 出來的 repository

圖片
1.   沒有現成的可以一鍵同步的方法。 2.   最方便的是用 GitHub Desktop ,請看下面圖示 點選 merge 在 fetch 3.   另一種就是用 command line. # git remote -v # git remote add upstream git@GIT.AVER.COM:EDU/FW/m10v/linux.git # git fetch upstream # git checkout S510-2 # git merge upstream/S510-2 # git push origin S510-2 --tags   若 upstream 上有新的 branch # git checkout upstream/S510-3 # git checkout -b  S510-3 # git push origin S510-3 --tags PS: 加上 --tags 才會將 tag 也一併同步   Reference: https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/syncing-a-fork https://www.peterdavehello.org/2014/02/update_forked_repository/ https://gitbook.tw/chapters/github/syncing-a-fork.html  

How to Install Xrdp Server (Remote Desktop) on Ubuntu 20.04

reference: https://linuxize.com/post/how-to-install-xrdp-on-ubuntu-20-04/ 我的 ubuntu 是 desktop 版本,所以不用安裝桌面套件 sudo apt install xrdp sudo adduser xrdp ssl-cert sudo systemctl restart xrdp sudo systemctl status xrdp 這樣就可以用 windows 遠端桌面開啟

configure Root Filesystem over NFS on Menuconfig

圖片
The CONFIG_ROOT_NFS configuration option, which depends on CONFIG_IP_PNP. To enable root filesystem over NFS you must enable the "IP: kernel level autoconfiguration" option in the "Networking options" menu first.

利用 NFS 當 rootfile system

將uboot bootargs 設成下面組合就可以 bootargs rootdelay=5 root=/dev/nfs rw nfsroot=$(serverip):$(rootpath),nolock,vers=4,tcp ip=dhcp nfsrootdebug bootargs rootdelay=5 root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) ip=dhcp nfsrootdebug bootargs rootdelay=5 root=/dev/nfs nfsroot=$(serverip):$(rootpath),nolock,vers=4,tcp rw ip=$(ipaddr):$(serverip):0.0.0.0:255.255.255.0::eth0:off nfsrootdebug # nfsrootdebug --> 連線不成功, 可以debug # vers=4,tcp --> 連線不成功, 確認一下 server 的版本。nfsstat –s <<- Print server-side statistics                             新版 ubuntu 應該都是 v3/v4 了.

BusyBox set uart

stty -F /dev/ttyS1 stty -F /dev/ttyS1 raw -echo -echoe -echok stty -F /dev/ttyS1 115200 stty -F /dev/ttyS1 speed stty -F /dev/ttyS2 stty -F /dev/ttyS2 raw -echo -echoe -echok stty -F /dev/ttyS2 115200 stty -F /dev/ttyS2 speed Statistics # cat /proc/tty/driver/<driver_name> reference: http://www.armadeus.org/wiki/index.php?title=Serial_ports_usage_on_Linux