Tinker Board 2

OS/Tinker Board 2021. 3. 4. 00:35 Posted by 파란크리스마스

출처

ASUS Tinker Board 2

ASUS Tinker Board 2 스펙 ( 출처 : ASUS Tinker Board 2 : VIP@youyeetoo.com)

기본 사용자, 암호

linaro / linaro

리눅스 정보 확인

CPU 정보 확인

linaro@linaro-alip:~$ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
... 생략 ...
 
processor       : 5
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 2
 
Serial          : 1adae4c508fdff72

instruction set architecture (ISA)

linaro@linaro-alip:~$ uname -m
aarch64

커널에 대한 정보

linaro@linaro-alip:~$ uname -a
Linux linaro-alip 4.4.194 #25 SMP Wed Jan 13 07:02:28 UTC 2021 aarch64 GNU/Linux

OS버전에 대한 정보

linaro@linaro-alip:~$ cat /etc/issue
Debian GNU/Linux 9 \n \l

논리 코어 수 확인

linaro@linaro-alip:~$ grep -c processor /proc/cpuinfo
6

IP 확인

linaro@linaro-alip:~$ ip addr

Pythone 버전 확인

linaro@linaro-alip:~$ python --version
Python 2.7.13
linaro@linaro-alip:~$ python3 --version
Python 3.5.3

GPIO 확인

linaro@linaro-alip:~$ gpio readall
 +-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
 | CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |  73 |   8 | GPIO2B1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |
 |  74 |   9 | GPIO2B2 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   8 |   7 | CLKOUT2 |  CLK | 0 |  7 || 8  | 1 | IN   | GPIO2C1 | 15  | 81  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | GPIO2C0 | 16  | 80  |
 |  83 |   0 | GPIO2C3 |   IN | 1 | 11 || 12 | 0 | IN   | GPIO3D0 | 1   | 120 |
 |  85 |   2 | GPIO2C5 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  84 |   3 | GPIO2C4 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO2C6 | 4   | 86  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO2C7 | 5   | 87  |
 |  40 |  12 | GPIO1B0 |   IN | 1 | 19 || 20 |   |      | 0v      |     |     |
 |  39 |  13 | GPIO1A7 |   IN | 1 | 21 || 22 | 0 | IN   | GPIO3D4 | 6   | 124 |
 |  41 |  14 | GPIO1B1 |   IN | 1 | 23 || 24 | 1 | IN   | GPIO1B2 | 10  | 42  |
 |     |     |      0v |      |   | 25 || 26 | 0 | IN   | GPIO0A6 | 11  | 6   |
 |  71 |  30 | GPIO2A7 |   IN | 1 | 27 || 28 | 1 | IN   | GPIO2B0 | 31  | 72  |
 | 126 |  21 | GPIO3D6 |   IN | 0 | 29 || 30 |   |      | 0v      |     |     |
 | 125 |  22 | GPIO3D5 |   IN | 0 | 31 || 32 | 0 | IN   | GPIO4C2 | 26  | 146 |
 | 150 |  23 | GPIO4C6 |  OUT | 1 | 33 || 34 |   |      | 0v      |     |     |
 | 121 |  24 | GPIO3D1 |   IN | 0 | 35 || 36 | 1 | IN   | GPIO2C2 | 27  | 82  |
 | 149 |  25 | GPIO4C5 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO3D3 | 28  | 123 |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO3D7 | 29  | 127 |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
 +-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+

댓글을 달아 주세요

NanoPi M4V2 : GStreamer HLS 스트리밍 서버 구축

OS/NanoPi 2021. 3. 1. 15:32 Posted by 파란크리스마스

출처

임시 디렉토리 생성

GStreamer HLS 관련 임시 파일 생성을 위한 디렉토리 생성합니다.

pi@NanoPi-M4v2:~$ mkdir hlstest

GStreamer 실행

playlist-root 옵션은 playlist.m3u8 파일 내 호출 주소를 전달 하기 위해서 외부 플레이어에서 접근 가능한 주소를 설정하고, location 옵션은 hls 관련 파일이 생성될 임시 작업 폴더를 지정합니다.

pi@NanoPi-M4v2:~$ gst-launch-1.0 rkisp device=/dev/video1 io-mode=4 ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 \
  ! videoconvert ! clockoverlay ! x264enc tune=zerolatency ! mpegtsmux \
  ! hlssink playlist-root=http://192.168.0.5:8080 location=/home/pi/hlstest/segment_%05d.ts target-duration=5 max-files=5
Setting pipeline to PAUSED ...
media get entity by name: lens is null
XCAM ERROR v4l2_device.cpp:254: VIDIOC_QUERYCAP returned: -1 (Inappropriate ioctl for device)
XCAM ERROR v4l2_device.cpp:254: VIDIOC_QUERYCAP returned: -1 (Inappropriate ioctl for device)
XCAM ERROR rkisp_control_loop_impl.cpp:99: failed to get camera module info
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
XCAM ERROR rkisp_device.cpp:72: atomisp device(/dev/video1) try subdev format failed
Redistribute latency...
 
(gst-launch-1.0:2254): GStreamer-CRITICAL **: 09:06:59.673: gst_object_unref: assertion 'object != NULL' failed

윕서버 실행

HLS는 웹 스트리밍 프로토콜로 웹서버를 통해서 스트리밍 관련 파일을 전달하는데 GStreamer는 웹서버 기능이 없어서 python으로 웹서버를 이용하게 됩니다. 웹서비스 root 디렉토리로 이동하고 간이 웹서버를 실행합니다.

pi@NanoPi-M4v2:~$ cd hlstest/
pi@NanoPi-M4v2:~/hlstest$ python --version
Python 2.7.17
pi@NanoPi-M4v2:~/hlstest$ python -m SimpleHTTPServer 8080
Serving HTTP on 0.0.0.0 port 8080 ...

hls 주소

http://192.168.0.5:8080/playlist.m3u8

hls 재생

임시 디렉토리 목록 조회

pi@NanoPi-M4v2:~/hlstest$ ls 
playlist.m3u8 segment_00180.ts segment_00181.ts segment_00182.ts segment_00183.ts segment_00184.ts

댓글을 달아 주세요

Raspberry Pi : GStreamer RTSP Server 설치

OS/Raspberry Pi 2021. 2. 27. 22:07 Posted by 파란크리스마스

출처

GStreamer 기본 패키지 설치

pi@raspberrypi:~$ sudo apt-get install gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools libgstreamer1.0-dev libgstreamer1.0-0-dbg libgstreamer1.0-0 libgstreamer-plugins-base1.0-dev gtk-doc-tools

GStreamer Camera Source 설치

소스 다운로드

pi@raspberrypi:~$ git clone https://github.com/thaytan/gst-rpicamsrc.git
pi@raspberrypi:~$ cd gst-rpicamsrc

빌드

pi@raspberrypi:~/gst-rpicamsrc$ ./autogen.sh
pi@raspberrypi:~/gst-rpicamsrc$ make

설치

pi@raspberrypi:~/gst-rpicamsrc$ sudo make install
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/arm-linux-gnueabihf/gstreamer-1.0
 
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

테스트

pi@raspberrypi:~$ gst-inspect-1.0 | grep rpicamsrc
rpicamsrc:  rpicamsrcdeviceprovider (GstDeviceProviderFactory)
rpicamsrc:  rpicamsrc: Raspberry Pi Camera Source

GStreamer RTSP Server 설치

소스 다운로드

pi@raspberrypi:~$ git clone git://anongit.freedesktop.org/gstreamer/gst-rtsp-server
pi@raspberrypi:~$ cd gst-rtsp-server
pi@raspberrypi:~/gst-rtsp-server$ git checkout 1.12.5

빌드

pi@raspberrypi:~/gst-rtsp-server$ sudo apt install meson
pi@raspberrypi:~/gst-rtsp-server$ meson buil
The Meson build system
Version: 0.52.1
Source dir: /home/pi/gst-rtsp-server
Build dir: /home/pi/gst-rtsp-server/buil
Build type: native build
Project name: gst-rtsp-server
Project version: 1.12.5
C compiler for the host machine: cc (gcc 8.3.0 "cc (Raspbian 8.3.0-6+rpi1) 8.3.0")
C linker for the host machine: GNU ld.bfd 2.31.1
Host machine cpu family: arm
Host machine cpu: armv7l
Configuring config.h using configuration
Found pkg-config: /usr/bin/pkg-config (0.29)
Run-time dependency glib-2.0 found: YES 2.58.3
Run-time dependency gstreamer-1.0 found: YES 1.14.4
Run-time dependency gstreamer-rtsp-1.0 found: YES 1.14.4
Run-time dependency gstreamer-rtp-1.0 found: YES 1.14.4
Run-time dependency gstreamer-sdp-1.0 found: YES 1.14.4
Run-time dependency gstreamer-app-1.0 found: YES 1.14.4
Run-time dependency gstreamer-net-1.0 found: YES 1.14.4
Program g-ir-scanner found: NO
Found CMake: /usr/bin/cmake (3.13.4)
Run-time dependency libcgroup found: NO (tried pkgconfig and cmake)
Configuring gstreamer-rtsp-server-1.0.pc using configuration
Configuring gstreamer-rtsp-server-1.0-uninstalled.pc using configuration
pkgconfig/meson.build:22: WARNING: The variable(s) 'srcdir' in the input file 'pkgconfig/gstreamer-rtsp-server-uninstalled.pc.in' are not present in the given configuration data.
Build targets in project: 18
Found ninja-1.8.2 at /usr/bin/ninja

설치

pi@raspberrypi:~/gst-rpicamsrc$ sudo make install
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/arm-linux-gnueabihf/gstreamer-1.0
 
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'
pi@raspberrypi:~/gst-rtsp-server$ ./autogen.sh
 
Configuration
        Version                    : 1.12.5
        Source code location       : .
        Prefix                     : /usr/local
        Compiler                   : gcc
        CGroups example            : no

gst-rtsp-server configured. Type 'make' to build.

Now type 'make' to compile gst-rtsp-server.
pi@raspberrypi:~/gst-rtsp-server$ make

GStreamer RTSP Server 설치

pi@raspberrypi:~/gst-rtsp-server$ sudo make install
 
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib/gstreamer-1.0
 
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'
  
-- Installing ./html/GstRTSPAddressPool.html
-- Installing ./html/GstRTSPAuth.html
-- Installing ./html/GstRTSPClient.html
-- Installing ./html/GstRTSPContext.html
-- Installing ./html/GstRTSPMedia.html
-- Installing ./html/GstRTSPMediaFactory.html
-- Installing ./html/GstRTSPMediaFactoryURI.html
-- Installing ./html/GstRTSPMountPoints.html
-- Installing ./html/GstRTSPPermissions.html
-- Installing ./html/GstRTSPServer.html
-- Installing ./html/GstRTSPSession.html
-- Installing ./html/GstRTSPSessionMedia.html
-- Installing ./html/GstRTSPSessionPool.html
-- Installing ./html/GstRTSPStream.html
-- Installing ./html/GstRTSPStreamTransport.html
-- Installing ./html/GstRTSPThreadPool.html
-- Installing ./html/GstRTSPToken.html
-- Installing ./html/annotation-glossary.html
-- Installing ./html/api-index-full.html
-- Installing ./html/ch01.html
-- Installing ./html/gst-rtsp-server-GstRTSPParams.html
-- Installing ./html/gst-rtsp-server-GstRTSPSdp.html
-- Installing ./html/index.html
-- Installing ./html/rtsp-server-hierarchy.html
-- Installing ./html/home.png
-- Installing ./html/left-insensitive.png
-- Installing ./html/left.png
-- Installing ./html/right-insensitive.png
-- Installing ./html/right.png
-- Installing ./html/up-insensitive.png
-- Installing ./html/up.png
-- Installing ./html/style.css
-- Installing ./html/gst-rtsp-server-1.0.devhelp2

RTSP Server 실행

pi@raspberrypi:~/gst-rtsp-server$ cd examples/
pi@raspberrypi:~/gst-rtsp-server/examples$ ./test-launch "( rpicamsrc preview=false bitrate=2000000 keyframe-interval=15 ! video/x-h264, framerate=15/1 ! h264parse ! rtph264pay name=pay0 pt=96 )"
stream ready at rtsp://127.0.0.1:8554/test

재생

Raspberry Pi Camera 정보 조희

pi@raspberrypi:~/gst-rtsp-server$ gst-inspect-1.0 rpicamsrc
Factory Details:
  Rank                     none (0)
  Long-name                Raspberry Pi Camera Source
  Klass                    Source/Video
  Description              Raspberry Pi camera module source
  Author                   Jan Schmidt <jan@centricular.com>
 
Plugin Details:
  Name                     rpicamsrc
  Description              Raspberry Pi Camera Source
  Filename                 /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstrpicamsrc.so
  Version                  1.0.0
  License                  LGPL
  Source module            gstrpicamsrc
  Binary package           GStreamer
  Origin URL               http://gstreamer.net/
 
GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSrc
                         +----GstPushSrc
                               +----GstRpiCamSrc
 
Implemented Interfaces:
  GstColorBalance
  GstVideoDirection
  GstVideoOrientation
 
Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
          stream-format: byte-stream
              alignment: nal
                profile: { (string)constrained-baseline, (string)baseline, (string)main, (string)high }
      image/jpeg
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw
                 format: { (string)I420, (string)RGB, (string)BGR, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
 
Element has no clocking capabilities.
Element has no URI handling capabilities.
 
Pads:
  SRC: 'src'
    Pad Template: 'src'
 
Element Properties:
  video-direction     : Video direction: rotation and flipping
                        flags: readable, writable, controllable
                        Enum "GstVideoOrientationMethod" Default: 0, "identity"
                           (0): identity         - GST_VIDEO_ORIENTATION_IDENTITY
                           (1): 90r              - GST_VIDEO_ORIENTATION_90R
                           (2): 180              - GST_VIDEO_ORIENTATION_180
                           (3): 90l              - GST_VIDEO_ORIENTATION_90L
                           (4): horiz            - GST_VIDEO_ORIENTATION_HORIZ
                           (5): vert             - GST_VIDEO_ORIENTATION_VERT
                           (6): ul-lr            - GST_VIDEO_ORIENTATION_UL_LR
                           (7): ur-ll            - GST_VIDEO_ORIENTATION_UR_LL
                           (8): auto             - GST_VIDEO_ORIENTATION_AUTO
                           (9): custom           - GST_VIDEO_ORIENTATION_CUSTOM
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "rpicamsrc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  blocksize           : Size in bytes to read per buffer (-1 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  num-buffers         : Number of buffers to output before sending EOS (-1 = unlimited)
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  typefind            : Run typefind before negotiating (deprecated, non-functional)
                        flags: readable, writable, deprecated
                        Boolean. Default: false
  do-timestamp        : Apply current stream time to buffers
                        flags: readable, writable
                        Boolean. Default: true
  camera-number       : Which camera to use on a multi-camera system - 0 or 1
                        flags: readable, writable
                        Integer. Range: 0 - 1 Default: 0 
  bitrate             : Bitrate for encoding. 0 for VBR using quantisation-parameter
                        flags: readable, writable
                        Integer. Range: 0 - 25000000 Default: 17000000 
  keyframe-interval   : Interval (in frames) between I frames. -1 = automatic, 0 = single-keyframe
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  preview             : Display preview window overlay
                        flags: readable, writable
                        Boolean. Default: true
  preview-encoded     : Display encoder output in the preview
                        flags: readable, writable
                        Boolean. Default: true
  preview-opacity     : Opacity to use for the preview window
                        flags: readable, writable
                        Integer. Range: 0 - 255 Default: 255 
  preview-x           : Start X coordinate of the preview window (in pixels)
                        flags: readable, writable
                        Integer. Range: 0 - 2048 Default: 0 
  preview-y           : Start Y coordinate of the preview window (in pixels)
                        flags: readable, writable
                        Integer. Range: 0 - 2048 Default: 0 
  preview-w           : Width of the preview window (in pixels)
                        flags: readable, writable
                        Integer. Range: 0 - 2048 Default: 1024 
  preview-h           : Height of the preview window (in pixels)
                        flags: readable, writable
                        Integer. Range: 0 - 2048 Default: 768 
  fullscreen          : Display preview window full screen
                        flags: readable, writable
                        Boolean. Default: true
  sharpness           : Image capture sharpness
                        flags: readable, writable
                        Integer. Range: -100 - 100 Default: 0 
  contrast            : Image capture contrast
                        flags: readable, writable
                        Integer. Range: -100 - 100 Default: 0 
  brightness          : Image capture brightness
                        flags: readable, writable
                        Integer. Range: 0 - 100 Default: 50 
  saturation          : Image capture saturation
                        flags: readable, writable
                        Integer. Range: -100 - 100 Default: 0 
  iso                 : ISO value to use (0 = Auto)
                        flags: readable, writable
                        Integer. Range: 0 - 3200 Default: 0 
  video-stabilisation : Enable or disable video stabilisation
                        flags: readable, writable
                        Boolean. Default: false
  exposure-compensation: Exposure Value compensation
                        flags: readable, writable
                        Integer. Range: -10 - 10 Default: 0 
  exposure-mode       : Camera exposure mode to use
                        flags: readable, writable
                        Enum "GstRpiCamSrcExposureMode" Default: 1, "auto"
                           (0): off              - GST_RPI_CAM_SRC_EXPOSURE_MODE_OFF
                           (1): auto             - GST_RPI_CAM_SRC_EXPOSURE_MODE_AUTO
                           (2): night            - GST_RPI_CAM_SRC_EXPOSURE_MODE_NIGHT
                           (3): nightpreview     - GST_RPI_CAM_SRC_EXPOSURE_MODE_NIGHTPREVIEW
                           (4): backlight        - GST_RPI_CAM_SRC_EXPOSURE_MODE_BACKLIGHT
                           (5): spotlight        - GST_RPI_CAM_SRC_EXPOSURE_MODE_SPOTLIGHT
                           (6): sports           - GST_RPI_CAM_SRC_EXPOSURE_MODE_SPORTS
                           (7): snow             - GST_RPI_CAM_SRC_EXPOSURE_MODE_SNOW
                           (8): beach            - GST_RPI_CAM_SRC_EXPOSURE_MODE_BEACH
                           (9): verylong         - GST_RPI_CAM_SRC_EXPOSURE_MODE_VERYLONG
                           (10): fixedfps         - GST_RPI_CAM_SRC_EXPOSURE_MODE_FIXEDFPS
                           (11): antishake        - GST_RPI_CAM_SRC_EXPOSURE_MODE_ANTISHAKE
                           (12): fireworks        - GST_RPI_CAM_SRC_EXPOSURE_MODE_FIREWORKS
  metering-mode       : Camera exposure metering mode to use
                        flags: readable, writable
                        Enum "GstRpiCamSrcExposureMeteringMode" Default: 0, "average"
                           (0): average          - GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_AVERAGE
                           (1): spot             - GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_SPOT
                           (2): backlist         - GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_BACKLIST
                           (3): matrix           - GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_MATRIX
  awb-mode            : White Balance mode
                        flags: readable, writable
                        Enum "GstRpiCamSrcAWBMode" Default: 1, "auto"
                           (0): off              - GST_RPI_CAM_SRC_AWB_MODE_OFF
                           (1): auto             - GST_RPI_CAM_SRC_AWB_MODE_AUTO
                           (2): sunlight         - GST_RPI_CAM_SRC_AWB_MODE_SUNLIGHT
                           (3): cloudy           - GST_RPI_CAM_SRC_AWB_MODE_CLOUDY
                           (4): shade            - GST_RPI_CAM_SRC_AWB_MODE_SHADE
                           (5): tungsten         - GST_RPI_CAM_SRC_AWB_MODE_TUNGSTEN
                           (6): fluorescent      - GST_RPI_CAM_SRC_AWB_MODE_FLUORESCENT
                           (7): incandescent     - GST_RPI_CAM_SRC_AWB_MODE_INCANDESCENT
                           (8): flash            - GST_RPI_CAM_SRC_AWB_MODE_FLASH
                           (9): horizon          - GST_RPI_CAM_SRC_AWB_MODE_HORIZON
  awb-gain-red        : Manual AWB Gain for red channel when awb-mode=off
                        flags: readable, writable
                        Float. Range:               0 -               8 Default:               0 
  awb-gain-blue       : Manual AWB Gain for blue channel when awb-mode=off
                        flags: readable, writable
                        Float. Range:               0 -               8 Default:               0 
  image-effect        : Visual FX to apply to the image
                        flags: readable, writable
                        Enum "GstRpiCamSrcImageEffect" Default: 0, "none"
                           (0): none             - GST_RPI_CAM_SRC_IMAGEFX_NONE
                           (1): negative         - GST_RPI_CAM_SRC_IMAGEFX_NEGATIVE
                           (2): solarize         - GST_RPI_CAM_SRC_IMAGEFX_SOLARIZE
                           (3): posterize        - GST_RPI_CAM_SRC_IMAGEFX_POSTERIZE
                           (4): whiteboard       - GST_RPI_CAM_SRC_IMAGEFX_WHITEBOARD
                           (5): blackboard       - GST_RPI_CAM_SRC_IMAGEFX_BLACKBOARD
                           (6): sketch           - GST_RPI_CAM_SRC_IMAGEFX_SKETCH
                           (7): denoise          - GST_RPI_CAM_SRC_IMAGEFX_DENOISE
                           (8): emboss           - GST_RPI_CAM_SRC_IMAGEFX_EMBOSS
                           (9): oilpaint         - GST_RPI_CAM_SRC_IMAGEFX_OILPAINT
                           (10): hatch            - GST_RPI_CAM_SRC_IMAGEFX_HATCH
                           (11): gpen             - GST_RPI_CAM_SRC_IMAGEFX_GPEN
                           (12): pastel           - GST_RPI_CAM_SRC_IMAGEFX_PASTEL
                           (13): watercolour      - GST_RPI_CAM_SRC_IMAGEFX_WATERCOLOUR
                           (14): film             - GST_RPI_CAM_SRC_IMAGEFX_FILM
                           (15): blur             - GST_RPI_CAM_SRC_IMAGEFX_BLUR
                           (16): saturation       - GST_RPI_CAM_SRC_IMAGEFX_SATURATION
                           (17): colourswap       - GST_RPI_CAM_SRC_IMAGEFX_COLOURSWAP
                           (18): washedout        - GST_RPI_CAM_SRC_IMAGEFX_WASHEDOUT
                           (19): posterise        - GST_RPI_CAM_SRC_IMAGEFX_POSTERISE
                           (20): colourpoint      - GST_RPI_CAM_SRC_IMAGEFX_COLOURPOINT
                           (21): colourbalance    - GST_RPI_CAM_SRC_IMAGEFX_COLOURBALANCE
                           (22): cartoon          - GST_RPI_CAM_SRC_IMAGEFX_CARTOON
  rotation            : Rotate captured image (0, 90, 180, 270 degrees)
                        flags: readable, writable
                        Integer. Range: 0 - 270 Default: 0 
  hflip               : Flip capture horizontally
                        flags: readable, writable
                        Boolean. Default: false
  vflip               : Flip capture vertically
                        flags: readable, writable
                        Boolean. Default: false
  roi-x               : Normalised region-of-interest X coord
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               0 
  roi-y               : Normalised region-of-interest Y coord
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               0 
  roi-w               : Normalised region-of-interest W coord
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               1 
  roi-h               : Normalised region-of-interest H coord
                        flags: readable, writable
                        Float. Range:               0 -               1 Default:               1 
  quantisation-parameter: Set a Quantisation Parameter approx 10-40 with bitrate=0 for VBR encoding. 0 = off
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  inline-headers      : Set to TRUE to insert SPS/PPS before each IDR packet
                        flags: readable, writable
                        Boolean. Default: false
  shutter-speed       : Set a fixed shutter speed, in microseconds. (0 = Auto)
                        flags: readable, writable
                        Integer. Range: 0 - 6000000 Default: 0 
  sensor-mode         : Manually set the camera sensor mode
                        flags: readable, writable
                        Enum "GstRpiCamSrcSensorMode" Default: 0, "automatic"
                           (0): automatic        - Automatic
                           (1): 1920x1080        - 1920x1080 16:9 1-30fps
                           (2): 2592x1944-fast   - 2592x1944 4:3 1-15fps / 3240x2464 15fps w/ v.2 board
                           (3): 2592x1944-slow   - 2592x1944 4:3 0.1666-1fps / 3240x2464 15fps w/ v.2 board
                           (4): 1296x972         - 1296x972 4:3 1-42fps
                           (5): 1296x730         - 1296x730 16:9 1-49fps
                           (6): 640x480-slow     - 640x480 4:3 42.1-60fps
                           (7): 640x480-fast     - 640x480 4:3 60.1-90fps
  drc                 : Dynamic Range Control level
                        flags: readable, writable
                        Enum "GstRpiCamSrcDRCLevel" Default: 0, "off"
                           (0): off              - GST_RPI_CAM_SRC_DRC_LEVEL_OFF
                           (1): low              - GST_RPI_CAM_SRC_DRC_LEVEL_LOW
                           (2): medium           - GST_RPI_CAM_SRC_DRC_LEVEL_MEDIUM
                           (3): high             - GST_RPI_CAM_SRC_DRC_LEVEL_HIGH
  annotation-mode     : Flags to control annotation of the output video
                        flags: readable, writable
                        Flags "GstRpiCamSrcAnnotationMode" Default: 0x00000000, "(none)"
                           (0x00000001): custom-text      - GST_RPI_CAM_SRC_ANNOTATION_MODE_CUSTOM_TEXT
                           (0x00000002): text             - GST_RPI_CAM_SRC_ANNOTATION_MODE_TEXT
                           (0x00000004): date             - GST_RPI_CAM_SRC_ANNOTATION_MODE_DATE
                           (0x00000008): time             - GST_RPI_CAM_SRC_ANNOTATION_MODE_TIME
                           (0x00000010): shutter-settings - GST_RPI_CAM_SRC_ANNOTATION_MODE_SHUTTER_SETTINGS
                           (0x00000020): caf-settings     - GST_RPI_CAM_SRC_ANNOTATION_MODE_CAF_SETTINGS
                           (0x00000040): gain-settings    - GST_RPI_CAM_SRC_ANNOTATION_MODE_GAIN_SETTINGS
                           (0x00000080): lens-settings    - GST_RPI_CAM_SRC_ANNOTATION_MODE_LENS_SETTINGS
                           (0x00000100): motion-settings  - GST_RPI_CAM_SRC_ANNOTATION_MODE_MOTION_SETTINGS
                           (0x00000200): frame-number     - GST_RPI_CAM_SRC_ANNOTATION_MODE_FRAME_NUMBER
                           (0x00000400): black-background - GST_RPI_CAM_SRC_ANNOTATION_MODE_BLACK_BACKGROUND
  annotation-text     : Text string to annotate onto video when annotation-mode flags include 'custom-text'
                        flags: readable, writable
                        String. Default: ""
  annotation-text-size: Set the size of annotation text (in pixels) (0 = Auto)
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  annotation-text-colour: Set the annotation text colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  annotation-text-bg-colour: Set the annotation text background colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  intra-refresh-type  : Type of Intra Refresh to use, -1 to disable intra refresh
                        flags: readable, writable
                        Enum "GstRpiCamSrcIntraRefreshType" Default: -1, "none"
                           (-1): none             - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_NONE
                           (0): cyclic           - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_CYCLIC
                           (1): adaptive         - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_ADAPTIVE
                           (2): both             - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_BOTH
                           (2130706433): cyclic-rows      - GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_CYCLIC_ROWS
  use-stc             : Use the camera STC for timestamping buffers
                        flags: readable, writable
                        Boolean. Default: true

댓글을 달아 주세요

BPI-M4 : Nginx 스트리밍 서버 구축(컴파일)

OS/Banana Pi /BPI-Bit 2021. 2. 23. 01:44 Posted by 파란크리스마스

출처

openssl 라이브러리 소스 다운로드

pi@bpi-iot-ros-ai:~$ wget http://www.openssl.org/source/openssl-1.1.1g.tar.gz
pi@bpi-iot-ros-ai:~$ tar xvf openssl-1.1.1g.tar.gz

PCRE 라이브러리 설치

pi@bpi-iot-ros-ai:~$ wget https://acc.dl.osdn.jp/sfnet/p/pc/pcre/pcre/8.32/pcre-8.32.tar.gz
pi@bpi-iot-ros-ai:~$ tar xvf pcre-8.32.tar.gz
pi@bpi-iot-ros-ai:~$ cd pcre-8.32/
pi@bpi-iot-ros-ai:~/pcre-8.32$ ./configure --prefix=/usr/local
pi@bpi-iot-ros-ai:~/pcre-8.32$ make
pi@bpi-iot-ros-ai:~/pcre-8.32$ sudo make install

zip 라이브러리 설치

pi@bpi-iot-ros-ai:~$ wget https://zlib.net/fossils/zlib-1.2.8.tar.gz
pi@bpi-iot-ros-ai:~$ tar xvf zlib-1.2.8.tar.gz 
pi@bpi-iot-ros-ai:~$ cd zlib-1.2.8/
pi@bpi-iot-ros-ai:~/zlib-1.2.8$ ./configure --prefix=/usr/localmake
pi@bpi-iot-ros-ai:~/zlib-1.2.8$ make -j4
pi@bpi-iot-ros-ai:~/zlib-1.2.8$ sudo make install

nginx 설치

nginx-vod-module 소스 다운로드

pi@bpi-iot-ros-ai:~$ git clone https://github.com/kaltura/nginx-vod-module.git

nginx 소스 다운로드

pi@bpi-iot-ros-ai:~$ wget http://nginx.org/download/nginx-1.19.7.tar.gz
pi@bpi-iot-ros-ai:~$ tar xvf nginx-1.19.7.tar.gz
pi@bpi-iot-ros-ai:~$ cd nginx-1.19.7/

빌드 환경 설정 - configure

  • --add-module=../nginx-vod-module : 스트리밍 관련 라이브러리 추가
  • --pid-path : pid 파일 생성 기본 경로 / 해당 옵션이 없는 경우 nginx.conf에서 설정 가능
pi@bpi-iot-ros-ai:~/nginx-1.19.7$ ./configure \
  --add-module=../nginx-vod-module \
  --prefix=/usr/local/nginx \
  --conf-path=/usr/local/nginx/conf/nginx.conf \
  --error-log-path=/usr/local/nginx/logs/error.log \
  --http-log-path=/usr/local/nginx/logs/access.log \
  --user=nginx \
  --group=nginx \
  --lock-path=/usr/local/nginx/system/nginx.lock \
  --pid-path=/usr/local/nginx/system/nginx.pid \
  --without-http_autoindex_module \
  --without-http_ssi_module \
  --with-file-aio \
  --with-http_ssl_module \
  --with-openssl=../openssl-1.1.1g \
  --with-openssl-opt=enable-weak-ssl-ciphers \
  --with-http_gunzip_module \
  --with-http_gzip_static_module \
  --with-http_random_index_module \
  --with-http_secure_link_module \
  --with-http_stub_status_module \
  --with-http_auth_request_module \
  --with-http_addition_module \
  --with-http_realip_module \
  --with-http_stub_status_module \
  --with-threads --with-stream \
  --with-stream_ssl_module \
  --with-http_v2_module \
  --http-client-body-temp-path=/var/cache/nginx/client_body_temp \
  --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
  --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
  --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
  --http-scgi-temp-path=/var/cache/nginx/scgi_temp

빌드

pi@bpi-iot-ros-ai:~/nginx-1.19.7$ make -j4

설치

pi@bpi-iot-ros-ai:~/nginx-1.19.7$ sudo make install
make -f objs/Makefile install
make[1]: Entering directory '/home/pi/nginx-1.19.7'
cp objs/nginx '/usr/local/nginx/sbin/nginx'
cp conf/koi-win '/usr/local/nginx/conf'
cp conf/koi-utf '/usr/local/nginx/conf'
cp conf/win-utf '/usr/local/nginx/conf'
cp conf/mime.types '/usr/local/nginx/conf/mime.types.default'
cp conf/fastcgi_params \
        '/usr/local/nginx/conf/fastcgi_params.default'
cp conf/fastcgi.conf '/usr/local/nginx/conf/fastcgi.conf.default'
cp conf/uwsgi_params \
        '/usr/local/nginx/conf/uwsgi_params.default'
cp conf/scgi_params \
        '/usr/local/nginx/conf/scgi_params.default'
cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default'
test -d '/usr/local/nginx/system' \
        || mkdir -p '/usr/local/nginx/system'
test -d '/usr/local/nginx/logs' \
        || mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/html' \
        || cp -R html '/usr/local/nginx'
test -d '/usr/local/nginx/logs' \
        || mkdir -p '/usr/local/nginx/logs'
make[1]: Leaving directory '/home/pi/nginx-1.19.7'

nginx 계정 추가

error.log에 해당 오류 발견시 계정 추가 필요 nginx: [emerg] getpwnam("nginx") failed

pi@bpi-iot-ros-ai:~$ sudo groupadd nginx
pi@bpi-iot-ros-ai:~$ sudo useradd -g nginx -s /bin/bash -m nginx

nginx 서비스 등록

nginx.service 파일 생성

pi@bpi-iot-ros-ai:~$ sudo vi /etc/systemd/system/nginx.service

 

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/usr/local/nginx/system/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

nginx.service 서비스 등록

pi@bpi-iot-ros-ai:~$ sudo systemctl enable nginx.service
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /etc/systemd/system/nginx.service.

nginx.service 서비스 시작

pi@bpi-iot-ros-ai:~$ sudo systemctl start nginx.service

nginx.service 서비스 상태확인

pi@bpi-iot-ros-ai:~$ sudo systemctl status nginx.service

nginx 스트리밍 관련 환경 설정

nginx.conf 수정

pi@bpi-iot-ros-ai:~$ sudo vi /usr/local/nginx/conf/nginx.conf

 

    server {
        listen       80;
        server_name  localhost;

        # vod settings
        vod_mode local;
        vod_fallback_upstream_location /fallback;
        vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
        vod_last_modified_types *;
        vod_metadata_cache metadata_cache 512m;
        vod_response_cache response_cache 128m;
        gzip on;
        gzip_types application/vnd.apple.mpegurl;

        vod_segment_duration 1000;

        open_file_cache          max=1000 inactive=5m;
        open_file_cache_valid    2m;
        open_file_cache_min_uses 1;
        open_file_cache_errors   on;
        aio on;
        location /content/ {
                root /media_content/;
                vod hls;
                add_header Access-Control-Allow-Headers '*';
                add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
                add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
                add_header Access-Control-Allow-Origin '*';
                expires 100d;
        }

nginx.service 서비스 재시작

pi@bpi-iot-ros-ai:~$ sudo systemctl restart nginx.service

동영상 파일 복사

pi@bpi-iot-ros-ai:~$ sudo mkdir -p /media_content/content
pi@bpi-iot-ros-ai:~$ cd /media_content/content
pi@bpi-iot-ros-ai:/media_content/content$ wget https://www.radiantmediaplayer.com/media/big-buck-bunny-360p.mp4

동영상 구현 (hls.js)

pi@bpi-iot-ros-ai:~$ cd /usr/local/nginx/html
pi@bpi-iot-ros-ai:/usr/local/nginx/html$ sudo vi player.htm

 

<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<video id="video" controls></video>
<script>
  if(Hls.isSupported()) {
    var video = document.getElementById('video');
    var hls = new Hls();
    hls.loadSource('http://192.168.0.87/content/big-buck-bunny-360p.mp4/index.m3u8');
    hls.attachMedia(video);
    hls.on(Hls.Events.MANIFEST_PARSED,function() {
      // video.play();
    });
  }
</script>

확인

TAG BPI M4, nginx

댓글을 달아 주세요

Raspberry Pi Pico

OS/Raspberry Pi 2021. 2. 23. 01:09 Posted by 파란크리스마스

출처

알리에서 구입한 핀해더가 납땜이된 Raspberry Pi Pico와 Pimoroni에서 구입한 Raspberry Pi Pico

Raspberry Pi Pico의 앞면과 뒷면

USB로 PC와 연결시 Windows의 드라이브로 표시

Raspberry Pi Pico Spec

Raspberry Pi Pico는 Raspberry Pi에서 설계된 실리콘에 구축 된 유연한 디지털 인터페이스를 갖춘 저가형 고성능 마이크로 컨트롤러 보드입니다.

  • 영국의 Raspberry Pi가 설계 한 RP2040 마이크로 컨트롤러 칩
  • 듀얼 코어 ARM Cortex M0+ 프로세서, 최대 133MHz로 실행되는 유연한 클록
  • 264kB SRAM 및 2MB 온보드 플래시 메모리
  • Castellated 모듈로 캐리어 보드에 직접 납땜 가능
  • USB 1.1 호스트 및 장치 지원
  • 저전력 절전 및 휴면 모드
  • 드래그 앤 드롭으로 프로그램밍한 결과를을 USB를 통한 대용량 저장 장치에 적용
  • 26 개의 다기능 GPIO 핀
  • 2×SPI, 2×I2C, 2×UART, 3×12-bit ADC, 16×제어 할 수 있는 PWM 채널
  • 정확한 클록 및 타이머 온칩
  • 온도 센서
  • Accelerated floating point libraries on-chip
  • 8×Programmable IO (PIO) state machines for custom peripheral support

댓글을 달아 주세요

NanoPi M4V2 : 카메라(OV13850) 사용하기

OS/NanoPi 2021. 2. 21. 00:51 Posted by 파란크리스마스

출처

NanoPi M4V2 : 카메라(ov13850)

이지미출처 : File:M4-mipi-single-camera.jpg - FriendlyARM WiKi

카메라(ov13850) 모듈 확인

pi@NanoPi-M4v2:~$ dmesg | grep ov13850
[    1.137232] ov13850 1-0010: driver version: 00.01.01
[    1.137688] ov13850 1-0010: could not get module information!
[    1.138295] ov13850 1-0010: GPIO lookup for consumer reset
[    1.138308] ov13850 1-0010: using device tree for GPIO lookup
[    1.138344] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/i2c@ff110000/ov13850@10[0]' - status (0)
[    1.138380] ov13850 1-0010: GPIO lookup for consumer pwdn
[    1.138391] ov13850 1-0010: using device tree for GPIO lookup
[    1.138423] of_get_named_gpiod_flags: parsed 'pwdn-gpios' property of node '/i2c@ff110000/ov13850@10[0]' - status (0)
[    1.142534] ov13850 1-0010: Detected OV00d850 sensor, REVISION 0xb1
[    1.143438] ov13850 2-0010: driver version: 00.01.01
[    1.143893] ov13850 2-0010: could not get module information!
[    1.144472] ov13850 2-0010: GPIO lookup for consumer reset
[    1.144484] ov13850 2-0010: using device tree for GPIO lookup
[    1.144519] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/i2c@ff120000/ov13850@10[0]' - status (0)
[    1.144556] ov13850 2-0010: GPIO lookup for consumer pwdn
[    1.144567] ov13850 2-0010: using device tree for GPIO lookup
[    1.144597] of_get_named_gpiod_flags: parsed 'pwdn-gpios' property of node '/i2c@ff120000/ov13850@10[0]' - status (0)
[    1.149264] ov13850 2-0010: Unexpected sensor id(000000), ret(-5)

카메라(ov13850) 모듈 확인

pi@NanoPi-M4v2:~$ v4l2-ctl -V -d /dev/video0
Format Video Capture Multiplanar:
        Width/Height      : 640/480
        Pixel Format      : 'YUYV'
        Field             : None
        Number of planes  : 1
        Flags             : 
        Colorspace        : Default
        Transfer Function : Default
        YCbCr Encoding    : Default
        Quantization      : Full Range
        Plane 0           :
           Bytes per Line : 1280
           Size Image     : 614400
pi@NanoPi-M4v2:~$ v4l2-ctl -V -d /dev/video1
Format Video Capture Multiplanar:
        Width/Height      : 1920/1568
        Pixel Format      : 'YUYV'
        Field             : None
        Number of planes  : 1
        Flags             : 
        Colorspace        : Default
        Transfer Function : Default
        YCbCr Encoding    : Default
        Quantization      : Full Range
        Plane 0           :
           Bytes per Line : 3840
           Size Image     : 6021120
pi@NanoPi-M4v2:~$ v4l2-ctl -d /dev/v4l-subdev0 --all
Driver Info (not using libv4l2):
        Driver name   : 
        Card type     : 
        Bus info      : 
        Driver version: 0.0.0
        Capabilities  : 0x00000000
 
User Controls
 
                       exposure 0x00980911 (int)    : min=4 max=1660 step=1 default=1536 value=1536
 
Image Source Controls
 
              vertical_blanking 0x009e0901 (int)    : min=96 max=31199 step=1 default=96 value=96
            horizontal_blanking 0x009e0902 (int)    : min=2688 max=2688 step=1 default=2688 value=2688 flags=read-only
                  analogue_gain 0x009e0903 (int)    : min=16 max=248 step=1 default=16 value=16
 
Image Processing Controls
 
                 link_frequency 0x009f0901 (intmenu): min=0 max=0 default=0 value=0 flags=read-only
                     pixel_rate 0x009f0902 (int64)  : min=0 max=0 step=0 default=0 value=120000000 flags=read-only
                   test_pattern 0x009f0903 (menu)   : min=0 max=4 default=0 value=0
pi@NanoPi-M4v2:~$ v4l2-ctl -d /dev/v4l-subdev1 --all
Driver Info (not using libv4l2):
        Driver name   : 
        Card type     : 
        Bus info      : 
        Driver version: 0.0.0
        Capabilities  : 0x00000000
 
User Controls
 
                       exposure 0x00980911 (int)    : min=4 max=1660 step=1 default=1536 value=1536
 
Image Source Controls
 
              vertical_blanking 0x009e0901 (int)    : min=96 max=31199 step=1 default=96 value=96
            horizontal_blanking 0x009e0902 (int)    : min=2688 max=2688 step=1 default=2688 value=2688 flags=read-only
                  analogue_gain 0x009e0903 (int)    : min=16 max=248 step=1 default=16 value=16
 
Image Processing Controls
 
                 link_frequency 0x009f0901 (intmenu): min=0 max=0 default=0 value=0 flags=read-only
                     pixel_rate 0x009f0902 (int64)  : min=0 max=0 step=0 default=0 value=120000000 flags=read-only
                   test_pattern 0x009f0903 (menu)   : min=0 max=4 default=0 value=0
pi@NanoPi-M4v2:~$ v4l2-ctl -d /dev/v4l-subdev2 --all
Driver Info (not using libv4l2):
        Driver name   : 
        Card type     : 
        Bus info      : 
        Driver version: 0.0.0
        Capabilities  : 0x00000000
 
User Controls
 
                       exposure 0x00980911 (int)    : min=4 max=1660 step=1 default=1536 value=1536
 
Image Source Controls
 
              vertical_blanking 0x009e0901 (int)    : min=96 max=31199 step=1 default=96 value=96
            horizontal_blanking 0x009e0902 (int)    : min=2688 max=2688 step=1 default=2688 value=2688 flags=read-only
                  analogue_gain 0x009e0903 (int)    : min=16 max=248 step=1 default=16 value=16
 
Image Processing Controls
 
                 link_frequency 0x009f0901 (intmenu): min=0 max=0 default=0 value=0 flags=read-only
                     pixel_rate 0x009f0902 (int64)  : min=0 max=0 step=0 default=0 value=120000000 flags=read-only
                   test_pattern 0x009f0903 (menu)   : min=0 max=4 default=0 value=0

카메라(ov13850) 모듈 확인

pi@NanoPi-M4v2:~$ media-ctl -d /dev/media0 -p
Media controller API version 0.1.0
 
Media device information
------------------------
driver          rkisp1
model           rkisp1
serial          
bus info        
hw revision     0x0
driver version  0.0.0
 
Device topology
- entity 1: rkisp1-isp-subdev (4 pads, 6 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Sink
                [fmt:SBGGR10_1X10/2112x1568 field:none
                 crop.bounds:(0,0)/2112x1568
                 crop:(0,0)/2112x1568]
                <- "rkisp1_dmapath":0 []
                <- "rockchip-mipi-dphy-rx":1 [ENABLED]
        pad1: Sink
                <- "rkisp1-input-params":0 [ENABLED]
        pad2: Source
                [fmt:YUYV8_2X8/2112x1568 field:none
                 crop.bounds:(0,0)/2112x1568
                 crop:(0,0)/2112x1568]
                -> "rkisp1_selfpath":0 [ENABLED]
                -> "rkisp1_mainpath":0 [ENABLED]
        pad3: Source
                -> "rkisp1-statistics":0 [ENABLED]
 
- entity 2: rkisp1_mainpath (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "rkisp1-isp-subdev":2 [ENABLED]
 
- entity 3: rkisp1_selfpath (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video1
        pad0: Sink
                <- "rkisp1-isp-subdev":2 [ENABLED]
 
- entity 4: rkisp1_dmapath (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video2
        pad0: Source
                -> "rkisp1-isp-subdev":0 []
 
- entity 5: rkisp1-statistics (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video3
        pad0: Sink
                <- "rkisp1-isp-subdev":3 [ENABLED]
 
- entity 6: rkisp1-input-params (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video4
        pad0: Source
                -> "rkisp1-isp-subdev":1 [ENABLED]
 
- entity 7: rockchip-mipi-dphy-rx (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
        pad0: Sink
                [fmt:SBGGR10_1X10/2112x1568@10000/300000 field:none]
                <- "ov13850 1-0010":0 [ENABLED]
        pad1: Source
                [fmt:SBGGR10_1X10/2112x1568@10000/300000 field:none]
                -> "rkisp1-isp-subdev":0 [ENABLED]
 
- entity 8: ov13850 1-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
        pad0: Source
                [fmt:SBGGR10_1X10/2112x1568@10000/300000 field:none]
                -> "rockchip-mipi-dphy-rx":0 [ENABLED]

카메라(ov13850) 연결 확인

pi@NanoPi-M4v2:~$ dmesg | grep Async
[    1.839621] rkisp1: Async subdev notifier completed

gst-camera 설치

pi@NanoPi-M4v2:~$ cd /tmp/
pi@NanoPi-M4v2:/tmp$ git clone https://github.com/friendlyarm/gst-camera-sh.git
Cloning into 'gst-camera-sh'...
remote: Enumerating objects: 36, done.
remote: Total 36 (delta 0), reused 0 (delta 0), pack-reused 36
Unpacking objects: 100% (36/36), done.
pi@NanoPi-M4v2:/tmp$ sudo cp gst-camera-sh/*.sh /usr/bin/

카메라(ov13850) 캡쳐

pi@NanoPi-M4v2:/tmp$ gst-camera.sh -a photo -o 1.jpg
gst-launch-1.0: no process found
====================================================
=== GStreamer 1.1 command:
=== gst-launch-1.0 rkisp num-buffers=20 device=/dev/video0 io-mode=1 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=10/1 ! jpegenc ! multifilesink location="/tmp/isp-frame%d.jpg"
====================================================
{{{{{{ start take photo
Setting pipeline to PAUSED ...
media get entity by name: lens is null
XCAM ERROR v4l2_device.cpp:254: VIDIOC_QUERYCAP returned: -1 (Inappropriate ioctl for device)
XCAM ERROR v4l2_device.cpp:254: VIDIOC_QUERYCAP returned: -1 (Inappropriate ioctl for device)
XCAM ERROR rkisp_control_loop_impl.cpp:99: failed to get camera module info
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
XCAM ERROR rkisp_device.cpp:72: atomisp device(/dev/video0) try subdev format failed
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:00.759673858
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
}}}}}} end take photo

Image sensors OV13850 & OV4689 at the i2c ports 1 & 2

pi@NanoPi-M4v2:~/mjpg-streamer/mjpg-streamer-experimental$ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- 0c -- -- -- 
10: UU -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
pi@NanoPi-M4v2:~/mjpg-streamer/mjpg-streamer-experimental$ ls -l /sys/class/video4linux/
total 0
lrwxrwxrwx 1 root root 0 Feb 28 17:30 v4l-subdev0 -> ../../devices/platform/ff910000.rkisp1/video4linux/v4l-subdev0
lrwxrwxrwx 1 root root 0 Feb 28 17:30 v4l-subdev1 -> ../../devices/platform/ff910000.rkisp1/video4linux/v4l-subdev1
lrwxrwxrwx 1 root root 0 Feb 28 17:30 v4l-subdev2 -> ../../devices/platform/ff910000.rkisp1/video4linux/v4l-subdev2
lrwxrwxrwx 1 root root 0 Feb 28 17:30 v4l-subdev3 -> ../../devices/platform/ff920000.rkisp1/video4linux/v4l-subdev3
lrwxrwxrwx 1 root root 0 Feb 28 17:30 v4l-subdev4 -> ../../devices/platform/ff920000.rkisp1/video4linux/v4l-subdev4
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video0 -> ../../devices/platform/ff910000.rkisp1/video4linux/video0
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video1 -> ../../devices/platform/ff910000.rkisp1/video4linux/video1
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video2 -> ../../devices/platform/ff910000.rkisp1/video4linux/video2
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video3 -> ../../devices/platform/ff910000.rkisp1/video4linux/video3
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video4 -> ../../devices/platform/ff910000.rkisp1/video4linux/video4
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video5 -> ../../devices/platform/ff920000.rkisp1/video4linux/video5
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video6 -> ../../devices/platform/ff920000.rkisp1/video4linux/video6
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video7 -> ../../devices/platform/ff920000.rkisp1/video4linux/video7
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video8 -> ../../devices/platform/ff920000.rkisp1/video4linux/video8
lrwxrwxrwx 1 root root 0 Feb 28 17:30 video9 -> ../../devices/platform/ff920000.rkisp1/video4linux/video9

화이트 밸런스 조정 (실패)

pi@NanoPi-M4v2:~$ v4l2-ctl -d 1 --set-ctrl=white_balance_temperature_auto=1
unknown control 'white_balance_temperature_auto'

댓글을 달아 주세요

BPI-M4 : M.2 E-Key - SD 드라이브 설치

OS/Banana Pi /BPI-Bit 2021. 2. 20. 02:19 Posted by 파란크리스마스

출처

BPI-M4의 경우 전용 카메라, 모니터를 사용할 수 있는 확장 슬롯이 없고 기본 eMMC가 용량이 작아서 아쉬웠는데 M.2 E-Key로 SD 메모리를 확장 할 수 있어서 소개합니다.

SD 메모리 장착 전, 후
확장보드 장착 전, 후

리눅스 정보 확인

pi@bpi-iot-ros-ai:~$ uname -a
Linux bpi-iot-ros-ai 4.9.119-BPI-M4-Kernel #1 SMP PREEMPT Mon May 18 10:41:36 HKT 2020 aarch64 aarch64 aarch64 GNU/Linux

리눅스 배포판 버전 확인

pi@bpi-iot-ros-ai:~$ grep . /etc/*-release
/etc/armbian-image-release:# PLEASE DO NOT EDIT THIS FILE
/etc/armbian-image-release:BOARD=bananapim64
/etc/armbian-image-release:BOARD_NAME="Banana Pi M64"
/etc/armbian-image-release:BOARDFAMILY=sun50iw1
/etc/armbian-image-release:VERSION=5.41
/etc/armbian-image-release:LINUXFAMILY=pine64
/etc/armbian-image-release:BRANCH=default
/etc/armbian-image-release:ARCH=arm64
/etc/armbian-image-release:IMAGE_TYPE=user-built
/etc/armbian-image-release:BOARD_TYPE=csc
/etc/armbian-image-release:INITRD_ARCH=arm
/etc/armbian-image-release:KERNEL_IMAGE_TYPE=Image
/etc/lsb-release:DISTRIB_ID=Ubuntu
/etc/lsb-release:DISTRIB_RELEASE=18.04
/etc/lsb-release:DISTRIB_CODENAME=bionic
/etc/lsb-release:DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
/etc/os-release:NAME="Ubuntu"
/etc/os-release:VERSION="18.04.4 LTS (Bionic Beaver)"
/etc/os-release:ID=ubuntu
/etc/os-release:ID_LIKE=debian
/etc/os-release:PRETTY_NAME="Ubuntu 18.04.4 LTS"
/etc/os-release:VERSION_ID="18.04"
/etc/os-release:HOME_URL="https://www.ubuntu.com/"
/etc/os-release:SUPPORT_URL="https://help.ubuntu.com/"
/etc/os-release:BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
/etc/os-release:PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
/etc/os-release:VERSION_CODENAME=bionic
/etc/os-release:UBUNTU_CODENAME=bionic

dmesg 확인

pi@bpi-iot-ros-ai:~$ dmesg | grep pci
[    2.204941] [RTD139x PCIE] 98060000.pcie: PCIE host driver initial begin.
[    2.204973] [RTD139x PCIE] 98060000.pcie: PCIE Debug Mode off
[    2.441801] [RTD139x PCIE] 98060000.pcie: PCIE device has link down in slot 2
[    2.441833] [RTD139x PCIE] 98060000.pcie: rtk_pcie_139x_hw_initial fail
[    2.441886] [RTD139x PCIE]: probe of 98060000.pcie failed with error -22
[    4.922306] ehci-pci: EHCI PCI platform driver
[    4.922978] ohci-pci: OHCI PCI platform driver

블럭장치 확인

확장 드라이브 설치 전

pi@bpi-iot-ros-ai:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  7.3G  0 disk 
├─mmcblk0p1  179:1    0  256M  0 part /media/pi/BPI-BOOT
└─mmcblk0p2  179:2    0  6.8G  0 part /
mmcblk0boot0 179:8    0    4M  1 disk 
mmcblk0boot1 179:16   0    4M  1 disk 
mmcblk0rpmb  179:24   0  512K  0 disk

확장 드라이브 설치 후

pi@bpi-iot-ros-ai:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    1 29.7G  0 disk 
└─sda1         8:1    1 29.7G  0 part /media/pi/3665-3463
mmcblk0      179:0    0  7.3G  0 disk 
├─mmcblk0p1  179:1    0  256M  0 part /media/pi/BPI-BOOT
└─mmcblk0p2  179:2    0  6.8G  0 part /
mmcblk0boot0 179:8    0    4M  1 disk 
mmcblk0boot1 179:16   0    4M  1 disk 
mmcblk0rpmb  179:24   0  512K  0 disk

USB 정보 확인

확장 드라이브 설치 전

pi@bpi-iot-ros-ai:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0bda:c820 Realtek Semiconductor Corp. 
Bus 001 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

확장 드라이브 설치 후

pi@bpi-iot-ros-ai:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0bda:c820 Realtek Semiconductor Corp. 
Bus 001 Device 003: ID 05e3:0751 Genesys Logic, Inc. 
Bus 001 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

fdisk 확인

pi@bpi-iot-ros-ai:~$ sudo fdisk -l
 
... 생략 ...
 
Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 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: 0x00000000
 
Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        8192 62333951 62325760 29.7G  c W95 FAT32 (LBA)

추가된 디스트의 파티션을 만들고 mount 하기

디스크 확인

pi@bpi-iot-ros-ai:~$ sudo fdisk -l | grep '^Disk'
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/mmcblk0: 7.3 GiB, 7818182656 bytes, 15269888 sectors
Disklabel type: dos
Disk identifier: 0xc69bd2d7
Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Disklabel type: dos
Disk identifier: 0x00000000

기존 파티션을 삭제하고 새로 파티션 생성

pi@bpi-iot-ros-ai:~$ sudo fdisk /dev/sda
 
Welcome to fdisk (util-linux 2.31.1).
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/sda: 29.7 GiB, 31914983424 bytes, 62333952 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: 0x00000000
 
Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        8192 62333951 62325760 29.7G  c W95 FAT32 (LBA)
 
Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
 
Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62333951, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-62333951, default 62333951): 
 
Created a new partition 1 of type 'Linux' and of size 29.7 GiB.
 
Command (m for help): w
The partition table has been altered.
Failed to remove partition 1 from system: Device or resource busy
Failed to add partition 1 to system: Device or resource busy
 
The kernel still uses the old partitions. The new table will be used at the next reboot. 
Syncing disks.

재부팅

pi@bpi-iot-ros-ai:/sd_disk$ sudo shutdown -r now

디스크 format

pi@bpi-iot-ros-ai:~$ sudo mkfs.ext4 /dev/sda1
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 7791488 4k blocks and 1949696 inodes
Filesystem UUID: ca144d66-31b2-4bac-ac7d-db0d6ccb0075
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000
 
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:        
done

mount 할 디렉토리 생성

pi@bpi-iot-ros-ai:~$ sudo mkdir /sd_disk

mount

pi@bpi-iot-ros-ai:~$ sudo mount /dev/sda1 /sd_disk

확인

pi@bpi-iot-ros-ai:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            320M     0  320M   0% /dev
tmpfs            68M  6.0M   63M   9% /run
/dev/mmcblk0p2  6.7G  5.4G  992M  85% /
tmpfs           340M     0  340M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           340M     0  340M   0% /sys/fs/cgroup
tmpfs           340M  4.0K  340M   1% /tmp
tmpfs            68M   16K   68M   1% /run/user/1000
overlaid         68M   16K   68M   1% /run/user/1000/pi-chromium
/dev/sda1        30G  128K   30G   1% /sd_disk
/dev/mmcblk0p1  256M   38M  218M  15% /media/pi/BPI-BOOT

자동 mount

UUID 확인

pi@bpi-iot-ros-ai:~$ sudo blkid
/dev/mmcblk0: PTUUID="c69bd2d7" PTTYPE="dos"
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="BPI-BOOT" UUID="D0B7-DA68" TYPE="vfat" PARTUUID="c69bd2d7-01"
/dev/mmcblk0p2: LABEL="BPI-ROOT" UUID="f28d8061-d9a4-495b-96f0-c3e5233eaa1d" TYPE="ext4" PARTUUID="c69bd2d7-02"
/dev/sda1: UUID="ca144d66-31b2-4bac-ac7d-db0d6ccb0075" TYPE="ext4"

fstab 파일에 파티션 추가

pi@bpi-iot-ros-ai:~$ sudo vi /etc/fstab

 

# 파티션 추가 
UUID=ca144d66-31b2-4bac-ac7d-db0d6ccb0075 /sd_disk ext4 defaults 0 0

댓글을 달아 주세요

Pi Case 40 | Cooler Master

OS/Raspberry Pi 2021. 1. 22. 02:20 Posted by 파란크리스마스

출처

Pi Case 40 | Cooler Master

쿨러나 PC용 케이스로 유명한 쿨러마스터에서 만든 라즈베리파이용 케이스입니다. 킥스타트에서 처음 소개 되었고, 현재는 아마존에서도 구입이 가능합니다.

시중에 라즈베리파이 케이스가 많아서 특별하게 더 다른것은 없지만, 개인적으로 디자인은 마음에 들었습니다.

쿨러 없이 상판이 알루미늄으로 CPU의 열이 전도 되어 상판 전체적으로 방열하도록 되어 있고, 하판은 플라스틱으로 되어 있어서 아쉬운 부분이 있습니다.

GPIO핀은 상판에서 꽃아 90도로 회전해서 오른쪽 벽에 GPIO를 사용할 수 있도록 되어 있습니다. 고무로된 덥개를 열면 됩니다.

댓글을 달아 주세요

  1. 무료자료 2021.02.09 13:46  댓글주소  수정/삭제  댓글쓰기

    안녕하세요.
    2월의 시작~즐겁게 시작하셨나 모르겠습니다.
    티스토리 포럼에서 블로그 주소보고 방문하였습니다.

    다름이 아니라 무료 블로그 교육자료를 배포하고 있습니다. 구글 드라이브에서 다운로드 받아 정독해보시면 블로그 운영에 도움이 되실겁니다.
    https://drive.google.com/file/d/1Jgv7XshH-kH9IYuIDEcvl2YE3K3Iwrdi/view?usp=sharing

    현재 네이버 카페도 운영중에 있는데요.
    저의 2020년 7월 ~ 12월 수익이 궁금하시다면 아래글에서 확인해보세요.
    https://cafe.naver.com/blog300/2607

    원하지 않았던 정보였다면 죄송합니다.
    2021년 풍성한 한해가 되시길 기원합니다.

Orange Pi Zero2

OS/Orange PI 2021. 1. 21. 21:46 Posted by 파란크리스마스

출처

Orange Pi Zero2

Shenzhen Xunlong Software CO.,Limited 제공 이미지, 스펙

댓글을 달아 주세요

NanoPi NEO2 Black

OS/NanoPi 2021. 1. 16. 02:18 Posted by 파란크리스마스

출처

리눅스 정보 확인

CPU 정보 확인

pi@NanoPi-NEO2-Black:~$ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
 ... 생략 ...
 
Hardware        : Allwinnersun50iw2Family
Revision        : 0000
Serial          : 0000000000000000

instruction set architecture (ISA)

pi@NanoPi-NEO2-Black:~$ uname -i
aarch64

eMMC에 OS 설치

이미지 복원이 완료되면 SD 메모리를 제거하고 재부팅

eMMC 확인

pi@NanoPi-NEO2-Black:~$ sudo fdisk -l | grep Disk
Disk /dev/mmcblk0: 59.5 GiB, 63864569856 bytes, 124735488 sectors
Disklabel type: dos
Disk identifier: 0xd70475ff
Disk /dev/mmcblk1: 29.1 GiB, 31268536320 bytes, 61071360 sectors
Disk /dev/mmcblk1boot1: 4 MiB, 4194304 bytes, 8192 sectors
Disk /dev/mmcblk1boot0: 4 MiB, 4194304 bytes, 8192 sectors

eMMC에 OS 설치

pi@NanoPi-NEO2-Black:~$ sudo dd if=nanopi-neo2-black_sd_friendlycore-xenial_4.14_arm64_20191219.img of=/dev/mmcblk1 bs=10MB
278+1 records in
278+1 records out
2787115008 bytes (2.8 GB, 2.6 GiB) copied, 123.871 s, 22.5 MB/s

원격 데스크톱 설치

desktop environment 설치

pi@NanoPi-NEO2-Black:~$ sudo apt install xfce4

Xrdp 설치

pi@NanoPi-NEO2-Black:~$ sudo apt install xrdp

xrdp 서비스 상태 확인

pi@NanoPi-NEO2-Black:~$ systemctl status xrdp
● xrdp.service - LSB: Start xrdp and sesman daemons
   Loaded: loaded (/etc/init.d/xrdp; bad; vendor preset: enabled)
   Active: active (running) since Fri 2021-01-15 16:59:06 UTC; 11s ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/xrdp.service
           ├─15133 /usr/sbin/xrdp
           └─15135 /usr/sbin/xrdp-sesman

~/.xsession 생성 및 확인

pi@NanoPi-NEO2-Black:~$ ls /usr/bin/*session
/usr/bin/dbus-run-session  /usr/bin/xfce4-session
pi@NanoPi-NEO2-Black:~$ echo "xfce4-session" > ~/.xsession
pi@NanoPi-NEO2-Black:~$ cat ~/.xsession
xfce4-session

웹브라우저 설치

pi@NanoPi-NEO2-Black:~$ sudo apt install chromium-browser

댓글을 달아 주세요

Install CodeTyphon in QT5 environment on Mac

OS/Mac 2021. 1. 15. 23:41 Posted by 파란크리스마스

출처

xcode 설치

bluesanta@Sunghoui-MacBookPro ~ % xcode-select --install

"sudo" 루트 권한 부여

bluesanta@Sunghoui-MacBookPro ~ % sudo vi /etc/sudoers

%admin          ALL = (ALL) ALL
bluesanta       ALL=(ALL) NOPASSWD: ALL

CodeTyphon 압축 해제

bluesanta@Sunghoui-MacBookPro ~ % cd Downloads/
bluesanta@Sunghoui-MacBookPro Downloads % unzip CodeTyphonIns.zip

7zip 설치

bluesanta@Sunghoui-MacBookPro ~ % brew install p7zip

필수 라이브러리 설치 (xterm, wget, gdb이 설치되어 있는지 먼저 확인 할것)

bluesanta@Sunghoui-MacBookPro ~ % brew install wget gdb
bluesanta@Sunghoui-MacBookPro ~ % ln -s /usr/local/Homebrew/Library/Homebrew/shims/mac/super/gmake /usr/local/bin/gmake
bluesanta@Sunghoui-MacBookPro ~ % ln -s /usr/share/terminfo/78/xterm /usr/local/bin/xterm
bluesanta@Sunghoui-MacBookPro ~ % ln -s /Library/Developer/CommandLineTools/usr/bin/make /usr/local/bin/make
bluesanta@Sunghoui-MacBookPro ~ % ln -s /usr/local/bin/gdb /usr/local/bin/ggdb

Qt 버전 확인

bluesanta@Sunghoui-MacBookPro ~ % /usr/local/Cellar/qt/5.15.2/bin/qmake --version
QMake version 3.1
Using Qt version 5.15.2 in /usr/local/Cellar/qt/5.15.2/lib

Qt5pas 라이브러리 설치 (Option : CodeTyphon 설치시 11) -- Platform (widget) Setup 에서 실행)

qt5-qmake 설치

bluesanta@Sunghoui-MacBookPro ~ % brew install qt5
 
 ... 생략 ...
 
qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.
 
If you need to have qt first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc
 
For compilers to find qt you may need to set:
  export LDFLAGS="-L/usr/local/opt/qt/lib"
  export CPPFLAGS="-I/usr/local/opt/qt/include"
 
==> Summary
🍺  /usr/local/Cellar/qt/5.15.2: 10,688 files, 367.9MB
bluesanta@Sunghoui-MacBookPro ~ % brew install Caskroom/cask/qt-creator
==> Installing Cask qt-creator
==> Moving App 'Qt Creator.app' to '/Applications/Qt Creator.app'.
🍺  qt-creator was successfully installed!

ln_Typhon1_QT5pas_Build.sh 수정

bluesanta@Sunghoui-MacBookPro ScriptsLin % vi ln_Typhon1_QT5pas_Build.sh

qmake 경로 수정

  Darwin)
       vQMake=/usr/local/Cellar/qt/5.15.2/bin/qmake

수동 컴파일 및 설치

bluesanta@Sunghoui-MacBookPro /opt % sudo mkdir -p /opt/local/libexec
bluesanta@Sunghoui-MacBookPro /opt % sudo ln -s /usr/local/Cellar/qt/5.15.2 /opt/
bluesanta@Sunghoui-MacBookPro ScriptsLin % chmod 755 *.sh
bluesanta@Sunghoui-MacBookPro ScriptsLin % ./ln_Typhon1_QT5pas_Build.sh
 
 ... 생략 ...
 
mv -f Qt5Pas Qt5Pas.framework/Versions/1/Qt5Pas
ln -s Versions/Current/Qt5Pas Qt5Pas.framework/Qt5Pas
rm -f -r /usr/local/Cellar/qt/5.15.2/lib/Qt5Pas.framework
/usr/local/Cellar/qt/5.15.2/bin/qmake -install qinstall Qt5Pas.framework /usr/local/Cellar/qt/5.15.2/lib/Qt5Pas.framework
strip -S -x /usr/local/Cellar/qt/5.15.2/lib/Qt5Pas.framework/Versions/1/Qt5Pas
/usr/local/codetyphon/qt5pas/x86_64-darwin
make install
   
   
---------------------------------------
[INFO]: Qt5Pas.framework Library finish Build OK for x86_64-darwin
   
   
---------------------------------------------------------
    Make qt5pas Libraries Links
---------------------------------------------------------
   
[INFO] Make Qt5Pas.framework links to /Library/Frameworks/Qt5Pas.framework for x86_64-darwin finish OK

fpc.cnf 수정

bluesanta@Sunghoui-MacBookPro ScriptsLin % vi /usr/local/codetyphon/fpc/fpc64/bin/x86_64-darwin/fpc.cnf

# -------------
# Linking
# -------------
-Ff/Library/Frameworks

CodeTyphon 설치 스크립트 실행

bluesanta@Sunghoui-MacBookPro Downloads % cd CodeTyphonIns/
bluesanta@Sunghoui-MacBookPro CodeTyphonIns % export FPCOPT=-Ff/Library/Frameworks
bluesanta@Sunghoui-MacBookPro CodeTyphonIns % ./install.sh

0번 선택

====================================================
             CodeTyphon Studio 
            Version 7.30 (GEN 7)
  Installation for Linux-Solaris-Openindiana-MacOS
          FreeBSD-NetBSD-OpenBSD-DragonFly
====================================================
 
   0) Install CodeTyphon Studio
 
   9) Exit
 
>>> Select an action (press 0..9 key): 0

11번 선택

====================================================
  CodeTyphon Studio 7.30 Setup for Darwin64
   Settings: Platform=cocoa  Multiarch Mode=0
====================================================
   
   0) Install System Libraries
   1) Run CodeTyphon Center (CTC)
   
     11) -- Platform (widget) Setup
     12) -- Multi-Architecture Setup
   
   3) Remove FreePascal
   4) Remove and Build FreePascal
   
   5) Remove Typhon IDE
   6) Remove and Build Typhon IDE
   
   7) Remove ALL
   8) Remove and Build ALL
   
   9) EXIT
   
>>> Select an action (press 0..9 key): 11

5번 QT5 선택

====================================================
    CodeTyphon Studio MacOS Platform (widget) Setup 
        Current Platform: cocoa
====================================================
   
Warning: Install System Libraries after every Platform change
   
   1) Cocoa         (Default)
   2) Carbon
   3) GTK2
   4) QT4
   5) QT5
   6) GTK3           (Experimental)
   7) FpGUI          (Experimental)
   8) CustomDrawn    (Experimental)
   
   9) Back to Main Setup
   
>>> Select a platform (press 0..9 key): 5

12번 선택

====================================================
  CodeTyphon Studio 7.30 Setup for Darwin64
   Settings: Platform=qt5  Multiarch Mode=0
====================================================
   
   0) Install System Libraries
   1) Run CodeTyphon Center (CTC)
   
     11) -- Platform (widget) Setup
     12) -- Multi-Architecture Setup
   
   3) Remove FreePascal
   4) Remove and Build FreePascal
   
   5) Remove Typhon IDE
   6) Remove and Build Typhon IDE
   
   7) Remove ALL
   8) Remove and Build ALL
   
   9) EXIT
   
>>> Select an action (press 0..9 key): 12

1번 선택

====================================================
    CodeTyphon Studio Multi-Architecture Setup
      Current Multiarch Mode: 0
====================================================
   
   0) NO  Multi-Architecture Mode (Multiarch=0)
   
   1) Use Multi-Architecture Mode (Multiarch=1)
   
   
   9) Back to Main Setup
   
>>> Select Mode (press 0..9 key): 1

0번 선택 ( 0) Install System Libraries )

====================================================
  CodeTyphon Studio 7.30 Setup for Darwin64
   Settings: Platform=qt5  Multiarch Mode=0
====================================================
   
   0) Install System Libraries
   1) Run CodeTyphon Center (CTC)
   
     11) -- Platform (widget) Setup
     12) -- Multi-Architecture Setup
   
   3) Remove FreePascal
   4) Remove and Build FreePascal
   
   5) Remove Typhon IDE
   6) Remove and Build Typhon IDE
   
   7) Remove ALL
   8) Remove and Build ALL
   
   9) EXIT
   
>>> Select an action (press 0..9 key): 0

8번 선택 ( 8) Remove and Build ALL )

====================================================
  CodeTyphon Studio 7.30 Setup for Darwin64
   Settings: Platform=qt5  Multiarch Mode=1
====================================================
   
   0) Install System Libraries
   1) Run CodeTyphon Center (CTC)
   
     11) -- Platform (widget) Setup
     12) -- Multi-Architecture Setup
   
   3) Remove FreePascal
   4) Remove and Build FreePascal
   
   5) Remove Typhon IDE
   6) Remove and Build Typhon IDE
   
   7) Remove ALL
   8) Remove and Build ALL
   
   9) EXIT
   
>>> Select an action (press 0..9 key): 8

9번 선택 ( 9) EXIT )

====================================================
  CodeTyphon Studio 7.30 Setup for Darwin64
   Settings: Platform=qt5  Multiarch Mode=0
====================================================
   
   0) Install System Libraries
   1) Run CodeTyphon Center (CTC)
   
     11) -- Platform (widget) Setup
     12) -- Multi-Architecture Setup
   
   3) Remove FreePascal
   4) Remove and Build FreePascal
   
   5) Remove Typhon IDE
   6) Remove and Build Typhon IDE
   
   7) Remove ALL
   8) Remove and Build ALL
   
   9) EXIT
   
>>> Select an action (press 0..9 key): 9

/opt/local/libexec/qt5

bluesanta@Sunghoui-MacBookPro libexec % sudo ln -s /opt/local/libexec/qt5-mac/ /opt/local/libexec/qt5

실행

댓글을 달아 주세요

NanoPi M4V2 : Armbian Linux 버전

OS/NanoPi 2021. 1. 3. 23:54 Posted by 파란크리스마스

출처

eMMC에 OS 설치

이미지 복원이 완료되면 SD 메모리를 제거하고 재부팅

eMMC 확인

pi@nanopim4v2:~$ fdisk -l | grep Disk
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
Disk /dev/mmcblk2: 29.12 GiB, 31268536320 bytes, 61071360 sectors
Disklabel type: gpt
Disk identifier: 73987B6B-4974-4C94-A3E8-58AB2EB7A946
Disk /dev/mmcblk1: 14.86 GiB, 15931539456 bytes, 31116288 sectors
Disklabel type: dos
Disk identifier: 0x75c728fe
Disk /dev/zram0: 50 MiB, 52428800 bytes, 12800 sectors
Disk /dev/zram1: 1.88 GiB, 1992282112 bytes, 486397 sectors

eMMC에 OS 설치

pi@nanopim4v2:~$ sudo dd if=Armbian_20.11.3_Nanopim4v2_focal_current_5.9.14_desktop.img of=/dev/mmcblk2 bs=10MB
368+1 records in
368+1 records out
3686793216 bytes (3.7 GB, 3.4 GiB) copied, 68.1611 s, 54.1 MB/s

원격 데스크톱 설치

Xrdp 설치

pi@nanopim4v2:~$ sudo apt install xrdp xorgxrdp

xrdp 서비스 상태 확인

pi@nanopim4v2:~$ sudo systemctl status xrdp
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-01-04 00:48:08 KST; 24s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
   Main PID: 9093 (xrdp)
      Tasks: 1 (limit: 4383)
     Memory: 712.0K
     CGroup: /system.slice/xrdp.service
             └─9093 /usr/sbin/xrdp
 
 1월 04 00:48:07 nanopim4v2 xrdp[9092]: (9092)(281473703223312)[INFO ] address [0.0.0.0] port [3389] mode 1
 1월 04 00:48:07 nanopim4v2 xrdp[9092]: (9092)(281473703223312)[INFO ] listening to port 3389 on 0.0.0.0
 1월 04 00:48:07 nanopim4v2 xrdp[9092]: (9092)(281473703223312)[INFO ] xrdp_listen_pp done
 1월 04 00:48:07 nanopim4v2 xrdp[9092]: (9092)(281473703223312)[DEBUG] Closed socket 7 (AF_INET6 :: port 338>
 1월 04 00:48:07 nanopim4v2 systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after st>
 1월 04 00:48:08 nanopim4v2 systemd[1]: Started xrdp daemon.
 1월 04 00:48:09 nanopim4v2 xrdp[9093]: (9093)(281473703223312)[INFO ] starting xrdp with pid 9093
 1월 04 00:48:09 nanopim4v2 xrdp[9093]: (9093)(281473703223312)[INFO ] address [0.0.0.0] port [3389] mode 1
 1월 04 00:48:09 nanopim4v2 xrdp[9093]: (9093)(281473703223312)[INFO ] listening to port 3389 on 0.0.0.0
 1월 04 00:48:09 nanopim4v2 xrdp[9093]: (9093)(281473703223312)[INFO ] xrdp_listen_pp done

~/.xsession 생성 및 확인

pi@nanopim4v2:~$ ls /usr/bin/*session
/usr/bin/dbus-run-session  /usr/bin/xfce4-session
pi@NanoPi-M4v2:~$ echo "xfce4-session" > ~/.xsession
pi@NanoPi-M4v2:~$ cat ~/.xsession
xfce4-session

한글폰트 설치

pi@orangepi4:~$ sudo apt install language-pack-ko fonts-nanum fonts-nanum-extra

댓글을 달아 주세요