Add HTTP server

This commit is contained in:
arne 2025-10-05 10:27:36 +02:00
commit 8bd9a9b1d0
7 changed files with 206 additions and 8 deletions

View file

@ -2,6 +2,19 @@
This repository contains the sources required to run the Inkpot frontend on a Lilygo T5, an ESP32 equipped with an e-ink display. It allows you to create Lua sketches that draw on the e-ink screen.
You need to give it a 2.4Ghz Wifi SSID and password by adjusting `main/settings.h`. After that it will start an HTTP server that you can use to interact with the device. The HTTP server has two endpoints:
- `GET /` -- Hello world page to confirm that things are working
- `POST /draw` -- Accepts a Lua POST body and will execute the script
You can send scripts like this:
``` bash
cat foo.lua | curl -X POST --data-binary @- 10.0.0.100/draw
```
The IP address of the display is logged to its serial output and can be read via `idf.py monitor` (see below).
## Prerequisites
There is a `flake.nix` at the root of this repository that defines a development environment with all required tools. If you are using `direnv`, `cd` into the repositorie's root directory after cloning it and run `direnv allow`. If you aren't using direnv the enviroment can be activated using `nix develop .`.