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

댓글을 달아 주세요

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

댓글을 달아 주세요

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년 풍성한 한해가 되시길 기원합니다.

Raspberry Pi 4 : 한글 입력기 설치 (fcitx)

OS/Raspberry Pi 2020. 12. 27. 18:37 Posted by 파란크리스마스

출처

fcitx-hangul 설치

pi@raspberrypi:~$ sudo apt-get install fcitx-hangul im-config

한글 입력기 부팅시 시작하기

pi@raspberrypi:~$ im-config -n fcitx

한글 입력기 설정 확인

pi@raspberrypi:~$ cat ~/.xinputrc
# im-config(8) generated on Sun, 27 Dec 2020 17:49:05 +0900
run_im fcitx
# im-config signature: c519abadb35fd4cbda207562ebdc4690  -

한글폰트 설치

pi@raspberrypi:~$ sudo apt install fonts-nanum fonts-nanum-extra

한글 ????? 출력 해결

로케일 관련 패키지가 설치

pi@raspberrypi:~$ sudo apt install locales

로케일 설정

pi@raspberrypi:~$ sudo dpkg-reconfigure locales

Package configuration

 +-----------------------+ Configuring locales +-----------------------+
 | Locales are a framework to switch between multiple languages and    |
 | allow users to use their language, country, characters, collation   |
 | order, etc.                                                         |
 |                                                                     |
 | Please choose which locales to generate. UTF-8 locales should be    |
 | chosen by default, particularly for new installations. Other        |
 | character sets may be useful for backwards compatibility with       |
 | older systems and software.                                         |
 |                                                                     |
 | Locales to be generated:                                            |
 |                                                                     |
 |    [ ] en_NG UTF-8                                                  |
 |    [ ] en_NZ ISO-8859-1                                         a   |
 |    [ ] en_NZ.UTF-8 UTF-8                                        a   |
 |    [ ] en_ZA ISO-8859-1                                         a   |
 |    [*] en_US.UTF-8 UTF-8                                        a   |
 |    [*] ko_KR.UTF-8 UTF-8                                        a   |
 |                                                                     |
 |                                                                     |
 |                  <ok>                      <cancel>                 |
 |                                                                     |
 +---------------------------------------------------------------------+
 +-----------------------+ Configuring locales +-----------------------+
 | Many packages in Debian use locales to display text in the correct  |
 | language for the user. You can choose a default locale for the      |
 | system from the generated locales.                                  |
 |                                                                     |
 | This will select the default language for the entire system. If     |
 | this system is a multi-user system where not all users are able to  |
 | speak the default language, they will experience difficulties.      |
 |                                                                     |
 | Default locale for the system environment:                          |
 |                                                                     |
 |                             None                                    |
 |                           [ C.UTF-8     ]                           |
 |                             en_ZA.UTF-8                             |
 |                             ko_KR.UTF-8                             |
 |                                                                     |
 |                                                                     |
 |                  <ok>                      <cancel>                 |
 |                                                                     |
 +---------------------------------------------------------------------+	

한글 입력기 추가

댓글을 달아 주세요

Raspberry Pi 4 : CodeTyphon 설치

OS/Raspberry Pi 2020. 12. 27. 18:37 Posted by 파란크리스마스

출처

"sudo" 루트 권한 부여

pi@raspberrypi:~$ sudo vi /etc/sudoers

orangepi ALL=(ALL) NOPASSWD: ALL

CodeTyphon 압축 해제

pi@raspberrypi:~$ cd Downloads/
pi@raspberrypi:~/Downloads$ unzip CodeTyphonIns.zip

Qt 버전 확인

pi@raspberrypi:~$ qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib/arm-linux-gnueabihf/qt4/bin"
QTLIBDIR="/usr/lib/arm-linux-gnueabihf"
pi@raspberrypi:~$ qmake --version
QMake version 2.01a
Using Qt version 4.8.7 in /usr/lib/arm-linux-gnueabihf

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

qt4-qmake 설치

pi@raspberrypi:~$ sudo apt install qt4-qmake qt4-dev-tools libqtwebkit-dev

ln_Typhon1_QT4pas_Build.sh 수정

pi@raspberrypi:~/Downloads/CodeTyphonIns/installbin/ScriptsLin$ vi ln_Typhon1_QT4pas_Build.sh

i386-linux-gnu를 arm-linux-gnueabihf 수정

# ---- these settings are for Ubuntu Linux -------
      if [ $vBits = 32 ] ;
       then
        vQMake=/usr/lib/i386-linux-gnu/qt4/bin/qmake
       else
        vQMake=/usr/lib/x86_64-linux-gnu/qt4/bin/qmake
       fi

qt4pas.7z 압축을 풀어서 i386-linux 폴더를 arm-linux 복사하고 다시 압축

수동 컴파일 및 설치

pi@raspberrypi:~/Downloads/CodeTyphonIns/installbin/ScriptsLin$ ./ln_Typhon1_QT4pas_Build.sh
 
 ... 생략 ...
 
ln -s libQt4Pas.so.5.2.8 libQt4Pas.so
ln -s libQt4Pas.so.5.2.8 libQt4Pas.so.5
ln -s libQt4Pas.so.5.2.8 libQt4Pas.so.5.2
install -m 755 -p "libQt4Pas.so.5.2.8" "/usr/lib/arm-linux-gnueabihf/libQt4Pas.so.5.2.8"
strip --strip-unneeded "/usr/lib/arm-linux-gnueabihf/libQt4Pas.so.5.2.8"
ln -f -s "libQt4Pas.so.5.2.8" "/usr/lib/arm-linux-gnueabihf/libQt4Pas.so"
ln -f -s "libQt4Pas.so.5.2.8" "/usr/lib/arm-linux-gnueabihf/libQt4Pas.so.5"
ln -f -s "libQt4Pas.so.5.2.8" "/usr/lib/arm-linux-gnueabihf/libQt4Pas.so.5.2"
   
---------------------------------------
[INFO]: QT4pas Libraries finish Build OK for arm-linux
   
   
---------------------------------------------------------
    Make QT4Pas Libraries Links
---------------------------------------------------------
   
[INFO] Make QT4pas links to /usr/lib/arm-linux-gnueabihf/ for arm-linux finish OK

CodeTyphon 설치 스크립트 실행

pi@raspberrypi:~/Downloads$ cd CodeTyphonIns/
pi@raspberrypi:~/Downloads/CodeTyphonIns$ ./install.sh

11번 선택

====================================================
  CodeTyphon Studio 7.20 Setup for Linux32
   Settings: Platform=qt4  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

2번 QT4 선택

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

12번 선택

====================================================
  CodeTyphon Studio 7.20 Setup for Linux32
   Settings: Platform=qt4  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.20 Setup for Linux32
   Settings: Platform=qt4  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.20 Setup for Linux32
   Settings: Platform=qt4  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): 8

9번 선택 ( 9) EXIT )

====================================================
  CodeTyphon Studio 6.70 Setup for Linux64
   Settings: Platform=gtk2  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

실행

런타임라이브러리 설치 (개발환경이 없는 곳에서 실행)

qt4pas_aarch64-linux.tar.gz

pi@raspberrypi:~$ ./project1 
./project1: error while loading shared libraries: libQt4Pas.so.5: cannot open shared object file: No such file or directory
pi@raspberrypi:~$ sudo install -m 755 -p "libQt4Pas.so" "/usr/lib/arm-linux-gnueabihf/libQt4Pas.so.5"
pi@raspberrypi:~$ ./project1 
./project1: error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory
pi@raspberrypi:~$ sudo apt install libqtwebkit4

댓글을 달아 주세요

출처

리눅스 정보 확인

CPU 정보 확인

$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 9000c1
Serial          : 00000000xxxxxxxx
Model           : Raspberry Pi Zero W Rev 1.1

instruction set architecture (ISA)

$ uname -m
armv6l

커널에 대한 정보

$ uname -a
Linux raspberrypi 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l GNU/Linux

OS버전에 대한 정보

$ cat /etc/issue
Raspbian GNU/Linux 10 \n \l

논리 코어 수 확인

$ grep -c processor /proc/cpuinfo
2

swap 사이즈 설정

tensorflow 설치시 2G 정도의 메모리가 필요 하므로, swap 사이즈을 늘려주고, 설치가 끝나면 원복 필요

현재 swap 사이즈 확인

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          432Mi       143Mi        48Mi        14Mi       241Mi       224Mi
Swap:          99Mi        99Mi       0.0Ki

swap 서비스 종료 (swap 설정 파일 수정을 위해서)

$ sudo /etc/init.d/dphys-swapfile stop
Stopping dphys-swapfile (via systemctl): dphys-swapfile.service.

swap 설정 파일 수정

$ sudo vi /etc/dphys-swapfile

# CONF_SWAPSIZE=100
CONF_SWAPSIZE=2048

swap 서비스 시작

$ sudo /etc/init.d/dphys-swapfile start
Starting dphys-swapfile (via systemctl): dphys-swapfile.service.

현재 swap 사이즈 확인

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          432Mi       220Mi        40Mi        32Mi       171Mi       128Mi
Swap:         2.0Gi          0B       2.0Gi

관련 라이브러리 설치, pip3 설치 확인

$ sudo apt update
$ sudo apt install gfortran libopenblas-dev liblapack-dev libhdf5-dev
$ pip3 --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

파이썬 라이브러리 설치

$ sudo pip3 install setuptools wheel h5py

TensorFlow 2.2.0 패키지 설치

TensorFlow 2.2.0 패키지 다운로드

$ wget http://1.229.109.140:3562/tensorflow/tensorflow-2.2.0.armv6l/tensorflow-2.2.0-cp37-none-linux_armv6l.whl

tensorflow 2.2.0 파이썬 페키지 설치

$ pip3 install tensorflow-2.2.0-cp37-none-linux_armv6l.whl
 
 ... 생략 ...
 
Successfully installed astunparse-1.6.3 gast-0.3.3 setuptools-46.1.3 tensorboard-2.2.1 tensorboard-plugin-wit-1.6.0.post3 tensorflow-2.2.0 tensorflow-estimator-2.2.0

버전 확인

$ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.2.0'

댓글을 달아 주세요

출처

리눅스 정보 확인

CPU 정보 확인

$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 9000c1
Serial          : 00000000xxxxxxxx
Model           : Raspberry Pi Zero W Rev 1.1

instruction set architecture (ISA)

$ uname -m
armv6l

커널에 대한 정보

$ uname -a
Linux raspberrypi 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l GNU/Linux

OS버전에 대한 정보

$ cat /etc/issue
Raspbian GNU/Linux 10 \n \l

논리 코어 수 확인

$ grep -c processor /proc/cpuinfo
2

TensorFlow C, C++ 라이브러리 설치

TensorFlow 라이브러리 다운로드

$ wget http://1.229.109.140:3562/tensorflow/tensorflow-2.2.0.armv6l/libtensorflow.tar.gz

TensorFlow 라이브러리 설치

$ sudo tar -C /usr/local -xzf libtensorflow.tar.gz

Linker 설정

$ sudo ldconfig

예제 hello.c

#include <stdio.h>
#include <tensorflow/c/c_api.h>

int main() {
  printf("TensorFlow C library version %s\n", TF_Version());
  return 0;
}

예제 컴파일

$ gcc hello.c -ltensorflow -o hello

예제 실행

$ ./hello
TensorFlow C library version 2.2.0

댓글을 달아 주세요

Raspberry Pi 4 : TensorFlow 2.2.0 (armv7l) 설치 (Python 3.7)

OS/Raspberry Pi 2020. 5. 8. 01:04 Posted by 파란크리스마스

출처

리눅스 정보 확인

CPU 정보 확인

$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3
 
 ... 생략 ...
 
Hardware        : BCM2835
Revision        : b03112
Serial          : 10000000xxxxxxxx
Model           : Raspberry Pi 4 Model B Rev 1.2

instruction set architecture (ISA)

$ uname -m
armv7l

커널에 대한 정보

$ uname -a
Linux raspberrypi 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux

OS버전에 대한 정보

$ cat /etc/issue
Raspbian GNU/Linux 10 \n \l

논리 코어 수 확인

$ grep -c processor /proc/cpuinfo
4

메모리, swap 사이즈 확인

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          1.9Gi       145Mi       1.0Gi        42Mi       751Mi       1.6Gi
Swap:          99Mi          0B        99Mi

관련 라이브러리 설치, pip3 설치 확인

$ sudo apt update
$ sudo apt install gfortran libopenblas-dev liblapack-dev libhdf5-dev
$ pip3 --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

TensorFlow 2.2.0 패키지 설치

TensorFlow 2.2.0 패키지 다운로드

$ wget http://1.229.109.140:3562/tensorflow/tensorflow-2.2.0.armv7l/tensorflow-2.2.0-cp37-none-linux_armv7l.whl

tensorflow 2.2.0 파이썬 페키지 설치

$ pip3 install tensorflow-2.2.0-cp37-none-linux_armv7l.whl
 
 ... 생략 ...
 
Successfully installed absl-py-0.9.0 astunparse-1.6.3 cachetools-4.1.0 gast-0.3.3 google-auth-1.14.2 google-auth-oauthlib-0.4.1 google-pasta-0.2.0 grpcio-1.28.1 h5py-2.10.0 keras-preprocessing-1.1.0 markdown-3.2.1 opt-einsum-3.2.1 protobuf-3.11.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 rsa-4.0 scipy-1.4.1 setuptools-46.1.3 tensorboard-2.2.1 tensorboard-plugin-wit-1.6.0.post3 tensorflow-2.2.0 tensorflow-estimator-2.2.0 termcolor-1.1.0 wrapt-1.12.1

버전 확인

$ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.2.0'

댓글을 달아 주세요

  1. dnwhd 2020.10.08 02:46  댓글주소  수정/삭제  댓글쓰기

    사랑합니다...

출처

리눅스 정보 확인

CPU 정보 확인

$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3
 
 ... 생략 ...
 
Hardware        : BCM2835
Revision        : b03112
Serial          : 10000000xxxxxxxx
Model           : Raspberry Pi 4 Model B Rev 1.2

instruction set architecture (ISA)

$ uname -m
armv7l

커널에 대한 정보

$ uname -a
Linux raspberrypi 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux

OS버전에 대한 정보

$ cat /etc/issue
Raspbian GNU/Linux 10 \n \l

논리 코어 수 확인

$ grep -c processor /proc/cpuinfo
4

TensorFlow C, C++ 라이브러리 설치

TensorFlow 라이브러리 다운로드

$ wget http://1.229.109.140:3562/tensorflow/tensorflow-2.2.0.armv7l/libtensorflow.tar.gz

TensorFlow 라이브러리 설치

$ sudo tar -C /usr/local -xzf libtensorflow.tar.gz

Linker 설정

$ sudo ldconfig

예제 hello.c

#include <stdio.h>
#include <tensorflow/c/c_api.h>

int main() {
  printf("TensorFlow C library version %s\n", TF_Version());
  return 0;
}

예제 컴파일

$ gcc hello.c -ltensorflow -o hello

예제 실행

$ ./hello
TensorFlow C library version 2.2.0

댓글을 달아 주세요

Raspberry Pi Zero : TensorFlow 2.1.0 설치 (Python 3.7)

OS/Raspberry Pi 2020. 4. 8. 01:36 Posted by 파란크리스마스

출처

pip3 설치

$ sudo apt update
$ sudo apt install gfortran libopenblas-dev liblapack-dev libhdf5-dev
$ pip3 --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

파이썬 라이브러리 설치

$ sudo pip3 install setuptools wheel h5py

swap 사이즈 설정

현재 swap 사이즈 확인

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          432Mi       143Mi        48Mi        14Mi       241Mi       224Mi
Swap:          99Mi        99Mi       0.0Ki

swap 서비스 종료 (swap 설정 파일 수정을 위해서)

$ sudo /etc/init.d/dphys-swapfile stop
Stopping dphys-swapfile (via systemctl): dphys-swapfile.service.

swap 설정 파일 수정

$ sudo vi /etc/dphys-swapfile

# CONF_SWAPSIZE=100
CONF_SWAPSIZE=2048

swap 서비스 시작

$ sudo /etc/init.d/dphys-swapfile start
Starting dphys-swapfile (via systemctl): dphys-swapfile.service.

현재 swap 사이즈 확인

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          432Mi       220Mi        40Mi        32Mi       171Mi       128Mi
Swap:         2.0Gi          0B       2.0Gi

TensorFlow 2.1.0 패키지 설치

TensorFlow 2.1.0 패키지 다운로드

$ wget http://1.229.109.140:3562/tensorflow/tensorflow-2.1.0.armv6l/tensorflow-2.1.0-cp37-none-linux_armv6l.whl

tensorflow 2.1.0 파이썬 페키지 설치

$ pip3 install tensorflow-2.1.0-cp37-none-linux_armv6l.whl
 
 ... 생략 ...
 
Successfully installed absl-py-0.9.0 astor-0.8.1 cachetools-4.0.0 gast-0.2.2 google-auth-1.13.1 google-auth-oauthlib-0.4.1 google-pasta-0.2.0 grpcio-1.28.1 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.2.1 opt-einsum-3.2.0 protobuf-3.11.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 rsa-4.0 scipy-1.4.1 tensorboard-2.1.1 tensorflow-2.1.0 tensorflow-estimator-2.1.0 termcolor-1.1.0 wrapt-1.12.1

버전 확인

$ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.1.0'

댓글을 달아 주세요

출처

리눅스 정보 확인

CPU 정보 확인

$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7
 
Hardware        : BCM2835
Revision        : 9000c1
Serial          : 000000002a9067d9
Model           : Raspberry Pi Zero W Rev 1.1

커널에 대한 정보

$ uname -a
Linux raspberrypi 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l GNU/Linux

OS버전에 대한 정보

$ cat /etc/issue
Raspbian GNU/Linux 10 \n \l

논리 코어 수 확인

$ grep -c processor /proc/cpuinfo
2

TensorFlow C, C++ 라이브러리 설치

TensorFlow 라이브러리 다운로드

$ wget http://1.229.109.140:3562/tensorflow/tensorflow-2.1.0.armv6l/libtensorflow.tar.gz

TensorFlow 라이브러리 설치

$ sudo tar -C /usr/local -xzf libtensorflow.tar.gz

Linker 설정

$ sudo ldconfig

예제 hello.c

#include <stdio.h>
#include <tensorflow/c/c_api.h>

int main() {
  printf("TensorFlow C library version %s\n", TF_Version());
  return 0;
}

예제 컴파일

$ gcc hello.c -ltensorflow -o hello

예제 실행

$ ./hello
TensorFlow C library version 2.1.0

댓글을 달아 주세요

Raspberry Pi 4 : TensorFlow 2.1.0 설치 (Python 3.7)

OS/Raspberry Pi 2020. 3. 12. 23:54 Posted by 파란크리스마스

출처

TensorFlow 2.1.0 패키지 설치

TensorFlow 2.1.0 패키지 다운로드

$ wget http://1.229.109.140:3562/tensorflow/tensorflow-2.1.0/tensorflow-2.1.0-cp37-cp37m-linux_armv7l.whl

tensorflow 2.1.0 파이썬 패키지 설치

$ sudo pip3 install tensorflow-2.1.0-cp37-cp37m-linux_armv7l.whl
 
... 생략 ...
 
Successfully installed absl-py-0.9.0 astor-0.8.1 cachetools-4.0.0 gast-0.2.2 google-auth-1.11.2 google-auth-oauthlib-0.4.1 google-pasta-0.1.8 grpcio-1.27.2 h5py-2.10.0 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.2.1 opt-einsum-3.2.0 protobuf-3.11.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 rsa-4.0 scipy-1.4.1 tensorboard-2.1.1 tensorflow-2.1.0 tensorflow-estimator-2.1.0 termcolor-1.1.0 wrapt-1.12.1

버전 확인

$ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.1.0'

댓글을 달아 주세요