Template: Raspberry Pi Guides for 4.37 e-Paper

From Waveshare Wiki
Jump to: navigation, search

Working With Raspberry Pi

Hardware Connection

When connecting the Raspberry Pi, you can directly insert the board into the 40PIN pin header of the Raspberry Pi, and pay attention to the correct pins.
If you choose to connect with an 8PIN cable, please refer to the pin correspondence table below:

Raspberry Pi Pinout
e-Paper Raspberry Pi
BCM2835 Board
VCC 3.3V 3.3V
GND GND GND
DIN MOSI 19
CLK SCLK 23
CS CE0 24
DC 25 22
RST 17 11
BUSY 24 18

Enable SPI Interface

  • Open the Raspberry Pi terminal and enter the following command in the config interface:
sudo raspi-config
Choose Interfacing Options -> SPI -> Yes Enable SPI interface

RPI open spi.png
Then reboot your Raspberry Pi:

sudo reboot
  • Check /boot/config.txt, and you can see 'dtparam=spi=on' was written in.

Raspberry Pi Guides for 4.37 e-Paper.jpg

  • To make sure SPI is not occupied, it is recommended to close other drivers' coverage. You can use ls /dev/spi* to check whether SPI is occupied. If the terminal outputs /dev/spidev0.1 and /dev/spidev0.1, SPI is not occupied.

Raspberry Pi Guides for 4.37 e-Paper02.jpg

C

  • Install BCM2835
#Open the Raspberry Pi terminal and run the following command
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
tar zxvf bcm2835-1.71.tar.gz
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
# For more information, please refer to the official website: http://www.airspayce.com/mikem/bcm2835/
  • Install WiringPi (Optional)
#Open the Raspberry Pi terminal and run the following command:
sudo apt-get install wiringpi
#For Raspberry Pi systems after May 2019 (earlier than before, you may not need to execute), you may need to upgrade:
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
#Run gpio -v and version 2.52 will appear. If it does not appear, the installation is wrong.

#Bullseye branch system use the following command:
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
./build
gpio -v
# Run gpio -v and version 2.60 will appear. If it does not appear, it means that there is an installation error.
  • Download demo (You can skip this step if you have downloaded it.)
sudo apt-get install p7zip-full
wget  https://files.waveshare.com/upload/3/39/E-Paper_code.7z
7z x E-Paper_code.7z -O./e-Paper
cd e-Paper/RaspberryPi_JetsonNano/
  • Download the program via GitHub (alternate method, already downloaded can be skipped)
git clone https://github.com/waveshare/e-Paper.git
cd e-Paper/RaspberryPi_JetsonNano/
  • Compile the program (Note: -j4 is to compile with 4 threads, the numbers can be modified by yourself; EPD=epd5in83bV2 is to specify a macro definition, and epd5in83bV2 corresponds to the test program in the main function).
# Now at e-Paper/RaspberryPi_JetsonNano
cd c
sudo make clean
sudo make -j4 EPD=epd5in83bV2
  • Run the program
sudo ./epd

Python

  • Install the function library
sudo apt-get update
sudo apt-get install python3-pip
sudo apt-get install python3-pil
sudo apt-get install python3-numpy
sudo pip3 install RPi.GPIO
sudo pip3 install spidev
  • Install function library (python2)
sudo apt-get update
sudo apt-get install python-pip
sudo apt-get install python-pil
sudo apt-get install python-numpy
sudo pip install RPi.GPIO
sudo pip install spidev
  • Download demo (You can skip this step if you have downloaded it.)
sudo apt-get install p7zip-full
wget  https://files.waveshare.com/upload/3/39/E-Paper_code.7z
7z x E-Paper_code.7z -O./e-Paper
cd e-Paper/RaspberryPi_JetsonNano/
  • Download the program via GitHub (alternate method, already downloaded can be skipped.)
git clone https://github.com/waveshare/e-Paper.git
cd e-Paper/RaspberryPi_JetsonNano/
  • Run the program
# Make sure it's in e-Paper/RaspberryPi_JetsonNano/
cd python/examples/
python3 epd_7in5_V2_test.py