From 577aa865c2f53a46a5869b1e4dda69dc06d0a962 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Mon, 5 Jan 2026 12:17:09 +0800 Subject: Tighten e-reader prose. --- _site/feed.xml | 2 +- _site/index.html | 2 +- _site/log/e-reader/index.html | 72 +++++++++++++++++++------------------------ _site/posts.xml | 2 +- _site/projects/index.html | 4 +-- _site/robots.txt | 2 +- _site/sitemap.xml | 28 ++++++++--------- 7 files changed, 51 insertions(+), 61 deletions(-) (limited to '_site') diff --git a/_site/feed.xml b/_site/feed.xml index 989f4b2..93d691d 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1 +1 @@ -Jekyll2026-01-04T22:36:11+08:00/feed.xmlASCIIMX | LogW. D. Sadeep MadurangeSearch engine (Perl + FastCGI + SA)2026-01-03T00:00:00+08:002026-01-03T00:00:00+08:00/log/site-searchW. D. Sadeep MadurangeMatrix Rain: 2025 refactor2025-12-21T00:00:00+08:002025-12-21T00:00:00+08:00/log/matrix-digital-rainW. D. Sadeep MadurangeFingerprint door lock (LP)2025-08-18T00:00:00+08:002025-08-18T00:00:00+08:00/log/fpm-door-lock-lpW. D. Sadeep MadurangeHigh-side MOSFET switching2025-06-22T00:00:00+08:002025-06-22T00:00:00+08:00/log/mosfet-switchesW. D. Sadeep MadurangeATmega328P at 3.3V and 5V2025-06-10T00:00:00+08:002025-06-10T00:00:00+08:00/log/arduino-unoW. D. Sadeep MadurangeFingerprint door lock (RF)2025-06-05T00:00:00+08:002025-06-05T00:00:00+08:00/log/fpm-door-lock-rfW. D. Sadeep MadurangeBumblebee: browser automation2025-04-02T00:00:00+08:002025-04-02T00:00:00+08:00/log/bumblebeeW. D. Sadeep MadurangeBare-metal ATSAM3X8E2024-09-16T00:00:00+08:002024-09-16T00:00:00+08:00/log/arduino-dueW. D. Sadeep MadurangeEtlas: e-paper dashboard2024-09-05T00:00:00+08:002024-09-05T00:00:00+08:00/log/etlasW. D. Sadeep MadurangeESP32 e-reader prototype2023-10-24T00:00:00+08:002023-10-24T00:00:00+08:00/log/e-readerW. D. Sadeep Madurange \ No newline at end of file +Jekyll2026-01-05T12:16:46+08:00http://localhost:4000/feed.xmlASCIIMX | LogW. D. Sadeep MadurangeSearch engine (Perl + FastCGI + SA)2026-01-03T00:00:00+08:002026-01-03T00:00:00+08:00http://localhost:4000/log/site-searchW. D. Sadeep MadurangeMatrix Rain: 2025 refactor2025-12-21T00:00:00+08:002025-12-21T00:00:00+08:00http://localhost:4000/log/matrix-digital-rainW. D. Sadeep MadurangeFingerprint door lock (LP)2025-08-18T00:00:00+08:002025-08-18T00:00:00+08:00http://localhost:4000/log/fpm-door-lock-lpW. D. Sadeep MadurangeHigh-side MOSFET switching2025-06-22T00:00:00+08:002025-06-22T00:00:00+08:00http://localhost:4000/log/mosfet-switchesW. D. Sadeep MadurangeATmega328P at 3.3V and 5V2025-06-10T00:00:00+08:002025-06-10T00:00:00+08:00http://localhost:4000/log/arduino-unoW. D. Sadeep MadurangeFingerprint door lock (RF)2025-06-05T00:00:00+08:002025-06-05T00:00:00+08:00http://localhost:4000/log/fpm-door-lock-rfW. D. Sadeep MadurangeBumblebee: browser automation2025-04-02T00:00:00+08:002025-04-02T00:00:00+08:00http://localhost:4000/log/bumblebeeW. D. Sadeep MadurangeBare-metal ATSAM3X8E2024-09-16T00:00:00+08:002024-09-16T00:00:00+08:00http://localhost:4000/log/arduino-dueW. D. Sadeep MadurangeEtlas: e-paper dashboard2024-09-05T00:00:00+08:002024-09-05T00:00:00+08:00http://localhost:4000/log/etlasW. D. Sadeep MadurangeESP32 prototype e-reader2023-10-24T00:00:00+08:002023-10-24T00:00:00+08:00http://localhost:4000/log/e-readerW. D. Sadeep Madurange \ No newline at end of file diff --git a/_site/index.html b/_site/index.html index ef782ee..cce84be 100644 --- a/_site/index.html +++ b/_site/index.html @@ -175,7 +175,7 @@ - ESP32 e-reader prototype + ESP32 prototype e-reader diff --git a/_site/log/e-reader/index.html b/_site/log/e-reader/index.html index a5dbc01..41f58ff 100644 --- a/_site/log/e-reader/index.html +++ b/_site/log/e-reader/index.html @@ -3,7 +3,7 @@ - ESP32 e-reader prototype + ESP32 prototype e-reader @@ -37,7 +37,7 @@
-

ESP32 E-READER PROTOTYPE

+

ESP32 PROTOTYPE E-READER

24 OCTOBER 2023

First project with e-paper displays and ESP32.

@@ -46,61 +46,51 @@ -

System: ESP-WROOM-32, 7.5” Waveshare e-paper display, three buttons +

ESP-WROOM-32, 7.5” Waveshare e-paper display, three-button interface (prev/next/sleep).

-

2023-09-23: 512KB SRAM, 4MB flash (shared with FreeRTOS and ESP-IDF). Not -enough storage for books. Using ESP32’s built-in WiFi to stream them over HTTP. -Recording the reading progress in RTC memory.

+

Memory: 512KB SRAM + 4MB flash–insufficient for local library. Streams via +HTTP Range requests over WiFi. Reading progress saved to RTC memory; persists +through deep sleep.

-

Rasterized pages encoded as tightly packed bitmaps (1 byte => 8 pixels), no -headers, arranged along 48 KB (480x800) boundaries; Reader can stream pages -using HTTP Range requests with zero server-side logic. Keeps both ends lean.

+

EBM format: Raw bitmap sequence. 1 byte = 8 pixels, 1 page = 48 KB (display +resolution), headerless. Optimized for HTTP Range requests:

-

Page table stores 3 pages (prev/current/next) in a circular buffer. When the -user requests a page, program cycles through the table, updates the screen, and -downloads the next page.

+
int r0 = ((page_n - 1) * PAGE_SIZE);
+int rn = page_n * PAGE_SIZE - 1;
 
-

Responsiveness is inadequate. Scheduling GPIO (user input), SPI, and HTTP on -one core causes input lag. Pinned the GPIO and SPI tasks to one core, the HTTP -task to the other core.

+int n = snprintf(NULL, 0, "bytes=%d-%d", r0, rn) + 1; +char *buf = malloc(sizeof(char) * n); +snprintf(buf, n, "bytes=%d-%d", r0, rn); -

Better, but screen updates are blocking user input; Made SPI transfer async:

- -
void epd_draw_async(const uint8_t *buf, size_t n)
-{
-    static spi_transaction_t t[3];
+esp_http_client_set_header(http_client, "Range", buf);
+esp_http_client_perform(http_client);
+
- memset(&t[0], 0, sizeof(t[0])); - t[0].length = 8; - t[0].tx_data[0] = 0x13; - t[0].user = (void*) 0; - t[0].flags = SPI_TRANS_USE_TXDATA; +

Page buffer: Three pages (prev/current/next) in RAM—maximum possible. On +request: cycles buffer, updates screen, prefetches next page.

- memset(&t[1], 0, sizeof(t[1])); - t[1].length = 8 * n; - t[1].tx_buffer = buf; - t[1].user = (void*) 1; +
c_page_num++;
+pg.page_num = c_page_num + 2;
+pg.page_buf = pages[(c_page_num + 1) % PAGE_LEN];
 
-    memset(&t[2], 0, sizeof(t[2])); 
-    t[2].length = 8;
-    t[2].tx_data[0] = 0x12;
-    t[2].user = (void*) 0; 
-    t[2].flags = SPI_TRANS_USE_TXDATA;
+xSemaphoreGive(mutex);
+xQueueSend(http_evt_queue, &pg, portMAX_DELAY);
 
-    for (int i = 0; i < 3; i++)
-        spi_device_queue_trans(spi, &t[i], portMAX_DELAY);
-}
+epd_draw_async(pages[c_page_num % PAGE_LEN], PAGE_SIZE);
+epd_draw_await();
 
-

Much better.

+

Responsiveness: inadequate. Scheduling GPIO, SPI, and HTTP tasks on a single +thread causes input lag. Pinned GPIO/SPI tasks to one core and the HTTP task to +the other.

-

2023-10-06: Moved the page table to DMA-capable memory; Reclaimed a few more -CPU cycles from the SPI transfers.

+

Better, but screen updates block user input. Moved SPI buffers to DMA and made +transfers async. Few more cycles saved.

Can’t think of anything else.

-

Verdict: Works but limited. Led to Etlas.

+

Verdict: Functional but limited. Led to Etlas.

Commit: 7f691c4

diff --git a/_site/posts.xml b/_site/posts.xml index 47d8e4d..97210e4 100644 --- a/_site/posts.xml +++ b/_site/posts.xml @@ -1 +1 @@ -Jekyll2026-01-04T22:36:11+08:00/posts.xmlASCIIMXW. D. Sadeep Madurange \ No newline at end of file +Jekyll2026-01-05T12:16:46+08:00http://localhost:4000/posts.xmlASCIIMXW. D. Sadeep Madurange \ No newline at end of file diff --git a/_site/projects/index.html b/_site/projects/index.html index 6bffe61..6e6c5be 100644 --- a/_site/projects/index.html +++ b/_site/projects/index.html @@ -103,8 +103,8 @@ - ESP32 e-reader prototype -
ESP32 e-reader prototype
+ ESP32 prototype e-reader +
ESP32 prototype e-reader
diff --git a/_site/robots.txt b/_site/robots.txt index e087884..d297064 100644 --- a/_site/robots.txt +++ b/_site/robots.txt @@ -1 +1 @@ -Sitemap: /sitemap.xml +Sitemap: http://localhost:4000/sitemap.xml diff --git a/_site/sitemap.xml b/_site/sitemap.xml index ad3bdcd..a722c6a 100644 --- a/_site/sitemap.xml +++ b/_site/sitemap.xml @@ -1,56 +1,56 @@ -/log/neo4j-a-star-search/ +http://localhost:4000/log/neo4j-a-star-search/ 2018-03-06T00:00:00+08:00 -/log/e-reader/ +http://localhost:4000/log/e-reader/ 2023-10-24T00:00:00+08:00 -/log/etlas/ +http://localhost:4000/log/etlas/ 2024-09-05T00:00:00+08:00 -/log/arduino-due/ +http://localhost:4000/log/arduino-due/ 2024-09-16T00:00:00+08:00 -/log/bumblebee/ +http://localhost:4000/log/bumblebee/ 2025-04-02T00:00:00+08:00 -/log/fpm-door-lock-rf/ +http://localhost:4000/log/fpm-door-lock-rf/ 2025-06-05T00:00:00+08:00 -/log/arduino-uno/ +http://localhost:4000/log/arduino-uno/ 2025-06-10T00:00:00+08:00 -/log/mosfet-switches/ +http://localhost:4000/log/mosfet-switches/ 2025-06-22T00:00:00+08:00 -/log/fpm-door-lock-lp/ +http://localhost:4000/log/fpm-door-lock-lp/ 2025-08-18T00:00:00+08:00 -/log/matrix-digital-rain/ +http://localhost:4000/log/matrix-digital-rain/ 2025-12-21T00:00:00+08:00 -/log/site-search/ +http://localhost:4000/log/site-search/ 2026-01-03T00:00:00+08:00 -/about/ +http://localhost:4000/about/ -/ +http://localhost:4000/ -/projects/ +http://localhost:4000/projects/ -- cgit v1.2.3