Raspberry Pi: 4.2 inch ink screen

Two months ago, a brother from the Finance Department knew that I was playing with the Raspberry Pi, said that he wanted to make a desk calendar with weather forecast, and gave a link to a god. The technology stack of Helpless God is not in the same direction as me. After studying one, I didn't get it done in the end, so I decided to do it again according to my ideas. This time it was almost done, but in the end it was lost to the interface that was charged (I thought it could be used for free for a while, haha).

 

I'm really sorry for that brother. Anyone who has a free and stable weather forecast interface that can be used for a long time is also recommended.

==========

However, this screen is not reconciled. A few days ago, I taught my baby how to recognize words, and found that some of her words were still confused, but I was too lazy to find related words from a pile of cards every time for her to practice. Also used? The ink screen is relatively eye-protecting, and it is also good to be a learning machine.

Then start working on the Raspberry Pi. Confirm that SPI is enabled.

Example download path: http://www.waveshare.net/wiki/4.2inch_e-Paper_Module

Unzip the downloaded sample program package. Go to the directory of the Raspberry Pi.

sudo python3 setup.py install

Edit./lib/waveshare_epd/epdconfig.py

Find the definition of class RaspberryPi (this definition is also the wiring guide):
change RST_PIN = 17 to 9

Of course you don't need to change it, but the reset of the ink screen should be connected to the physical pin 11 when wiring. I connected all the cables in the same area for compactness (refer to the 2.9-inch screen user note I sent earlier  https://blog.csdn.net/ki1381/article/details/89929279 ), so I changed to use Physical pin 21 (GPIO 9).

Enter the examples directory and refer to the epd_4in2_test.py code. I simplified the sample code to only display text, and used sys.argv, so that the content displayed on the ink screen is determined by the script parameters.

Then make a webpage, very simple, put a form, which contains a text box and a submit button, the post action is show.php. The latter directly calls the above ink screen to display the py script, and the parameters come from the text box on the web page $ _POST ["text box name"].

For the sake of simplicity, no consideration is given to security issues. There may be permission problems, please refer to the problem encountered when calling the camera with php: https://blog.csdn.net/ki1381/article/details/79229289

 

Published 122 original articles · Like 61 · Visits 530,000+

Guess you like

Origin blog.csdn.net/ki1381/article/details/103034137