From 0759546e7de6a96fda6a9a004e3f37fe2ddcb75a Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Mon, 15 Dec 2025 22:37:40 +0800 Subject: Etlas write-up. --- _site/feed.xml | 2 +- _site/posts.xml | 2 +- _site/projects/etlas/index.html | 78 +++++++++++++++++++++++++++++------------ _site/robots.txt | 2 +- _site/sitemap.xml | 30 ++++++++-------- 5 files changed, 74 insertions(+), 40 deletions(-) (limited to '_site') diff --git a/_site/feed.xml b/_site/feed.xml index 58ef809..00889b5 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1 +1 @@ -Jekyll2025-12-14T22:02:29+08:00/feed.xmlASCIIMX | BlogW. D. Sadeep MadurangeHow I manage Suckless software installations2025-11-30T00:00:00+08:002025-11-30T00:00:00+08:00/blog/suckless-softwareW. D. Sadeep MadurangeNeo4J A* search2025-09-14T00:00:00+08:002025-09-14T00:00:00+08:00/blog/neo4j-a-star-searchW. D. Sadeep MadurangeMOSFETs as electronic switches2025-06-22T00:00:00+08:002025-06-22T00:00:00+08:00/blog/mosfet-switchesW. D. Sadeep MadurangeHow to configure ATmega328P microcontrollers to run at 3.3V and 5V2025-04-10T00:00:00+08:002025-04-10T00:00:00+08:00/blog/arduino-unoW. D. Sadeep MadurangeHow to set up ATSAM3X8E microcontrollers for bare-metal programming in C2024-10-05T00:00:00+08:002024-10-05T00:00:00+08:00/blog/arduino-dueW. D. Sadeep Madurange \ No newline at end of file +Jekyll2025-12-15T22:35:43+08:00http://localhost:4000/feed.xmlASCIIMX | BlogW. D. Sadeep MadurangeHow I manage Suckless software installations2025-11-30T00:00:00+08:002025-11-30T00:00:00+08:00http://localhost:4000/blog/suckless-softwareW. D. Sadeep MadurangeNeo4J A* search2025-09-14T00:00:00+08:002025-09-14T00:00:00+08:00http://localhost:4000/blog/neo4j-a-star-searchW. D. Sadeep MadurangeMOSFETs as electronic switches2025-06-22T00:00:00+08:002025-06-22T00:00:00+08:00http://localhost:4000/blog/mosfet-switchesW. D. Sadeep MadurangeHow to configure ATmega328P microcontrollers to run at 3.3V and 5V2025-04-10T00:00:00+08:002025-04-10T00:00:00+08:00http://localhost:4000/blog/arduino-unoW. D. Sadeep MadurangeHow to set up ATSAM3X8E microcontrollers for bare-metal programming in C2024-10-05T00:00:00+08:002024-10-05T00:00:00+08:00http://localhost:4000/blog/arduino-dueW. D. Sadeep Madurange \ No newline at end of file diff --git a/_site/posts.xml b/_site/posts.xml index 386871a..4a92130 100644 --- a/_site/posts.xml +++ b/_site/posts.xml @@ -1 +1 @@ -Jekyll2025-12-14T22:02:29+08:00/posts.xmlASCIIMXW. D. Sadeep Madurange \ No newline at end of file +Jekyll2025-12-15T22:35:43+08:00http://localhost:4000/posts.xmlASCIIMXW. D. Sadeep Madurange \ No newline at end of file diff --git a/_site/projects/etlas/index.html b/_site/projects/etlas/index.html index f8f539f..6b2906b 100644 --- a/_site/projects/etlas/index.html +++ b/_site/projects/etlas/index.html @@ -44,9 +44,7 @@

ETLAS: E-PAPER DASHBOARD

05 SEPTEMBER 2024

-

Etlas is a news, stock market, and weather tracker powered by an ESP32 NodeMCU -D1, featuring a 7.5-inch Waveshare e-paper display and a -DHT22 sensor module.

+

Etlas is a weather, news, and stock price tracking system.

@@ -55,34 +53,70 @@ DHT22 sensor module.

-

The top left panel displays the end-of-day stock prices from the Polygon.io API, relayed through my own -FastCGI-wrapped Flask app hosted on a VPS. The stock symbols can be configured -through the Flask app’s application settings. The server.fcgi script enclosed -in the tarball at the end of the page contains the Flask app.

+

Acknowledgements

-

The following diagram outlines this system architecture.

+

The e-paper display driver in the epd.c file of the project is derived from Waveshare examples for Arduino +and STM32 platforms.

-

architecture

+

The exceptionally elegant algorithm in the file dht.c, which reads DHT22 sensor +data by comparing consecutive pulses, I ported directly from this implementation for ESP8266 +modules to my ESP32. All credit for the algorithm belongs to them.

+ +

Overview

-

Unlike my e-reader, which worked with raster images, -Etlas downloads time series data as CSV and computes the price curves on the -ESP32.

+

Etlas comprises an embedded system featuring an ESP32 NodeMCU D1 +microcontroller, a 7.5″ Waveshare e-paper display, a +DHT22 weather sensor, and a server backend consisting of a FastCGI-wrapped +Flask app. The following diagram outlines this system architecture.

+ +

architecture

-

The more prominent panel on the right of the e-paper display shows local -(Singapore) and world news from the Channel News Asia -RSS feed. The MCU downloads and parses XML data from the RSS feed directly -before rendering it to the display. Although I did it this way to avoid writing -server code, it limits the feeds from which Etlas can receive data. In a future -version, I will relay the RSS feed through a server (like the stock prices) to -make it more flexible.

+

The embedded application, written in C with the help of the ESP-IDF v5.2.1, +connects to a (2.4GHz) WiFi network at startup and obtains time from an NTP +server. It then composites and updates an internal pixel buffer using data +acquired from various data sources and renders to the screen by writing to its +Serial Peripheral Interface.

+ +

Price curves

+ +

On the e-paper display, the top-left panel displays end-of-day price curves +over two weeks from the Polygon.io API. The +microcontroller’s 512KB SRAM limits the price curves to two weeks. Instead of +using raster images for complex graphics—like e-paper projects often do—Etlas +computes the price curves from CSV data on the fly using the ESP32’s 160MHz +microprocessor. To avoid the overhead of floating-point arithmetic, all +computations are performed on integers. The gui_plot_stocks() function in the +gui.c file contains the rendering logic.

+ +

Proxying the price feeds through the Flask app permits me to configure the +tickers I’m interested in via its application settings. The Flask app cycles +through the tickers in its configuration file as it receives requests from the +embedded software. The Flask app is secured with basic authentication +implemented using htpasswd and OpenBSD’s httpd web server. This FastCGI-wrapped +architecture dramatically reduces the complexity of the server code and +increases system reliability.

+ +

News feed

+ +

The more prominent panel on the right displays news from Channel News Asia. The embedded program downloads +and parses the RSS feed before rendering it to the display. The character +glyphs used for rendering news are stored in header files in the sprites +directory as bitmaps. I created the glyphs manually by saving them as images in +GIMP and rasterizing them with ImageMagick.

+ +

I connected the embedded system directly to the RSS feed to write less server +code (the focus of this project was the embedded system). In hindsight, +however, it limits the feeds from which Etlas can receive data. In a future +version, I will relay the RSS feed through the backend (like the stock prices) +to make it more flexible.

+ +

Weather data

The bottom panels (middle and right) display the temperature and relative humidity from a DHT22 sensor. The DHT22 driver, arguably the most interesting part of the software, reads real-time sensor data by comparing relative pulse widths. The pulses themselves are too quick for the ESP32 to reliably measure -directly. I ported this -implementation for ESP8266 modules to my ESP32. All credit for the algorithm -belongs to them.

+directly.

Much of the heavy lifting of acquiring, interpreting, and rendering data from different data sources is performed on the microcontroller using less than 512 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 1b23cd3..5130d9f 100644 --- a/_site/sitemap.xml +++ b/_site/sitemap.xml @@ -1,59 +1,59 @@ -/blog/arduino-due/ +http://localhost:4000/blog/arduino-due/ 2024-10-05T00:00:00+08:00 -/blog/arduino-uno/ +http://localhost:4000/blog/arduino-uno/ 2025-04-10T00:00:00+08:00 -/blog/mosfet-switches/ +http://localhost:4000/blog/mosfet-switches/ 2025-06-22T00:00:00+08:00 -/blog/neo4j-a-star-search/ +http://localhost:4000/blog/neo4j-a-star-search/ 2025-09-14T00:00:00+08:00 -/blog/suckless-software/ +http://localhost:4000/blog/suckless-software/ 2025-11-30T00:00:00+08:00 -/projects/e-reader/ +http://localhost:4000/projects/e-reader/ 2023-10-24T00:00:00+08:00 -/projects/matrix-digital-rain/ +http://localhost:4000/projects/matrix-digital-rain/ 2024-01-12T00:00:00+08:00 -/projects/etlas/ +http://localhost:4000/projects/etlas/ 2024-09-05T00:00:00+08:00 -/projects/bumblebee/ +http://localhost:4000/projects/bumblebee/ 2025-04-02T00:00:00+08:00 -/projects/my-first-pcb/ +http://localhost:4000/projects/my-first-pcb/ 2025-07-14T00:00:00+08:00 -/projects/fpm-door-lock/ +http://localhost:4000/projects/fpm-door-lock/ 2025-10-03T00:00:00+08:00 -/about/ +http://localhost:4000/about/ -/blog/ +http://localhost:4000/blog/ -/ +http://localhost:4000/ -/projects/ +http://localhost:4000/projects/ -- cgit v1.2.3