Repurposed the e-reader for regular use as a news tracker.
![]() |
![]() |
![]() |
|
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: DHT22’s 26µs/50µs/70µs pulses are too fast for the ESP32 standard APIs. Ported the following bit banging routine from ESP8266:
static inline int dht_await_pin_state(int state, int timeout)
{
int t;
static const uint16_t delta = 1;
for (t = 0; t < timeout; t += delta) {
ets_delay_us(delta);
if (gpio_get_level(DHT_PIN) == state)
return t;
}
return 0;
}
static inline int dht_get_raw_data(unsigned char buf[BUFLEN])
{
for (i = 0; i < BUFLEN; i++) {
if (!(pwl = dht_await_pin_state(1, 50))) {
rc = 4;
xQueueSend(dht_evt_queue, &rc, (TickType_t) 0);
return 0;
}
if (!(pwh = dht_await_pin_state(0, 70))) {
rc = 5;
xQueueSend(dht_evt_queue, &rc, (TickType_t) 0);
return 0;
}
buf[i] = pwh > pwl;
}
return 1;
}
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: 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. 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: a92c86a.


