From a8d7508006db8309550755a72719de83bde3cdd9 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Fri, 5 Jun 2026 21:00:02 +0800 Subject: Improve writing. --- _log/etlas.md | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) (limited to '_log/etlas.md') diff --git a/_log/etlas.md b/_log/etlas.md index 9f09322..d0ff35d 100644 --- a/_log/etlas.md +++ b/_log/etlas.md @@ -6,8 +6,7 @@ project: true thumbnail: thumb_sm.jpg --- -Repurposed the [e-reader](../e-reader/) for regular use as a news, stocks, and -weather dashboard. +Repurposed the [e-reader](../e-reader/) for regular use as a news tracker. @@ -19,14 +18,13 @@ weather dashboard.
-Swapped out the ESP-32-WROOM for an ESP32 NodeMCU D1—smaller, better form +Swapped out the ESP-WROOM-32 for an ESP32 NodeMCU D1—smaller, better form factor. Connected a DHT22 sensor for temperature and humidity data. -Weather: 26µs/50µs/70µs pulses from the DHT22's single-wire protocol are too -fast for ESP32 standard APIs. Ported this clever bit-banging from -ESP8266 to ESP32: +target="_blank" rel="noopener noreferrer">routine from ESP8266: ``` static inline int dht_await_pin_state(int state, int timeout) @@ -44,8 +42,6 @@ static inline int dht_await_pin_state(int state, int timeout) static inline int dht_get_raw_data(unsigned char buf[BUFLEN]) { - /* init code and preamble */ - for (i = 0; i < BUFLEN; i++) { if (!(pwl = dht_await_pin_state(1, 50))) { rc = 4; @@ -63,23 +59,17 @@ static inline int dht_get_raw_data(unsigned char buf[BUFLEN]) } ``` -Stocks: Obtained two weeks EOD data from Polygon.io—maximum possible with 512 -KB RAM. Deployed a simple Flask API on VPS to manage the watchlist and relay -the feed. Wrapped the API in FastCGI and exposed it through chroot-ed -htpasswd + slowcgi + httpd—battle-tested OpenBSD base-system tools. - -Custom stepped graph works but the code is crude. vTaskDelay() is needed to -keep the watchdog timer from triggering—revisit with Bresenham's line -algorithm. +Stocks: Two weeks' EOD data from Polygon.io—maximum possible with 512 KB RAM. +Flask API on a VPS manages the watchlist, relays the feed. The API is exposed +via chroot-ed htpasswd + slowcgi + httpd. -News: Used Channel NewsAsia RSS feed for news. Hand-coded the XML parsing in -C—no Flask backend at the time. Now that I have one for stocks, will move the -feed through the Flask backend in the next revision. +News: Channel NewsAsia RSS feed. Parsed XML on the MCU as there was no Flask +backend at the time. Now that I have one for stocks, moving it through the +backend in the next revision. -epd_init() stalled intermittently on first refresh() after flash. Toggling -delay values in refresh() resolved it. If the first refresh succeeded, system -remained stable. Could not find the root cause. Suspect noisy supply due to -powering display via MCU. +epd_init() stalled intermittently on first refresh() after flash. If the first +refresh succeeded, the system remained stable. Could not find the root cause. +Suspect noisy supply caused by powering the display via the MCU. Commit: