메뉴 건너뛰기

enjoyTools.net

스크린 매니저 설명: https://pythonprogramming.net/kivy-screen-manager-tutorial/

 


Kivy dependancies for MS-Windows: chardet, urllib3, certifi, idna, requests, Kivy-Garden, docutils, pygments, kivy, kivy.deps.sdl2 kivy.deps.glew

 via https://stackoverflow.com/questions/34943224/how-can-i-bypass-kivy-module-error-importerror-dll-load-failed-the-specified

 

Kivy for Raspberry Pi:

 via https://kivy.org/docs/installation/installation-rpi.html

 - sudo apt-get update

   sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \

   pkg-config libgl1-mesa-dev libgles2-mesa-dev \

   libgstreamer1.0-dev git-core \

   gstreamer1.0-plugins-{bad,base,good,ugly} \

   gstreamer1.0-{omx,alsa} libmtdev-dev \

   xclip

 - sudo apt-get install python3-dev

 - 우황청심환 준비/복용. Cython, Kivy 컴파일하다가 숨 넘어간다.

 - sudo pip3 install setuptools

 - sudo pip3 install wheel

 - sudo pip3 install cython==0.25.2 -> sudo pip3 install kivy

  * 먼저 https://kivy.org/docs/installation/installation.html 여기 문서에서 요구하는 Cython 버전을 반드시 확인

 - sudo pip3 install kivy-garden

 - sudo pip3 install pyserial

 - 가든 라이브러리 설치: garden install knob , garden install gauge , garden install graph

 - sudo pip3 install RPi.GPIO

Kivy Tutorials at youtube: https://www.youtube.com/playlist?list=PLQVvvaa0QuDe_l6XiJ40yGTEqIKugAdTy

 

 

라즈베리파이3 터치패널에서 Kivy로 터치 가능하게 :

 - https://github.com/mrichardson23/rpi-kivy-screen

 - 특히 아래의 13, 14, 15번 항목

13. To enable touch, you will need to make a modification to the default Kivy configuration file. To create that file, first run an example:

pi@raspberrypi ~/kivy $ python ~/kivy/examples/demo/pictures/main.py

 

14. Quit the example with Ctrl+C and then open the newly-created config.ini file for editing:

pi@raspberrypi ~/kivy $ nano ~/.kivy/config.ini

 

15. Go into the [input] section, remove the lines that are in there and put in:

mouse = mouse

mtdev_%(name)s = probesysfs,provider=mtdev

hid_%(name)s = probesysfs,provider=hidinput

 

화면 오동작 발생 시:

 - GPU 메모리 증가 - /boot/config.txt 수정 -> gpu_mem=256 / https://github.com/kivy/kivy/issues/4662

 - CPU 오버클럭 (파이3은 오버클럭 안 됨.)

 - 전류량 높은 놈으로 전원 공급

 

- 라즈베리파이에 파이썬 컴파일 설치 (출처: http://blog.acidpop.kr/245 )

(라즈비안 STRETCH는 파이썬 3.5.3이 기본으로 설치되어 있어서 아래 작업 필요 없음)

 * raspbian 업데이트

  sudo apt-get update

  sudo apt-get upgrade -y

  sudo apt-get dist-upgrade   <-- 이 명령은 굳이 안해도 된다.

 * 컴파일에 필요한 라이브러리 설치.

  sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev 

  sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev

  sudo apt-get install libssl-dev openssl

 * Python 소스 다운로드 및 컴파일, 설치.

  cd /home/pi/

  mkdir temppython

  cd temppython

  wget "https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz"

  tar xvf Python-3.5.3.tgz

  cd Python-3.5.3

  ./configure

  make

  sudo make install

 * pip 설치.

  wget https://bootstrap.pypa.io/get-pip.py

  sudo python3.5 get-pip.py

  pip3.5 --version

 
끝.