Skip to content

Add ESP32 Wi-Fi thin-client port for InkyPi#1

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/evaluate-porting-esp-wifi
Draft

Add ESP32 Wi-Fi thin-client port for InkyPi#1
Copilot wants to merge 2 commits into
mainfrom
copilot/evaluate-porting-esp-wifi

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 24, 2026

InkyPi's full Python stack (Flask, Pillow, plugin system) cannot run on an ESP32's ~520 KB RAM. The practical solution is a thin-client model: the Pi handles all rendering/scheduling, and the ESP32 polls for the current image and drives the e-paper display over SPI.

ESP32 MicroPython port (esp32/)

  • boot.py – connects to Wi-Fi (STA); falls back to AP mode (InkyPi-ESP32) for first-time config
  • wifi_manager.py – STA/AP helpers
  • config_manager.py – persists config.json on flash filesystem
  • epaper_display.py – SPI driver for SSD1680/UC8176 BW controllers; supports Waveshare epd2in13v2 (250×122), epd2in9v2 (296×128), epd4in2 (400×300)
  • http_server.py – single-threaded HTTP server: HTML config UI + POST /display for direct image push
  • main.py – polling loop (fetches /api/esp32/image_data at configured interval) + starts HTTP server thread
  • example_config.json / README.md – wiring guide, flash instructions, config reference

Pi-side endpoint (src/blueprints/main.py)

New GET /api/esp32/image_data endpoint: loads the current display image, resizes and dithers to 1-bit monochrome at the target display dimensions, and streams raw packed bytes the ESP32 can push directly to the controller.

GET /api/esp32/image_data?display_type=epd2in13v2
→ 200 application/octet-stream
   X-Width: 250
   X-Height: 122
   <3,813 bytes, 1-bit/px row-major MSB-first>

Accepts display_type (derives dimensions automatically) or explicit width/height for unlisted displays.

Tests (tests/test_esp32_endpoint.py)

8 tests covering: 404 with no image, 400 with missing params, correct byte length and header values for all three display types, explicit dimensions, pixel correctness on a white image, and Cache-Control: no-cache.

Original prompt

Evaluate how this repository contains code that also works on an ESP with Wi-Fi can it be ported


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] Evaluate code for compatibility with ESP Wi-Fi Add ESP32 Wi-Fi thin-client port for InkyPi Mar 24, 2026
Copilot AI requested a review from BaloMueller March 24, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants