This project provides a Flask-based server to interact with an e-ink display. It allows for displaying images, text, weather updates, and more on an e-ink screen. Requires OPEN_WEATHER_API environment variable to be set, https://openweathermap.org/
- Display Images: Load and display images on the e-ink display.
- Text Rendering: Render text with customizable position, size, and color.
- Weather Updates: Fetch and display weather forecasts, icon tables here: https://openweathermap.org/weather-conditions#Icon-list
- RESTful API: Easily interact with the display using HTTP requests.
- Clear Display: Reset and clear the display content.
-
Clone the repository:
git clone https://github.com/dazemc/ink_manager.git cd ink_manager
-
Install dependencies:
pip install -r requirements.txt
-
Set up the e-ink display:
- Ensure the e-ink display drivers and libraries are properly installed. The exact setup depends on your specific e-ink hardware.
-
Run the server:
python app.py
- Flask: For building the web server.
- Flask-CORS: To handle Cross-Origin Resource Sharing.
- Pillow: For image manipulation.
- Ink Display Library: Custom library for interacting with the e-ink display.
- WeatherData: Custom library for fetching and rendering weather data.
- Description: Test endpoint to display a series of images and text on the e-ink display.
- Returns:
"Success"
if the operation completes.
- Description: Display text on the e-ink display.
- Query Parameters:
text
(str): Text to display.color
(str): Text color in hexadecimal format (e.g.,FF0000
for red).pos
(str): Position asx,y
coordinates (e.g.,10,20
).size
(int): Font size.center
(str): Center the text if"true"
.
- Returns:
"Success"
if the operation completes.
- Description: Display the current drawing on the e-ink display.
- Returns:
"Success"
if the operation completes.
- Description: Reset the display and create a new blank image.
- Returns:
"Success"
if the operation completes.
- GET: Display a test image.
- POST: Upload and display an image from the request.
- Returns:
"Success"
if the operation completes.
- Description: Fetch the latest weather data and display it on the e-ink screen.
- Returns:
"Success"
if the operation completes.
- Description: Clear the e-ink display.
- Query Parameters:
sleep
(bool): Put the display to sleep iftrue
.
- Returns:
"Success"
if the operation completes.
DEBUG
: Set toTrue
for verbose logging,False
for minimal output.
app.py
: Main application file.assets/
: Directory for images and fonts.images/
: Contains test and uploaded images.tools/forecast_builder/
: Contains weather data tools.
Logs are generated to help trace the execution flow and debug issues. These logs can be found in the console output where the server is running.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request.