-
-
Save CLCL/96262a0878a92edee16e68246126e260 to your computer and use it in GitHub Desktop.
WaveShare 7.5inch e-Paper HAT(電子ペーパー)をとりあえずRaspberry Piで動かす(ネット接続直後から)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Timezoneの設定(GUI使わずコマンドにて) | |
sudo raspi-config nonint do_change_timezone Asia/Tokyo | |
# Raspberry PiのSPIを有効にする(GUI使わずコマンドにて) | |
sudo raspi-config nonint do_spi 0 | |
# 再起動 | |
sudo reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Pythonでe-paperを動かすのに必要なライブラリ、解凍用コマンドなど | |
# Raspbian stretch | |
#sudo apt-get -y install python-dev python-smbus python-imaging build-essential p7zip-full | |
# Raspbian buster | |
sudo apt-get -y install python-dev python-smbus python-imaging build-essential p7zip-full | |
# WaveShareサンプルプログラム実行に必要フォント | |
sudo apt-get -y install fonts-wqy-microhei | |
# WaveShareのサンプルをダウンロードして展開 | |
mkdir e-paper7 | |
cd e-paper7 | |
# curlだとリジェクトされるようになったのでwgetで | |
#curl -LO https://www.waveshare.com/w/upload/0/06/7.5inch-e-paper-hat-code.7z | |
wget https://www.waveshare.com/w/upload/0/06/7.5inch-e-paper-hat-code.7z | |
7z x 7.5inch-e-paper-hat-code.7z | |
# WaveShareのRaspberry Pi:Python用サンプルプログラムを実行 | |
cd RaspberryPi/python3/ | |
python3 main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Raspberry Pi起動直後にe-paperを表示させる | |
# 1. systemd用スクリプトの生成 | |
cat << EOL | sudo tee /etc/systemd/system/e-paper.service | |
[Unit] | |
Description = python e-paper script | |
After=multi-user.target | |
[Service] | |
Type=forking | |
ExecStart= /bin/bash -c 'sleep 15; cd /home/pi/e-paper7/RaspberryPi/python3/; /usr/bin/python3 main.py' | |
# sleepを入れないとRaspberry Pi Zeroなど低速機ではSPI初期化が間に合わず動作しない | |
User=pi | |
Group=pi | |
[Install] | |
WantedBy=multi-user.target | |
EOL | |
# 2. systemd用スクリプトの生成・有効化 | |
sudo chown pi:pi /etc/systemd/system/e-paper.service | |
sudo systemctl enable e-paper | |
# 3. 再起動 | |
sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment