1.2 KiB
1.2 KiB
HTTP server
Runs an HTTP server that will draw images on the screen.
Useful for setting up a small digital frame that can be remotely controlled.
Config
- In
main/server.h, editWIFI_SSIDandWIFI_PASSWORDto match your wifi config - In
main/main.c, editn_epd_setupto refer to the right EPD screen
Running
flash (idf.py flash), then connect the EPDiy to a power source (computer is fine).
The endpoints are:
GET /, prints the screen temp / height / width as headersPOST /clear, clears the screenPOST /draw, expects:- a body that is a binary stream already encoded to EPDiy's standards (like the one in
dragon.h). - Headers
width,height - Optional headers
x,y(default to 0) - Optional header
clear, if set to nonzero integer will force-clear the screen before drawing
- a body that is a binary stream already encoded to EPDiy's standards (like the one in
Helper script
send_image.py is a friendlier client.
$ ./send_image.py ESP_IP info
EpdInfo(width=1024, height=768, temperature=20)
$ ./send_image.py ESP_IP clear
# Clears the screen
$ ./send_image.y ESP_IP draw /tmp/spooder-man.png
# Draws on screen
Thanks to argparse, all arguments are visible with --help.
Requires requests and PIL (or Pillow)