This project is a web application designed to control a Scroll Phat HD screen on a Raspberry Pi. It is built using Flask and uses a simple user authentication system.
Before you begin, make sure you have Python installed on your Raspberry Pi. If not, you can install it by running the following command in the terminal:
sudo apt-get update
sudo apt-get install python3Next, navigate to where you want your file to be located, for example, documents:
cd /home/pi/documentsClone this repository:
git clone https://github.com/abstra208/phat-pi.gitNavigate to the project directory:
cd phat-piInstall the required dependencies:
pip install -r requirements.txtYou will also need to install the Scroll Phat HD screen API:
curl https://get.pimoroni.com/scrollphathd | bashYou do not need to do a full install, but you still can if you want
The Scroll Phat HD screen API must only be run on a Raspberry Pi using the official OS (with or without the graphic interface)
Before using, change the string app.secret_key in app.py to something else.
This is to keep the saved session saved securely
If you don't have a long string in your head, you can always run python -c 'import secrets; print(secrets.token_hex())' to get a random string using python
Run in a development server:
./dev.shRunning the app in a development server can be useful to try the app, but not to have it always running
This will always run the app on http://localhost:5000
Run using Gunicorn:
./run.shUsing the Gunicorn app, on the other hand, is made to always run on a server or, in our case, on a Raspberry Pi
This will always run the app on http://localhost:8000.
To stop the app, press ctrl + c when the terminal is focused
- Users login and logout
- Users management (Coming soon)
- Control your Scroll Phat HD screen from anywhere on your network
- Using a Gunicorn server for an always-running server, or a development server for testing purposes
.
├── __pycache__/ / Include the crash and logs
├── .github/ / Include the license and funding files
├── app.py / The app
├── README.md / Read this file before using
├── requirements.txt / The requirements for this project to work
├── run.sh / To run the project using Gunicorn
├── dev.sh / To run the project on a development server
├── screen.json / The saved screen information to show
├── users.json / The user's information to login
├── screen.py / The code to show the text on the screen
├── static/
│ ├── img/ / Contain image used in this project
│ ├── users/ / Contain the user's images
│ ├── style.css / The style sheet for the two html page
│ └── script.js / The javascript for the two html page
└── templates/
├── index.html / The main page
└── login.html / The page to login
Contributing:
Contributions are always welcome! Create a pull request or donate. See FUNDING for more information.
License:
It is distributed under the MIT License. See LICENSE for more information.
Contact:
Ludovic Morin (Owner) - ludovicmorin357@hotmail.com
Project Link:
- Phat Pi (Owner: Ludovic Morin)
- Scroll Phat HD (Owner: Pimoroni Ltd)