Tinker Board S : mjpg-streamer (동영상 스트리밍)

OS/Tinker Board S 2018.08.18 22:40 Posted by 파란크리스마스

출처

MJPG streamer 컴파일 관련 라이브러리 설치

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install cmake libjpeg-dev imagemagick libv4l-dev
$ sudo apt-get install subversion libjpeg62-turbo-dev imagemagick

MJPG streamer 소스 다운로드, 컴파일, 설치

$ svn co https://svn.code.sf.net/p/mjpg-streamer/code/
$ cd code/mjpg-streamer
$ make
$ sudo make install
install --mode=755 mjpg_streamer /usr/local/bin
install --mode=644 input_uvc.so output_file.so output_udp.so output_http.so input_testpicture.so input_file.so /usr/local/lib/
install --mode=755 -d /usr/local/www
install --mode=644 -D www/* /usr/local/www

MJPG Streamer 실행

$ cd ~/code/mjpg-streamer
$ ./mjpg_streamer -i "./input_uvc.so -y" -o "./output_http.so -w ./www"
MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 5
 i: Format............: YUV
 i: JPEG Quality......: 80
Adding control for Pan (relative)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Tilt (relative)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Pan Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Tilt Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Pan/tilt Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Focus (absolute)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
mapping control for Pan (relative)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Tilt (relative)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Pan Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Tilt Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Pan/tilt Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Focus (absolute)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for LED1 Mode
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for LED1 Frequency
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Disable video processing
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Raw bits per pixel
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
 o: www-folder-path...: ./www/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled

확인

Tinker Board S : Python + OpenCV

OS/Tinker Board S 2018.08.18 22:23 Posted by 파란크리스마스

출처

기존에 설치된 OpenCV 제거

OpenCV 설치 여부 확인 - 설치가 안 된경우

$ pkg-config --modversion opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found

OpenCV 설치 여부 확인 - 설치 되어 있는 경우

$  pkg-config --modversion opencv
2.4.9.1

설치되어 있는 OpenCV 삭제

$ sudo apt-get purge libopencv* python-opencv
$ sudo apt-get autoremove

OS 업그레이드

$ sudo apt-get update
$ sudo apt-get upgrade

개발 도구와 관련 패키지 설치

$ sudo apt-get install build-essential cmake pkg-config

이미지(JPEG, PNG, TIFF, 기타 등등...) 처리 관련 패키지 설치

$ sudo apt-get install libjpeg-dev libtiff5-dev

비디오 처리 관련 패키지 설치

$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
$ sudo apt-get install libxvidcore-dev libx264-dev

Video4Linux 패키지 설치

$ sudo apt-get install libv4l-dev v4l-utils

GTK 패키지 설치

$ sudo apt-get install libgtk2.0-dev

OpenCV 관련 패키지 설치

$ sudo apt-get install libatlas-base-dev gfortran libeigen3-dev

Python 설치

$ sudo apt-get install python2.7-dev python3-dev

NumPy 설치

출처 : 예제로 배우는 파이썬 프로그래밍 - numpy 사용하기

$ sudo apt-get install python-numpy python3-numpy

OpenCV 소스 다운로드 및 압축해제

$ cd ~
$ wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.2.0.zip
$ unzip opencv.zip

OpenCV Extra Modules 소스 다운로드 및 압축해제

$ wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.2.0.zip
$ unzip opencv_contrib.zip

cmake

$ cd ~/opencv-3.2.0/
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_TBB=OFF \
-D WITH_IPP=OFF \
-D WITH_1394=OFF \
-D BUILD_WITH_DEBUG_INFO=OFF \
-D BUILD_DOCS=OFF \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D ENABLE_NEON=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.2.0/modules \
-D WITH_V4L=ON  \
-D WITH_LIBV4L=ON  \
-D WITH_FFMPEG=ON \
-D WITH_XINE=ON \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
../
 
-- General configuration for OpenCV 3.2.0 =====================================
--   Version control:               unknown
-- 
--   Extra modules:
--     Location (extra):            /home/linaro/opencv_contrib-3.2.0/modules
--     Version control (extra):     unknown
-- 
--   Platform:
--     Timestamp:                   2018-08-17T16:45:11Z
--     Host:                        Linux 4.4.103+ armv7l
--     CMake:                       3.7.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               RELEASE
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                /usr/bin/c++  (ver 6.3.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfp16-format=ieee -mfpu=neon -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfp16-format=ieee -mfpu=neon -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfp16-format=ieee -mfpu=neon -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -mfp16-format=ieee -mfpu=neon -ffunction-sections -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):
--     Linker flags (Debug):
--     ccache:                      NO
--     Precompiled headers:         YES
--     Extra dependencies:          /usr/lib/arm-linux-gnueabihf/libjpeg.so /usr/lib/arm-linux-gnueabihf/libpng.so /usr/lib/arm-linux-gnueabihf/libz.so /usr/lib/arm-linux-gnueabihf/libtiff.so gtk-x11-2.0 gdk-x11-2.0 pangocairo-1.0 atk-1.0 cairo gdk_pixbuf-2.0 gio-2.0 pangoft2-1.0 pango-1.0 gobject-2.0 glib-2.0 fontconfig freetype gthread-2.0 v4l1 v4l2 avcodec avformat avutil swscale dl m pthread rt
--     3rdparty dependencies:       libwebp libjasper IlmImf libprotobuf tegra_hal
-- 
--   OpenCV modules:
--     To be built:                 core flann imgproc ml photo reg surface_matching video dnn freetype fuzzy imgcodecs shape videoio highgui objdetect plot superres xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo tracking videostab xfeatures2d ximgproc aruco optflow phase_unwrapping stitching structured_light python2 python3
--     Disabled:                    world contrib_world
--     Disabled by dependency:      -
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java ts viz cnn_3dobj cvv hdf matlab sfm
-- 
--   GUI: 
--     QT:                          NO
--     GTK+ 2.x:                    YES (ver 2.24.31)
--     GThread :                    YES (ver 2.50.3)
--     GtkGlExt:                    NO
--     OpenGL support:              NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
--     JPEG:                        /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver )
--     WEBP:                        build (ver 0.3.1)
--     PNG:                         /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.6.28)
--     TIFF:                        /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 - 4.0.8)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--     GDAL:                        NO
--     GDCM:                        NO
-- 
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      YES
--       avcodec:                   YES (ver 57.64.101)
--       avformat:                  YES (ver 57.56.101)
--       avutil:                    YES (ver 55.34.101)
--       swscale:                   YES (ver 4.2.100)
--       avresample:                NO
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     OpenNI2:                     NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     Aravis SDK:                  NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    Using libv4l1 (ver 1.12.3) / libv4l2 (ver 1.12.3)
--     XIMEA:                       NO
--     Xine:                        NO
--     gPhoto2:                     NO
-- 
--   Parallel framework:            pthreads
-- 
--   Other third-party libraries:
--     Use IPP:                     NO
--     Use VA:                      NO
--     Use Intel VA-API/OpenCL:     NO
--     Use Lapack:                  NO
--     Use Eigen:                   NO
--     Use Cuda:                    NO
--     Use OpenCL:                  YES
--     Use OpenVX:                  NO
--     Use custom HAL:              YES (carotene (ver 0.0.1))
-- 
--   OpenCL:                        <Dynamic loading of OpenCL library>
--     Include path:                /home/linaro/opencv-3.2.0/3rdparty/include/opencl/1.2
--     Use AMDFFT:                  NO
--     Use AMDBLAS:                 NO
-- 
--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.13)
--     Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython2.7.so (ver 2.7.13)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.12.1)
--     packages path:               lib/python2.7/dist-packages
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.5.3)
--     Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (ver 3.5.3)
--     numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.12.1)
--     packages path:               lib/python3.5/dist-packages
-- 
--   Python (for build):            /usr/bin/python2.7
-- 
--   Java:
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Matlab:                        Matlab not found or implicitly disabled
-- 
--   Tests and samples:
--     Tests:                       NO
--     Performance tests:           NO
--     C/C++ Examples:              NO
-- 
--   Install path:                  /usr/local
-- 
--   cvconfig.h is in:              /home/linaro/opencv-3.2.0/build
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/linaro/opencv-3.2.0/build

빌드 (4 개의 코어가 있으므로 OpenCV를 더 빠르게 컴파일 할 수 있도록 -j4 옵션추가)

$ cat /proc/cpuinfo | grep processor | wc -l
4
$ make -j4

OpenCV 설치

$ sudo make install

/etc/ld.so.conf.d/ 디렉토리에 /usr/local/lib를 포함하는 설정파일이 있는지 확인

$ cat /etc/ld.so.conf.d/*
## Multiarch support
/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf
## libc default configuration
/usr/local/lib

OpenCV 설치

$ sudo ldconfig

OpenCV 설치 확인 - 1

$ pkg-config --modversion opencv
3.2.0

OpenCV 설치 확인 - 2

$ pkg-config --libs --cflags opencv
-I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dpm -lopencv_freetype -lopencv_fuzzy -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_plot -lopencv_dnn -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core

용량 확보를 위해서 다운로드 받은 소스 파일 삭제

$ cd ~
$ rm -rf opencv-3.2.0 opencv_contrib-3.2.0

얼굴인식 예제 컴파일, 실행

$ cp /usr/local/share/OpenCV/samples/cpp/facedetect.cpp ./
$ g++ -o facedetect facedetect.cpp $(pkg-config --libs --cflags opencv) 
$ ./facedetect --cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_eye_tree_eyeglasses.xml " --scale=1.3

얼굴인식 예제 실행 결과

python3에서 OpenCV 버전확인

$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.2.0'

python3에서 얼굴인식 예제 실행

$ python3 /usr/local/share/OpenCV/samples/python/facedetect.py --cascade "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade "/usr/local/share/OpenCV/haarcascades/haarcascade_eye_tree_eyeglasses.xml" /dev/video0

Tinker Board S : MIPI-CSI Camera 문제점 정리

OS/Tinker Board S 2018.08.18 17:35 Posted by 파란크리스마스

출처

MIPI-CSI Camera

Tinker Board에서 카메라를 사용하기 위해서 라즈베리파이에서 사용했던 카메라를 MIPI-CSI 연결해서 테스트 해보았지만, 좋은 결과를 얻지 못했습니다. 제가 가지고 있는 카메라 모듈의 문제가 있을 수 있으니 참고 만 하세요.

Raspberry Pi Camera Module V1.3 - 5 Megapixel

첫 번째 테스트 해본 카메라는 Raspberry Pi Zero - Version 1.3인데, camstill.sh 명령으로 카메라 캡쳐 이미지를 얻을 때 인식률이 제일 떨어 집니다. 1초에 나올 때도 있고, 5초정도 걸릴 때도 있고, 실패할 때도 많이 발생합니다.

OV5647 Sensor Fisheye Wide-angle Camera Module for Raspberry Pi

이 카메라 역쉬 인식률이 많이 떨어 집니다. 이전 Raspberry Pi Zero - Version 1.3보다 인식률은 조금 좋아 졌지만, 렌즈도 광각 렌즈라서 OpenCV에 사용하기 힘들었습니다.

Raspberry Pi Camera Module V2 - 8 Megapixel

카메라의 인식률은 정말 좋습니다. 문제는 캡쳐된 이미지가 너무 어두운게 문제입니다. 관련 내용도 여기에서 확인 해볼 수 있습니다. (Tinker Board Forum - Raspi camera v2 (IMX219) preview is dark green)

카메라 관련 드라이버 메시지 ( dmesg )

$ dmesg | grep cam
[    6.200955] of_get_named_gpiod_flags: parsed 'rockchip,pd-gpio' property of node '/i2c@ff660000/camera-module@36[0]' - status (0)
[    6.200982] of_get_named_gpiod_flags: can't parse 'rockchip,pwr-gpio' property of node '/i2c@ff660000/camera-module@36[0]'
[    6.201003] of_get_named_gpiod_flags: can't parse 'rockchip,flash-gpio' property of node '/i2c@ff660000/camera-module@36[0]'
[    6.201023] of_get_named_gpiod_flags: can't parse 'rockchip,torch-gpio' property of node '/i2c@ff660000/camera-module@36[0]'
[    6.201043] of_get_named_gpiod_flags: can't parse 'rockchip,rst-gpio' property of node '/i2c@ff660000/camera-module@36[0]'
[    6.226655] ov7750.ov_camera_module_write_config(182) ERR: no active sensor configuration
[    6.227024] ov7750.ov_camera_module_write_config(233) ERR: failed with error -14
[    6.227613] ov7750.pltfrm_camera_module_read_reg(996) ERR: i2c read from offset 0x0000300a failed with error -6
[    6.228227] ov7750.pltfrm_camera_module_read_reg(996) ERR: i2c read from offset 0x0000300b failed with error -6
[    6.228662] ov7750.ov7750_check_camera_id(571) ERR: register read failed, camera module powered off?
[    6.229053] ov7750.ov7750_check_camera_id(589) ERR: failed with error (-6)
[    6.229403] ov7750.ov_camera_module_attach(256) ERR: failed with error -6
[    6.231249] of_get_named_gpiod_flags: parsed 'rockchip,pd-gpio' property of node '/i2c@ff660000/camera-module@10[0]' - status (0)
[    6.231276] of_get_named_gpiod_flags: can't parse 'rockchip,pwr-gpio' property of node '/i2c@ff660000/camera-module@10[0]'
[    6.231298] of_get_named_gpiod_flags: can't parse 'rockchip,flash-gpio' property of node '/i2c@ff660000/camera-module@10[0]'
[    6.231318] of_get_named_gpiod_flags: can't parse 'rockchip,torch-gpio' property of node '/i2c@ff660000/camera-module@10[0]'
[    6.231337] of_get_named_gpiod_flags: can't parse 'rockchip,rst-gpio' property of node '/i2c@ff660000/camera-module@10[0]'

video4linux 정보

$ v4l2-ctl -V
Format Video Capture:
        Width/Height      : 1920/1080
        Pixel Format      : 'NV12'
        Field             : Any
        Bytes per Line    : 0
        Size Image        : 0
        Colorspace        : Default
        Transfer Function : Default
        YCbCr/HSV Encoding: Default
        Quantization      : Default
        Flags             : 

Tinker Board S : 기본설정, eMMC에 OS 설치

OS/Tinker Board S 2018.08.18 17:14 Posted by 파란크리스마스

출처

OS 업데이트

$ sudo apt-get update
$ sudo apt-get upgrade

IP 확인

$ ip addr | grep "inet "
    inet 127.0.0.1/8 scope host lo
    inet 192.168.137.223/24 brd 192.168.137.255 scope global dynamic eth0
    inet 192.168.0.115/24 brd 192.168.0.255 scope global wlan0

SD 확장

SD 확장전 용량확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.3G  4.4G  2.5G  64% /
devtmpfs        943M     0  943M   0% /dev
tmpfs          1007M     0 1007M   0% /dev/shm
tmpfs          1007M   17M  990M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs          1007M     0 1007M   0% /sys/fs/cgroup
/dev/mmcblk0p1   63M  7.5M   56M  12% /boot
tmpfs           202M   12K  202M   1% /run/user/1000

SD FDisk

$ sudo fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/mmcblk0: 29.8 GiB, 32010928128 bytes, 62521344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x58bc1052

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        8192   139263   131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      139264 15630335 15491072  7.4G 83 Linux

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-62521343, default 2048): 139264
Last sector, +sectors or +size{K,M,G,T,P} (139264-62521343, default 62521343): 

Created a new partition 2 of type 'Linux' and of size 29.8 GiB.
Partition #2 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: Y 

The signature will be removed by a write command.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

linaro@tinkerboard:~$ sudo shutdown -r now

SD 확장

$ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.43.4 (31-Jan-2017)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/mmcblk0p2 is now 7797760 (4k) blocks long.

SD 확장 확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  4.4G   24G  16% /
devtmpfs        943M     0  943M   0% /dev
tmpfs          1007M     0 1007M   0% /dev/shm
tmpfs          1007M  8.9M  998M   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs          1007M     0 1007M   0% /sys/fs/cgroup
/dev/mmcblk0p1   63M  7.5M   56M  12% /boot
tmpfs           202M  8.0K  202M   1% /run/user/1000

How to burn Linux image to eMMC

출처 : How to burn Linux image to eMMC
bpi-copy command

eMMC 용량 확인

$ sudo fdisk -l

... 생략 ...

Disk /dev/mmcblk1: 14.7 GiB, 15758000128 bytes, 30777344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

... 생략 ...

Disk /dev/mmcblk0: 29.8 GiB, 32010928128 bytes, 62521344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x58bc1052

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        8192   139263   131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      139264 62521343 62382080 29.8G 83 Linux

이미지 복원

이미지 복원이 완료되면 SD 메모리를 제거하고 재부팅, eMMC 용량을 다 사용하지 않는 경우 eMMC 확장 필요

$ sudo dd if=tinkerOSplus207.img of=/dev/mmcblk1 bs=10MB
800+1 records in
800+1 records out
8002732032 bytes (8.0 GB, 7.5 GiB) copied, 241.641 s, 33.1 MB/s

Tinker Board S : 개봉기, OS 설치

OS/Tinker Board S 2018.08.18 17:06 Posted by 파란크리스마스

출처

개봉기

스펙

ModelTinker BoardTinker Board S
Release DateApril 2017January 2018
SoCRockchip RK3288
ArchitectureARMv7-A(32-bit)
CPUQuad core 1.8 GHz ARM Cortex-A17 (up to 2.6GHZ turbo clock speed) (32-bit)
GPU600 MHz Mali-T760 MP4 GPU
RAM2GB dual channel LPDDR3
Storageremovable MicroSD slot ( supporting SD 3.0 )16GB eMMC + removable MicroSD slot ( supporting SD 3.0 )
Video outputfull size HDMI 1.4, MIPI-DSI (compatible with the Raspberry Pi 7" display and others)full size HDMI 1.4 (CEC support added), MIPI-DSI(compatible with the Raspberry Pi 7" display and others)
Video inputMIPI-CSI camera
AudioRTL ALC4040 HD CODEC, Play: 24bit/192kHz, Record: 24bit/96kHz

3.5 mm audio jack ( supporting line out and microphone in )

RTL ALC4040 HD CODEC, Play: 24bit/192kHz, Record: 24bit/96kHz

3.5 mm audio jack ( supporting line out and microphone in, Plug-in Detection and Auto-Switch )

Other IO40-pin header with:
  • up to 28 x GPIO pins
  • up to 2 x SPI bus
  • up to 2 x I2C bus
  • up to 4 x UART
  • up to 2 x PWM
  • up to 1 x PCM/I2S
  • 2 x 5V power pins
  • 2 x 3.3V power pins
  • 8 x ground pins

1 x 2-pin contact pin :

  • 1 x PWM
  • 1 x S/PDIF
40-pin header with:
  • up to 28 x GPIO pins
  • up to 2 x SPI bus
  • up to 2 x I2C bus
  • up to 4 x UART
  • up to 2 x PWM
  • up to 1 x PCM/I2S (Enhanced I2S pin with Slave mode)
  • 2 x 5V power pins
  • 2 x 3.3V power pins
  • 8 x ground pins

1 x 2-pin contact pin :

  • 1 x PWM
  • 1 x S/PDIF

1 x 2-pin Power-on Header

USB4 x USB 2.0 ports
NetworkingGigabit LAN ( not shared with USB bus )
WirelessBluetooth V4.0 + EDR, 802.11 b/g/n Wi-Fi, with IPEX antenna header
PowerMicro-USB; due to Micro-USB power delivery limitations, powering over GPIO is suggested [2][3]
Form Factor3.37 inch x 2.125 inch ( 8.55 cm x 5.4 cm )
Weight55g
Operating SystemsTinkerOS is a Debian Linux derivative & Android 6

OS 이미지 SD메모리에 복사

SD 메모리로 부팅

제가 구입한 Tinker Board S의 경우 eMMC에 안드로이드 OS가 설치되어 있어 리눅스 OS 이미지가 복사된 SD 메모리를 삽입하고, 부팅해도 안드로이드로 부팅이 되는데, 아래 이미지 처럼 Maskrom mode로 설정후 부팅하면 SD메모리에 설치된 OS로 부팅이 됩니다.

라즈베리파이 7인치 모니터 적용 (MIPI-DSI)

Font awesome 가운데 정렬

Programming/JavaScript, Sencha 2018.08.13 23:46 Posted by 파란크리스마스

출처

css 파일 참조

<link rel="stylesheet" href="<c:url value="/commons/fontawesome/css/all.css"/>">

css

.fa {
	vertical-align: middle;
}

html

<i class="fa fa-plus-circle fa-2x" aria-hidden="true" style="margin-left: 5px;"></i>
<i class="fa fa-minus-circle fa-2x" aria-hidden="true"></i>

ROC-RK3328-CC : GApps 설치 (실패이력)

OS/ROC-RK3328-CC 2018.08.08 00:44 Posted by 파란크리스마스

출처

개발자 모드 설정

GApps 설치 (용량부족으로 설치 실패)

GApps 압축해제

C:\gapps\pkg>7z x open_gapps-arm64-7.1-stock-20180810.zip
C:\gapps\pkg>forfiles /s /m *.tar.lz /c "cmd /c lzip -d @path"
C:\gapps\pkg>cd ..
C:\gapps>forfiles /s /m *.tar /c "cmd /c 7z x @path -oc:\gapps\tmp"
C:\gapps>for /D %i in (tmp/*) do for /D %j in (tmp/%i/*) do xcopy /S /I /Y tmp\%i\%j sys

GApps 설치

C:\gapps>adb push sys/. /system/.
adb: error: failed to copy 'sys/.\app\EditorsSheets\EditorsSheets.apk' to '/system/././app/EditorsSheets/EditorsSheets.apk': remote write failed: No space left on device

C:\gapps>adb shell
roc_rk3328_cc_box:/ # df -h
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                 1.9G  456K  1.9G   1% /dev
tmpfs                 1.9G     0  1.9G   0% /mnt
/dev/block/mmcblk0p13 1.0G  1.0G   23M  98% /system
/dev/block/mmcblk0p10 122M  136K  122M   1% /cache
/dev/block/mmcblk0p11  12M   40K   12M   1% /metadata
/dev/block/mmcblk0p14  12G  287M   12G   3% /data
tmpfs                 1.9G     0  1.9G   0% /storage
/dev/fuse              12G  287M   12G   3% /mnt/runtime/default/emulated
/dev/fuse              12G  287M   12G   3% /storage/emulated
/dev/fuse              12G  287M   12G   3% /mnt/runtime/read/emulated
/dev/fuse              12G  287M   12G   3% /mnt/runtime/write/emulated

play store 설치 (설치 실패 - logcat 오류 로그)

D:\Data.ROC-RK3328-CC>adb connect 192.168.137.54
connected to 192.168.137.54:5555

D:\Data.ROC-RK3328-CC>adb root

D:\Data.ROC-RK3328-CC>adb connect 192.168.137.54
connected to 192.168.137.54:5555

D:\Data.ROC-RK3328-CC>adb remount
remount succeeded

D:\Data.ROC-RK3328-CC>adb push com.android.vending_11.2.14-all_0_PR_207207134-81121400_minAPI16(armeabi,armeabi-v7a,mips,mips64,x86,x86_64)(240,320,480dpi)_apkmirror.com.apk /system/priv-app/
com.android.vending_11.2.14-all_0_PR_207207134-81121400_mi...om.apk: 1 file pushed. 8.5 MB/s (17011959 bytes in 1.898s)

D:\Data.ROC-RK3328-CC>adb push com.google.android.gms_12.8.74_(040408-204998136)-12874025_minAPI23(arm64-v8a,armeabi-v7a)(480dpi)_apkmirror.com.apk /system/priv-app/
com.google.android.gms_12.8.74_(040408-204998136)-12874025...om.apk: 1 file pushed. 8.6 MB/s (63703526 bytes in 7.066s)

D:\Data.ROC-RK3328-CC>adb push com.google.android.gsf_7.1.2-25_minAPI25(nodpi)_apkmirror.com.apk /system/priv-app/
com.google.android.gsf_7.1.2-25_minAPI25(nodpi)_apkmirror.com.apk: 1 file pushed. 9.4 MB/s (3787707 bytes in 0.385s)

D:\Data.ROC-RK3328-CC>adb reboot

play store 다시 설치하기

D:\Data.ROC-RK3328-CC>adb connect 192.168.137.179
connected to 192.168.137.179:5555

D:\Data.ROC-RK3328-CC>adb root

D:\Data.ROC-RK3328-CC>adb connect 192.168.137.179
connected to 192.168.137.179:5555

D:\Data.ROC-RK3328-CC>adb install -r com.android.vending_11.2.14-all_0_PR_207207134-81121400_minAPI16(armeabi,armeabi-v7a,mips,mips64,x86,x86_64)(240,320,480dpi)_apkmirror.com.apk
Success

권한 설정

D:\Data.ROC-RK3328-CC>adb shell
roc_rk3328_cc_box:/ # pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION
roc_rk3328_cc_box:/ # pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION
roc_rk3328_cc_box:/ # exit

오류 로그

D:\Data.ROC-RK3328-CC>>adb logcat
08-11 02:53:19.833   191   238 D AudioHardwareTiny: out_set_parameters: kvpairs = routing=1034
08-11 02:53:19.834   191   238 D AudioHardwareTiny: start_output_stream
08-11 02:53:19.833   191   191 I AudioOut_D: type=1400 audit(0.0:73): avc: denied { read } for name="audioinfo" dev="sysfs" ino=10440 scontext=u:r:audioserver:s0 tcontext=u:object_r:sysfs_hdmi:s0 tclass=file permissive=1
08-11 02:53:19.833   191   191 I AudioOut_D: type=1400 audit(0.0:74): avc: denied { open } for path="/sys/devices/virtual/display/HDMI/audioinfo" dev="sysfs" ino=10440 scontext=u:r:audioserver:s0 tcontext=u:object_r:sysfs_hdmi:s0 tclass=file permissive=1
08-11 02:53:19.837   191   238 D AudioHardwareTiny: Device     : 0x40a
08-11 02:53:19.837   191   238 D AudioHardwareTiny: SampleRate : 44100
08-11 02:53:19.837   191   238 D AudioHardwareTiny: Channels   : 2
08-11 02:53:19.837   191   238 D AudioHardwareTiny: Formate    : 0
08-11 02:53:19.837   191   238 D AudioHardwareTiny: PreiodSize : 512
08-11 02:53:19.837   191   238 D alsa_route: route_info->sound_card 0, route_info->devices 0
08-11 02:53:19.837   191   238 D alsa_route: route_set_controls() set route 24
08-11 02:53:19.833   191   191 I AudioOut_D: type=1400 audit(0.0:75): avc: denied { getattr } for path="/sys/devices/virtual/display/HDMI/audioinfo" dev="sysfs" ino=10440 scontext=u:r:audioserver:s0 tcontext=u:object_r:sysfs_hdmi:s0 tclass=file permissive=1
08-11 02:53:19.857  2657  2657 W ChimeraUtils: Non Chimera context
08-11 02:53:19.875   405  1587 W ActivityManager: Unable to start service Intent { act=com.google.android.gsf.notouch.LAUNCH_AUTH_UI pkg=com.google.android.gsf.notouch } U=0: not found
08-11 02:53:19.876  2657  2669 W AccountAuthenticator: addAccount(com.google)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator: java.lang.RuntimeException: Unable to bind to auth delegate service.
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at gbe.a(:com.google.android.gms@12874025@12.8.74 (040408-204998136):25)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at gbe.a(:com.google.android.gms@12874025@12.8.74 (040408-204998136):1)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at gbe.a(:com.google.android.gms@12874025@12.8.74 (040408-204998136):36)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at gbr.addAccount(:com.google.android.gms@12874025@12.8.74 (040408-204998136):92)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at android.accounts.AbstractAccountAuthenticator$Transport.addAccount(AbstractAccountAuthenticator.java:167)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at android.accounts.IAccountAuthenticator$Stub.onTransact(IAccountAuthenticator.java:67)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at android.os.Binder.transact(Binder.java:499)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at deg.onTransact(:com.google.android.gms@12874025@12.8.74 (040408-204998136):3)
08-11 02:53:19.876  2657  2669 W AccountAuthenticator:  at android.os.Binder.execTransact(Binder.java:565)
08-11 02:53:19.885  2506  2506 W Finsky  : [1] com.google.android.finsky.unauthenticated.b.run(9): AuthenticatorException while adding account: android.accounts.AuthenticatorException: addAccount failed.
08-11 02:53:23.081   191   238 D alsa_route: route_set_controls() set route 24
08-11 02:53:23.081   191   238 D AudioHardwareTiny: close device

ROC-RK3328-CC : eMMC에 Android 설치

OS/ROC-RK3328-CC 2018.08.03 23:09 Posted by 파란크리스마스

출처

Rockusb Mode - PC에서 드라이버로 인식 시키기

1. 보드의 전원을 끄기 위해 모든 USB 케이블 (마이크로 USB 케이블 및 M/M USB 케이블 포함)을 보드에서 빼냅니다.

2. eMMC를 장착하고 SD 카드를 꺼냅니다.

3. M/M USB 케이블을 사용하여 호스트 PC를 보드의 USB 2.0 OTG 포트 (이층 포트의 아래쪽 포트)에 연결합니다.

4. 보드의 RECOVERY 버튼을 계속 누른 상태에서 마이크로 USB 케이블을 보드에 연결하여 전원을 켭니다.

5. 전원을 켜고, PC에서 드라이버로 인식 할때까지 3초간 RECOVERY 버튼 누르고 있습니다.

PC 드라이버 설치

DriverAssistant를 다운로드하고 압축을 풀고 DriverInstall.exe를 실행하십시오.

AndroidTool 실행

[Run] 버튼 선택

와이파이 설치

ROC-RK3328-CC

OS/ROC-RK3328-CC 2018.08.01 02:06 Posted by 파란크리스마스

출처

ROC-RK3328-CC

ASUS Tinker Board에 사용된 CPU는 RK3288로 ARMv7 SoC에서 하이엔드급이고, ROC-RK3328-CC의 CPU는 RK3328로 ARMv8 SoC에서 로우엔드급을 사용하고 있습니다. 

두개의 스펙을 보면 Tinker Board의 경우 ARMv7-A(32-bit) CPU에 메모리는 DDR3를 사용하고 있고, ROC-RK3328-CC는 ARMv8(64-bit) CPU에 메모리는 DDR4를 사용하고 있는데, CPU의 벤치마킹 점수만 보면 ASUS Tinker Board의 RK3288가 조금 더 높게 나옵니다.

USB의 경우 Tinker Board는 4개의 USB2가 있고, ROC-RK3328-CC는 2개의 USB2와 1개의 USB3가 있고, ROC-RK3328-CC는 Wifi와 블루투스가 기본 내장되어 있지 않습니다.

현재 설치 가능한 안드로이드 OS의 경우 Tinker Board는 안드로이드6버전이 ROC-RK3328-CC는 안드로이드7버전이 설치됩니다.

전용 방열판 장착전후

전용 방열판용 마운팅 홀있어 간단하게 장착이 가능한데, 전용 방열판을 사용했더니, 마운팅 홀에 나온 연결부분이 높아져서 라즈베리파이 전용 케이스 장착에 문제가 있습니다.

뒤판에 eMMC 장착

라즈베리파이용 케이스 사용

  

스펙

출처 : ROC-RK3328-CC (Renegade) – Libre Computer

  • Rockchip RK3328 SoC
    • 4 ARM Cortex-A53 @ 1.4GHz
      • Cryptography Extensions
    • 2G + 2P ARM Mali-450 @ 500MHz
      • OpenGL ES 1.1 / 2.0
      • OpenVG 1.1
    • Multi-Media Processor
      • Decoders
        • VP9 P2 4K60
        • H.265 M10P@L5.1 4K60
        • H.264 H10P@L5.1 4K60
        • JPEG
      • Encoders
        • H.265 1080P30 or 2x H.265 720P30
        • H.264 1080P30 or 2x H.264 720P30
  • Up to 4GB DDR4-2133 SDRAM
  • 2 USB 2.0 Type A
  • 1 USB 3.0 Type A
  • Gigabit Ethernet
  • 3.5mm TRRS AV Jack
  • HDMI 2.0
  • MicroUSB Power In
  • MicroSD Card Slot with UHS support
  • eMMC Interface with 5.x support
  • IR Receiver
  • U-Boot Button
  • 40 Pin Low Speed Header (PWM, I2C, SPI, GPIO)
  • ADC Header
  • Power Enable/On Header

Raspberry Pi 3 KeDei 3.5" TFT LCD

OS/Raspberry Pi 2018.08.01 02:05 Posted by 파란크리스마스

출처

Driver 다운로드

$ wget http://kedei.net/raspberry/v6_1/LCD_show_v6_1_3.tar.gz

압축해제 후 설치(LCD에 화면 출력)

$ tar xvf LCD_show_v6_1_3.tar.gz
$ cd LCD_show_v6_1_3
$ sudo ./LCD35_v

다시 HDMI로 화면 출력

$ sudo ./LCD_hdmi


 

티스토리 툴바