{"id":5076,"date":"2022-10-05T11:48:05","date_gmt":"2022-10-05T02:48:05","guid":{"rendered":"http:\/\/shinku.ddo.jp\/wordpress\/?page_id=5076"},"modified":"2022-10-05T11:48:05","modified_gmt":"2022-10-05T02:48:05","slug":"raspberry-pi%e3%81%a7%e9%81%8a%e3%81%b6%ef%bc%9adietpi1-3inch-waveshare-lcd","status":"publish","type":"page","link":"http:\/\/shinku.ddo.jp\/wordpress\/?page_id=5076","title":{"rendered":"Raspberry pi\u3067\u904a\u3076\uff1aDietPi+1.3inch WaveShare LCD"},"content":{"rendered":"\n<p>\u304c\u305f\u304c\u305f\u8a00\u3063\u3066\u3082\u3057\u3087\u3046\u304c\u306a\u3044\u306e\u3067\u7d50\u8ad6\u3092\u6700\u521d\u306b\u8a00\u3046\u3068\u3001\u304b\u306a\u308a\u8efd\u91cf\u3067\u3059<\/p>\n\n\n\n<p>\u25cf\u5c0e\u5165\u306b\u3064\u3044\u3066<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\r\n\r\n\u25cfDIETPI\u3092\u5165\u308c\u308b\u610f\u5473\u5408\u3044\r\n\r\nRaspberryPi ZERO (WH)\u3078\u306eGUI\u306e\u5c0e\u5165\u306e\u305f\u3081\u3067\u3059\u3002\r\n\r\n\u3054\u5b58\u3058\u901a\u308a\u3001Raspberry Pi Zero\u306f\u7701\u8cc7\u6e90\u3067\u3042\u308a\u3001\u96fb\u529b\u306f\u5c11\u306a\u304f\u3066\u6e08\u307f\u307e\u3059\u304cRaspbian(\u6539\u3081\u3001\u6700\u8fd1\u306fRaspberryPi OS)\u3092\u5165\u308c\u308b\u306b\u306f\u53b3\u3057\u3044\u3088\u3046\u3067\u3059\u3002\r\n\u7279\u306b\u3001CUI\u3067SSH\u3067\u4f7f\u7528\u3059\u308b\u3068\u3044\u3046\u4f7f\u3044\u65b9\u3067\u306f\u307e\u3060\u3044\u3044\u306e\u3067\u3059\u304c\u3001GUI\u3068\u306a\u308b\u3068\u53b3\u3057\u3044\u3067\u3059\u3002\r\n\r\n\u4e00\u65b9\u3001Waveshare\u306e1.3inch LCD HAD\u304c240 x 240\u30e9\u30a4\u30f3\u5bfe\u5fdc\u3067\u3042\u308b\u3068\u306e\u3053\u3068\u3067\u3001\u3053\u308c\u3092GUI\u3067\u52d5\u304b\u3057\u3066\u307f\u305f\u3044\u3001\u3068\u3044\u3046\u697d\u3057\u307f\u304c\u3054\u3056\u3044\u307e\u3057\u3066\u3001Raspberryy Pi\u7528\u306e\u8efd\u91cf\u306eOS\u3001\u3067\u304d\u308c\u3070Raspbian\u306e\u4f7f\u3044\u52dd\u624b\u3092\u306a\u308b\u3079\u304f\u7dad\u6301\u3057\u305f\u3044\u3053\u3068\u304b\u3089Debian\u7cfb\u3092\u63a2\u3057\u307e\u3057\u305f\u3068\u3053\u308dDIETPI\u306b\u884c\u304d\u3064\u304d\u307e\u3057\u305f\u3002\r\nDIETPI\u306fDebian\u7cfb\u306e\u8efd\u91cf\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u3001\u3053\u308c\u306b\u8efd\u91cf\u3067\u3042\u308b\u3068\u8a55\u5224\u306eLXDE\u3092\u541b\u5408\u308f\u305b\u3088\u3046\u304b\u3068\u8003\u3048\u307e\u3057\u305f\u3002\r\n\r\n\u25cf\u7d50\u679c\r\n\u3080\u3063\u3061\u3083\u8efd\u3044\u3067\u3059\u3002\r\n\u8d77\u52d5\u306b\u306f\u591a\u5c11\u6642\u9593\u304c\u304b\u304b\u308b\u3082\u306e\u306e\u3001\u4e00\u56de\u8d77\u52d5\u3057\u3066\u3057\u307e\u3048\u3070\u305d\u3053\u305d\u3053\u666e\u901a\u306b\u4f7f\u3048\u307e\u3059\u3002\r\n\u51e6\u7406\u81ea\u4f53\u306f\u9045\u3044\u3067\u3059\u304cOS\u81ea\u4f53\u306f\u4f55\u3068\u304b\u306a\u308a\u305d\u3046\u3067\u3059\r\n\r\n\r\n\r\n\u25cfRaspberry pi\u3078\u306e\u8a2d\u5b9a\u624b\u9806\r\n\r\n\u25cfDIETPI\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\u624b\u9806\u306f\u5927\u307e\u304b\u306b\r\n\u2460img\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\r\n\u2461img\u3092SD\u30ab\u30fc\u30c9\u306b\u713c\u304d\u3053\u3080\r\n\u2462\u521d\u56de\u8d77\u52d5\uff06\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\r\n\r\n\u30fb\u6ce8\u610f\u70b9\r\n\u3000SPI\u6709\u52b9\u5316\r\n\u3000\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2\u306e\u9078\u629e\u3067\u3001LXDE\u304a\u3088\u3073\u30b7\u30b9\u30c6\u30e0\u7cfb\u3001\u958b\u767a\u7cfb\u306e\u30bd\u30d5\u30c8\u306f\u4e00\u901a\u308a\u5165\u308c\u308b\r\n\u3000WEB\u30b7\u30b9\u30c6\u30e0\u306fAPACHE\u3068MARIA DB\r\n\r\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001startx\u3067x\u8d77\u52d5\u3067\u304d\u307e\u3059\u3002\r\n\uff08LXDE\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u8a2d\u5b9a\u3082\u3057\u3066\u304f\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\uff09\r\n\r\n\u25cf\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306e\u8a2d\u5b9a\r\n\r\napt-get update\r\nnet-tools\r\n\r\n\r\n#>>>>>>>>1.3inch LCD HAD\u3092\u5165\u308c\u308b\u5834\u5408\r\nsudo apt-get install cmake -y\r\nsudo apt-get install p7zip-full -y\r\nsudo apt-get install build-essential\r\nsudo apt-get install gcc\r\n\r\n#>>>>>>>>https:\/\/raspberrypi.stackexchange.com\/questions\/36121\/fatal-error-bcm-host-h-no-such-file-or-directory-compilation-terminated\r\n#>>>>>>>>bcm_host.h: No such file or directory compilation terminated\u907f\u3051\r\nsudo apt-get install libraspberrypi-dev raspberrypi-kernel-headers\r\n\r\n#>>>>>>Install BCM2835 libraries\r\nwget http:\/\/www.airspayce.com\/mikem\/bcm2835\/bcm2835-1.68.tar.gz\r\ntar zxvf bcm2835-1.68.tar.gz \r\ncd bcm2835-1.68\/\r\nsudo .\/configure &amp;&amp; sudo make &amp;&amp; sudo make check &amp;&amp; sudo make install\r\n\r\n#>>>>>>>Install wiringPi libraries\r\n# Open the Raspberry Pi terminal and run the following command\r\nsudo apt-get install wiringpi\r\n# For Raspberry Pi systems after May 2019 (earlier than before, you may not need to execute), you may need to upgrade:\r\nwget https:\/\/project-downloads.drogon.net\/wiringpi-latest.deb\r\nsudo dpkg -i wiringpi-latest.deb\r\ngpio -v\r\n# Run gpio -v and version 2.52 will appear. If it does not appear, the installation is wrong\r\n\r\n#Bullseye branch system use the following command:\r\ngit clone https:\/\/github.com\/WiringPi\/WiringPi\r\ncd WiringPi\r\n.\/build\r\ngpio -v\r\n# Run gpio -v and version 2.60 will appear. If it does not appear, it means that there is an installation error\r\n\r\n\r\n#>>>>>>>Install Python libraries\r\n#Python2\r\nsudo apt-get update\r\nsudo apt-get install ttf-wqy-zenhei\r\nsudo apt-get install python-pip \r\nsudo pip install RPi.GPIO\r\nsudo pip install spidev\r\n#Python3\r\nsudo apt-get update\r\nsudo apt-get install ttf-wqy-zenhei\r\nsudo apt-get install python3-pip\r\nsudo pip3 install RPi.GPIO\r\nsudo pip3 install spidev\r\n\r\n\r\n\r\n#>>>1.3in LCD driver @ https:\/\/www.waveshare.com\/wiki\/1.3inch_LCD_HAT\r\n\r\ncd ~\r\nwget https:\/\/www.waveshare.com\/w\/upload\/f\/f9\/Waveshare_fbcp.7z\r\n7z x Waveshare_fbcp.7z -o.\/waveshare_fbcp\r\ncd waveshare_fbcp\r\n\r\n\r\ncmake -DSPI_BUS_CLOCK_DIVISOR=20 -DWAVESHARE_1INCH3_LCD_HAT=ON -DBACKLIGHT_CONTROL=ON -DSTATISTICS=0 \r\n\r\nmake -j\r\nsudo .\/fbcp\r\n\r\nsudo cp ~\/waveshare_fbcp\/fbcp \/usr\/local\/bin\/fbcp\r\nsudo nano \/etc\/rc.local\r\n\r\n\r\n>>------------------------rc.local--------------------------\r\n\r\n#!\/bin\/sh -e\r\n#\r\n# rc.local\r\n#\r\n# This script is executed at the end of each multiuser runlevel.\r\n# Make sure that the script will \"exit 0\" on success or any other\r\n# value on error.\r\n#\r\n# In order to enable or disable this script just change the execution\r\n# bits.\r\n#\r\n# By default this script does nothing.\r\n\r\nfbcp&amp;\r\n\r\nexit 0\r\n\r\n>>----------------------------------------------------------\r\n\r\n\r\nchmod +x \/etc\/rc.local\r\n\r\nsystemctl daemon-reload\r\nsystemctl start rc-local\r\nsystemctl status rc-local\r\n\r\n\r\n#------------\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b9\u30c6\u30fc\u30bf\u30b9\u304c\u51fa\u308b-----------------\r\n\u25cf rc-local.service - \/etc\/rc.local Compatibility\r\n     Loaded: loaded (\/lib\/systemd\/system\/rc-local.service; enabled-runtime; vendor preset: enabled)\r\n    Drop-In: \/usr\/lib\/systemd\/system\/rc-local.service.d\r\n             \u2514\u2500debian.conf\r\n     Active: active (exited)\r\n       Docs: man:systemd-rc-local-generator(8)\r\n    Process: 58756 ExecStart=\/etc\/rc.local start (code=exited, status=0\/SUCCESS)>>----------------------------------------------------------                                                  \r\n#--------------------------------------------------------\r\n\r\n#\u753b\u9762\u306e\u8a2d\u5b9a\r\nsudo nano \/boot\/config.txt\r\n\r\n#-------------config.txt\u306b\u4ee5\u4e0b\u8ffd\u8a18\u30fb\u4fee\u6b63-------------\r\nhdmi_force_hotplug=1\r\nhdmi_cvt=300 300 60 1 0 0 0\r\nhdmi_group=2\r\nhdmi_mode=87\r\ndisplay_rotate=0\r\n\r\n[pi4]\r\n#\u4ee5\u4e0b\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\r\n# Enable DRM VC4 V3D driver on top of the dispmanx display stack\r\n#dtoverlay=vc4-fkms-v3d\r\n#max_framebuffers=2\r\n#--------------------------------------------------\r\n\r\n\r\n#>>>>>>>>\u30b8\u30e7\u30a4\u30b9\u30c6\u30a3\u30c3\u30af\u3068\uff13\u30dc\u30bf\u30f3\u3092\u30de\u30a6\u30b9\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5834\u5408\r\n\r\n#python2\r\nsudo apt-get install python2\r\nsudo apt-get install python-xlib\r\nsudo pip install PyMouse\r\nwget https:\/\/www.waveshare.com\/w\/upload\/d\/d3\/Mouse.7z\r\n7z x Mouse.7z\r\nsudo python mouse.py\r\n#python3\r\nsudo apt-get install python3-xlib\r\nsudo pip3 install PyMouse\r\nsudo pip3 install unix\r\nsudo pip3 install PyUserInput\r\nwget http:\/\/www.waveshare.net\/w\/upload\/d\/d3\/Mouse.7z\r\n7z x Mouse.7z\r\nsudo python3 mouse.py\r\n\r\n#>>>>>>>>>\u30b8\u30e7\u30a4\u30b9\u30c6\u30a3\u30c3\u30af\u81ea\u52d5\u5b9f\u884c\u8a2d\u5b9a\uff1aDIETPI+LXDE\u306e\u5834\u5408\r\n#>>LXDE\u306f\u8d77\u52d5\u6642\u306b\u4ee5\u4e0b\u30d5\u30a9\u30eb\u30c0\u306eautostart\u8a18\u8f09\u306b\u5f93\u3063\u3066\u30a2\u30d7\u30ea\u3092\u81ea\u52d5\u5b9f\u884c\u3057\u307e\u3059\r\n#>>\u3088\u304f\u308f\u304b\u3063\u3066\u3044\u306a\u3044\u3053\u3068\uff1a\/USR\/LOCAL\/BIN\u6271\u3044\u306e.py\u30d5\u30a1\u30a4\u30eb\u3063\u3066\u3069\u3053\u306b\u7f6e\u304f\u306e\u304c\u6b63\u3057\u3044\u306e\u3060\u308d\u3046\u304b\r\ncp .\/mouse.py \/usr\/local\/mouse.py\r\n\r\ncd \/etc\/xdg\/lxsession\/LXDE\/\r\nsudo nano .\/autostart\r\n\r\n\r\n#--------------------\u4ee5\u4e0b\u3092\u8ffd\u8a18--------------------------\r\n\r\n@python3 \/usr\/local\/mouse.py\r\n\r\n#--------------------------------------------------------\r\n\r\n\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u304c\u305f\u304c\u305f\u8a00\u3063\u3066\u3082\u3057\u3087\u3046\u304c\u306a\u3044\u306e\u3067\u7d50\u8ad6\u3092\u6700\u521d\u306b\u8a00\u3046\u3068\u3001\u304b\u306a\u308a\u8efd\u91cf\u3067\u3059 \u25cf\u5c0e\u5165\u306b\u3064\u3044\u3066 \u25cfDIETPI\u3092\u5165\u308c\u308b\u610f\u5473\u5408\u3044 RaspberryPi ZERO (WH)\u3078\u306eGUI\u306e\u5c0e\u5165\u306e\u305f\u3081\u3067\u3059\u3002 \u3054\u5b58\u3058\u901a\u308a\u3001Raspberry  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/shinku.ddo.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/5076"}],"collection":[{"href":"http:\/\/shinku.ddo.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/shinku.ddo.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/shinku.ddo.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/shinku.ddo.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5076"}],"version-history":[{"count":5,"href":"http:\/\/shinku.ddo.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/5076\/revisions"}],"predecessor-version":[{"id":5085,"href":"http:\/\/shinku.ddo.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/5076\/revisions\/5085"}],"wp:attachment":[{"href":"http:\/\/shinku.ddo.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}