From e15f1076b59e997108914f6a5b9b28652d323268 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sat, 20 Dec 2025 21:36:45 +0800 Subject: Change website structure to a log. --- _site/log/etlas/circuit.svg | 105 ++++++++++++++++++++++++++ _site/log/etlas/dash.jpg | Bin 0 -> 85874 bytes _site/log/etlas/etlas_arch.png | Bin 0 -> 47732 bytes _site/log/etlas/index.html | 166 +++++++++++++++++++++++++++++++++++++++++ _site/log/etlas/pcb.jpg | Bin 0 -> 75769 bytes _site/log/etlas/schematic.svg | 4 + _site/log/etlas/source.tar.gz | Bin 0 -> 46871 bytes _site/log/etlas/thumb_sm.jpg | Bin 0 -> 55678 bytes 8 files changed, 275 insertions(+) create mode 100644 _site/log/etlas/circuit.svg create mode 100644 _site/log/etlas/dash.jpg create mode 100644 _site/log/etlas/etlas_arch.png create mode 100644 _site/log/etlas/index.html create mode 100644 _site/log/etlas/pcb.jpg create mode 100644 _site/log/etlas/schematic.svg create mode 100644 _site/log/etlas/source.tar.gz create mode 100644 _site/log/etlas/thumb_sm.jpg (limited to '_site/log/etlas') diff --git a/_site/log/etlas/circuit.svg b/_site/log/etlas/circuit.svg new file mode 100644 index 0000000..6255045 --- /dev/null +++ b/_site/log/etlas/circuit.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + AM2302 + + + DATA + + GND + + VCC + E-Paper display HAT + + + CS + + DC + + DIN + + CLK + + BUSY + + RST + + PWR + + GND + + VCC + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + + + + + 1 + 2 + 3 + 4 + + ESP32 Mini NodeMCU D1 + + IO19 + + + IO15 + + + GND + + + IO27 + + + IO14 + + + IO13 + + + IO25 + + + IO26 + + + IO16 + + + GND + + + 3V3 + + + \ No newline at end of file diff --git a/_site/log/etlas/dash.jpg b/_site/log/etlas/dash.jpg new file mode 100644 index 0000000..cf4efc6 Binary files /dev/null and b/_site/log/etlas/dash.jpg differ diff --git a/_site/log/etlas/etlas_arch.png b/_site/log/etlas/etlas_arch.png new file mode 100644 index 0000000..241e9f1 Binary files /dev/null and b/_site/log/etlas/etlas_arch.png differ diff --git a/_site/log/etlas/index.html b/_site/log/etlas/index.html new file mode 100644 index 0000000..e4a4a9e --- /dev/null +++ b/_site/log/etlas/index.html @@ -0,0 +1,166 @@ + + + + + Etlas: e-paper dashboard + + + + + Etlas: e-paper dashboard + + + + + + + + + + + + + +
+
+
+

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.

+ + + + + + +
frontback
+ +

The top-left panel shows two weeks of end-of-day prices—the maximum the ESP32’s +SRAM can hold—from the Polygon.io API. The price feed is relayed through a +FastCGI-wrapped Flask app hosted on a VPS. This lets me configure stock symbols +in its application settings. The app cycles through them as requests come in +from the ESP32. Running the Flask app as a FastCGI process while exposing it +via httpd with htpasswd authentication keeps the server code simple and secure.

+ +

The following diagram outlines the Etlas’s overall system architecture.

+ +

architecture

+ +

The more prominent panel on the right of the display shows local and world news +from Channel NewsAsia. The MCU downloads and parses XML data from the RSS feed +directly before rendering it to the display. The character glyphs used are +stored as bitmaps in the sprites directory. I skipped the proxy for news to +avoid writing more server code, but in hindsight it limits the feeds Etlas can +handle. I will fix this in a future version.

+ +

The middle and bottom right panels display the temperature and relative +humidity from the DHT22 sensor. The DHT22 uses pulse-width modulation to +transmit data to the host. The 26µs, 50µs, and 70µs pulses are too fast for the +ESP32 to measure reliably with standard APIs. Instead, the driver compares +relative pulse widths to differentiate zeros from ones:

+ +
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[DHT_DATA_LEN])
+{
+    int rc;
+    unsigned char i, pwl, pwh;
+
+    gpio_set_level(DHT_PIN, 0);
+    ets_delay_us(1100);
+    gpio_set_level(DHT_PIN, 1);
+
+    if (!dht_await_pin_state(0, 40)) {
+        rc = 1;
+        xQueueSend(dht_evt_queue, &rc, (TickType_t) 0);
+        return 0;
+    }
+    if (!dht_await_pin_state(1, 80)) {
+        rc = 2;
+        xQueueSend(dht_evt_queue, &rc, (TickType_t) 0);
+        return 0;
+    }
+    if (!dht_await_pin_state(0, 80)) {
+        rc = 3;
+        xQueueSend(dht_evt_queue, &rc, (TickType_t) 0);
+        return 0;
+    }
+
+    for (i = 0; i < DHT_DATA_LEN; 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;
+}
+
+ +

I ported this implementation from ESP8266 +to ESP32—all credit for the algorithm belongs to them.

+ +

Etlas is a networked embedded system. All acquisition, processing, and +rendering of data are performed on the ESP32’s 160MHz microprocessor using less +than 512KB of SRAM. The embedded software that makes this possible is written +in C using ESP-IDF v5.2.1. The e-paper display driver is derived from Waveshare +examples for Arduino and STM32 +platforms.

+ +

Etlas has been running reliably for over a year since August 2024.

+ +

Files: source.tar.gz

+
+ +
+
+
+ + + + + + diff --git a/_site/log/etlas/pcb.jpg b/_site/log/etlas/pcb.jpg new file mode 100644 index 0000000..fcb40fa Binary files /dev/null and b/_site/log/etlas/pcb.jpg differ diff --git a/_site/log/etlas/schematic.svg b/_site/log/etlas/schematic.svg new file mode 100644 index 0000000..3070dd1 --- /dev/null +++ b/_site/log/etlas/schematic.svg @@ -0,0 +1,4 @@ + + + +152726131425193V3GND
ESP32 Mini NodeMCU D1
ESP32 Mini NodeMCU D1
DHT22
DHT22
E-paper HAT
E-paper HAT
3.3V
3.3V
3.3V
3.3V
3.3V
3.3V
CS
CS
DC
DC
RST
RST
CLK
CLK
MOSY
MOSY
BUSY
BUSY
VCC
VCC
GND
GND
VCC
VCC
GND
GND
DATA
DATA
Text is not SVG - cannot display
\ No newline at end of file diff --git a/_site/log/etlas/source.tar.gz b/_site/log/etlas/source.tar.gz new file mode 100644 index 0000000..8b12cf6 Binary files /dev/null and b/_site/log/etlas/source.tar.gz differ diff --git a/_site/log/etlas/thumb_sm.jpg b/_site/log/etlas/thumb_sm.jpg new file mode 100644 index 0000000..a374879 Binary files /dev/null and b/_site/log/etlas/thumb_sm.jpg differ -- cgit v1.2.3