diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2026-01-08 22:28:37 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2026-01-08 22:28:37 +0800 |
| commit | e836c4b9e78cc3892cdebf8126cb650f1b91ed37 (patch) | |
| tree | 4e52155aef0105cc9b888a42b3e760455a2bcb36 /_site | |
| parent | 57ff09d2eefefa2462a2af0175e3e8164c7bc828 (diff) | |
| download | www-e836c4b9e78cc3892cdebf8126cb650f1b91ed37.tar.gz | |
Tighten prose.
Diffstat (limited to '_site')
| -rw-r--r-- | _site/feed.xml | 2 | ||||
| -rw-r--r-- | _site/index.html | 4 | ||||
| -rw-r--r-- | _site/log/bumblebee/index.html | 34 | ||||
| -rw-r--r-- | _site/log/e-reader/index.html | 35 | ||||
| -rw-r--r-- | _site/log/etlas/index.html | 33 | ||||
| -rw-r--r-- | _site/log/fpm-door-lock-lp/index.html | 17 | ||||
| -rw-r--r-- | _site/log/fpm-door-lock-rf/index.html | 44 | ||||
| -rw-r--r-- | _site/log/neo4j-a-star-search/index.html | 6 | ||||
| -rw-r--r-- | _site/log/site-search/index.html | 65 | ||||
| -rw-r--r-- | _site/posts.xml | 2 | ||||
| -rw-r--r-- | _site/projects/index.html | 4 |
11 files changed, 124 insertions, 122 deletions
diff --git a/_site/feed.xml b/_site/feed.xml index 4c3b746..11e56ec 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-01-05T22:16:02+08:00</updated><id>/feed.xml</id><title type="html">ASCIIMX | Log</title><author><name>W. D. Sadeep Madurange</name></author><entry><title type="html">Search engine (Perl + FastCGI + SA)</title><link href="/log/site-search/" rel="alternate" type="text/html" title="Search engine (Perl + FastCGI + SA)" /><published>2026-01-03T00:00:00+08:00</published><updated>2026-01-03T00:00:00+08:00</updated><id>/log/site-search</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Article count on the website is growing. Need a way to search.]]></summary></entry><entry><title type="html">Matrix Rain: 2025 refactor</title><link href="/log/matrix-digital-rain/" rel="alternate" type="text/html" title="Matrix Rain: 2025 refactor" /><published>2025-12-21T00:00:00+08:00</published><updated>2025-12-21T00:00:00+08:00</updated><id>/log/matrix-digital-rain</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[The 2022 version worked but had some loose ends. Unicode support was inflexible–couldn’t mix ASCII with Katakana; Phosphor decay was stored in a separate array when it should’ve been packed with RGB; Code was harder to read than it needed to be.]]></summary></entry><entry><title type="html">Fingerprint door lock (LP)</title><link href="/log/fpm-door-lock-lp/" rel="alternate" type="text/html" title="Fingerprint door lock (LP)" /><published>2025-08-18T00:00:00+08:00</published><updated>2025-08-18T00:00:00+08:00</updated><id>/log/fpm-door-lock-lp</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Second iteration of the RF door lock. Old version worked but drew too much quiescent current. Sensor and servo pulled 13.8mA and 4.6mA idle. Linear regulators were a disaster. Battery didn’t last 24 hours.]]></summary></entry><entry><title type="html">High-side MOSFET switching</title><link href="/log/mosfet-switches/" rel="alternate" type="text/html" title="High-side MOSFET switching" /><published>2025-06-22T00:00:00+08:00</published><updated>2025-06-22T00:00:00+08:00</updated><id>/log/mosfet-switches</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Needed low-power switching for the fingerprint door lock. Servo and FPM draw high quiescent current–had to cut power electronically during sleep. MOSFETs can do this.]]></summary></entry><entry><title type="html">ATmega328P at 3.3V and 5V</title><link href="/log/arduino-uno/" rel="alternate" type="text/html" title="ATmega328P at 3.3V and 5V" /><published>2025-06-10T00:00:00+08:00</published><updated>2025-06-10T00:00:00+08:00</updated><id>/log/arduino-uno</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Quick reference for wiring ATmega328P ICs at 5V and 3.3V. 5V uses 16MHz crystal, 3.3V uses 8MHz.]]></summary></entry><entry><title type="html">Fingerprint door lock (RF)</title><link href="/log/fpm-door-lock-rf/" rel="alternate" type="text/html" title="Fingerprint door lock (RF)" /><published>2025-06-05T00:00:00+08:00</published><updated>2025-06-05T00:00:00+08:00</updated><id>/log/fpm-door-lock-rf</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Wanted to unlock door with fingerprint, wirelessly to avoid drilling.]]></summary></entry><entry><title type="html">Bumblebee: web script synthesizer</title><link href="/log/bumblebee/" rel="alternate" type="text/html" title="Bumblebee: web script synthesizer" /><published>2025-04-02T00:00:00+08:00</published><updated>2025-04-02T00:00:00+08:00</updated><id>/log/bumblebee</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Work project. Browser session-to-code conversion.]]></summary></entry><entry><title type="html">ATSAM3X8E bare-metal notes</title><link href="/log/arduino-due/" rel="alternate" type="text/html" title="ATSAM3X8E bare-metal notes" /><published>2024-09-16T00:00:00+08:00</published><updated>2024-09-16T00:00:00+08:00</updated><id>/log/arduino-due</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Bypassing ATSAM3X8E (Due) bootloader via Serial Wire Debug (SWD).]]></summary></entry><entry><title type="html">Etlas: e-paper dashboard</title><link href="/log/etlas/" rel="alternate" type="text/html" title="Etlas: e-paper dashboard" /><published>2024-09-05T00:00:00+08:00</published><updated>2024-09-05T00:00:00+08:00</updated><id>/log/etlas</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Repurposed e-reader prototype into something for regular use. News, stocks, weather dashboard. ESP32 NodeMCU D1 + 7.5” Waveshare e-paper + DHT22 sensor.]]></summary></entry><entry><title type="html">512 KB e-reader</title><link href="/log/e-reader/" rel="alternate" type="text/html" title="512 KB e-reader" /><published>2023-10-24T00:00:00+08:00</published><updated>2023-10-24T00:00:00+08:00</updated><id>/log/e-reader</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[First project with e-paper displays and ESP32.]]></summary></entry></feed>
\ No newline at end of file +<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-01-08T22:26:40+08:00</updated><id>/feed.xml</id><title type="html">ASCIIMX | Log</title><author><name>W. D. Sadeep Madurange</name></author><entry><title type="html">Site search with suffix array</title><link href="/log/site-search/" rel="alternate" type="text/html" title="Site search with suffix array" /><published>2026-01-03T00:00:00+08:00</published><updated>2026-01-03T00:00:00+08:00</updated><id>/log/site-search</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Article count is growing. Need a way to search.]]></summary></entry><entry><title type="html">Matrix Rain: 2025 refactor</title><link href="/log/matrix-digital-rain/" rel="alternate" type="text/html" title="Matrix Rain: 2025 refactor" /><published>2025-12-21T00:00:00+08:00</published><updated>2025-12-21T00:00:00+08:00</updated><id>/log/matrix-digital-rain</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[The 2022 version worked but had some loose ends. Unicode support was inflexible–couldn’t mix ASCII with Katakana; Phosphor decay was stored in a separate array when it should’ve been packed with RGB; Code was harder to read than it needed to be.]]></summary></entry><entry><title type="html">Fingerprint door lock (LP)</title><link href="/log/fpm-door-lock-lp/" rel="alternate" type="text/html" title="Fingerprint door lock (LP)" /><published>2025-08-18T00:00:00+08:00</published><updated>2025-08-18T00:00:00+08:00</updated><id>/log/fpm-door-lock-lp</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Second iteration of the RF door lock. Old version worked but drew too much quiescent current. Sensor and servo pulled 13.8mA and 4.6mA idle. Linear regulators were a disaster. Battery didn’t last 24 hours.]]></summary></entry><entry><title type="html">High-side MOSFET switching</title><link href="/log/mosfet-switches/" rel="alternate" type="text/html" title="High-side MOSFET switching" /><published>2025-06-22T00:00:00+08:00</published><updated>2025-06-22T00:00:00+08:00</updated><id>/log/mosfet-switches</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Needed low-power switching for the fingerprint door lock. Servo and FPM draw high quiescent current–had to cut power electronically during sleep. MOSFETs can do this.]]></summary></entry><entry><title type="html">ATmega328P at 3.3V and 5V</title><link href="/log/arduino-uno/" rel="alternate" type="text/html" title="ATmega328P at 3.3V and 5V" /><published>2025-06-10T00:00:00+08:00</published><updated>2025-06-10T00:00:00+08:00</updated><id>/log/arduino-uno</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Quick reference for wiring ATmega328P ICs at 5V and 3.3V. 5V uses 16MHz crystal, 3.3V uses 8MHz.]]></summary></entry><entry><title type="html">Fingerprint door lock (RF)</title><link href="/log/fpm-door-lock-rf/" rel="alternate" type="text/html" title="Fingerprint door lock (RF)" /><published>2025-06-05T00:00:00+08:00</published><updated>2025-06-05T00:00:00+08:00</updated><id>/log/fpm-door-lock-rf</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Wanted to unlock door with fingerprint, wirelessly to avoid drilling.]]></summary></entry><entry><title type="html">Bumblebee: web script synthesizer</title><link href="/log/bumblebee/" rel="alternate" type="text/html" title="Bumblebee: web script synthesizer" /><published>2025-04-02T00:00:00+08:00</published><updated>2025-04-02T00:00:00+08:00</updated><id>/log/bumblebee</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Browser session-to-code conversion. For work. Pre-LLM.]]></summary></entry><entry><title type="html">ATSAM3X8E bare-metal notes</title><link href="/log/arduino-due/" rel="alternate" type="text/html" title="ATSAM3X8E bare-metal notes" /><published>2024-09-16T00:00:00+08:00</published><updated>2024-09-16T00:00:00+08:00</updated><id>/log/arduino-due</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Bypassing ATSAM3X8E (Due) bootloader via Serial Wire Debug (SWD).]]></summary></entry><entry><title type="html">Etlas: e-paper dashboard</title><link href="/log/etlas/" rel="alternate" type="text/html" title="Etlas: e-paper dashboard" /><published>2024-09-05T00:00:00+08:00</published><updated>2024-09-05T00:00:00+08:00</updated><id>/log/etlas</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[Repurposed the e-reader into something for regular use. News, stocks, weather dashboard. ESP32 NodeMCU D1 + 7.5” Waveshare e-paper + DHT22 sensor.]]></summary></entry><entry><title type="html">512KB e-reader</title><link href="/log/e-reader/" rel="alternate" type="text/html" title="512KB e-reader" /><published>2023-10-24T00:00:00+08:00</published><updated>2023-10-24T00:00:00+08:00</updated><id>/log/e-reader</id><author><name>W. D. Sadeep Madurange</name></author><summary type="html"><![CDATA[First project with e-paper.]]></summary></entry></feed>
\ No newline at end of file diff --git a/_site/index.html b/_site/index.html index 62cc0dd..4986f0e 100644 --- a/_site/index.html +++ b/_site/index.html @@ -58,7 +58,7 @@ <tr> <td class="posts-td posts-td-link"> - <a href="/log/site-search/" class="link-decor-none">Search engine (Perl + FastCGI + SA)</a> + <a href="/log/site-search/" class="link-decor-none">Site search with suffix array</a> </td> <td class="posts-td posts-td-time"> <span class="post-meta"> @@ -175,7 +175,7 @@ <tr> <td class="posts-td posts-td-link"> - <a href="/log/e-reader/" class="link-decor-none">512 KB e-reader</a> + <a href="/log/e-reader/" class="link-decor-none">512KB e-reader</a> </td> <td class="posts-td posts-td-time"> <span class="post-meta"> diff --git a/_site/log/bumblebee/index.html b/_site/log/bumblebee/index.html index 5f5c3b0..984187b 100644 --- a/_site/log/bumblebee/index.html +++ b/_site/log/bumblebee/index.html @@ -40,39 +40,31 @@ <h2 class="center" id="title">BUMBLEBEE: WEB SCRIPT SYNTHESIZER</h2> <h5 class="center">02 APRIL 2025</h5> <br> - <div class="twocol justify"><p>Work project. Browser session-to-code conversion.</p> + <div class="twocol justify"><p>Browser session-to-code conversion. For work. Pre-LLM.</p> <video style="max-width:100%; margin-bottom: 10px" controls="" poster="poster.png"> <source src="bee.mp4" type="video/mp4" /> </video> -<p>Architecture: C# WinForms host, embedded browser, code editor. Browser -extension rejected due to security policy and shallow event control.</p> +<p>Quality of scripts are pitiful.</p> -<p>Tool evaluation:</p> +<p>Created tool to generate them real-time (as the user browses the web).</p> -<ul> - <li>CefSharp: Discarded. API lacked elegance.</li> - <li>WebView2: Selected. Better WinForms integration. Hard dependency on -Microsoft Edge–acceptable for corporate Windows environments.</li> -</ul> +<p>Architecture: C# WinForms host, embedded WebView2 browser, Scintilla.NET +editor.</p> <p>Implementation:</p> -<ol> - <li>Interception: Injected JS hooks; internal browser event monitoring -(pop-ups/downloads).</li> - <li>Transformation: Event → Token → Instruction Table → String.</li> - <li>Optimization: Parallel event/text lists processing; rendered -in <a href="https://github.com/desjarlais/Scintilla.NET" class="external" target="_blank" rel="noopener noreferrer">Scintilla.NET</a></li> -</ol> +<ul> + <li>Interception: Injected JS hooks + internal browser events.</li> + <li>Transformation: Event → Token → Instruction table → String.</li> + <li>Optimization: Parallel event/text lists.</li> + <li>Two-way binding of code to Scintilla editor.</li> +</ul> -<p>Bug: Manual mid-session overrides desync code/event lists, bypassing optimizer. -Linear lists inadequate for state synchronization. Need to rethink data -structures; look to compiler Abstract Syntax Trees (AST) for intermediate -representation.</p> +<p>NOTE: Abstract syntax trees.</p> -<p>Verdict: Serves its purpose.</p> +<p>Script generation: minutes/hours → seconds.</p> </div> <p class="post-author right">by W. D. Sadeep Madurange</p> diff --git a/_site/log/e-reader/index.html b/_site/log/e-reader/index.html index 33c08d2..13b4efa 100644 --- a/_site/log/e-reader/index.html +++ b/_site/log/e-reader/index.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>512 KB e-reader</title> + <title>512KB e-reader</title> <link rel="stylesheet" href="/assets/css/main.css"> <link rel="stylesheet" href="/assets/css/skeleton.css"> </head> @@ -37,10 +37,10 @@ <main> <div class="container"> <div class="container-2"> - <h2 class="center" id="title">512 KB E-READER</h2> + <h2 class="center" id="title">512KB E-READER</h2> <h5 class="center">24 OCTOBER 2023</h5> <br> - <div class="twocol justify"><p>First project with e-paper displays and ESP32.</p> + <div class="twocol justify"><p>First project with e-paper.</p> <video style="max-width:100%;" controls="" poster="poster.png"> <source src="ereader.mp4" type="video/mp4" /> @@ -49,13 +49,13 @@ <p>ESP-WROOM-32, 7.5” Waveshare e-paper display, three-button interface (prev/next/sleep).</p> -<p>Memory: 512KB SRAM + 4MB flash. Internal 4 MB flash unsuitable for storing -books due to P/E cycle limits. HTTP Range requests for on-demand bitmap -streaming. Progress saved to RTC memory to survive deep sleep without flash -wear.</p> +<p>Memory: 512KB SRAM + 4MB flash. Internal flash unsuitable for storing books due +to P/E cycle limit. Used HTTP Range requests to stream them on-demand. +Progress saved to RTC memory to survive deep sleep without flash wear.</p> -<p>EBM format: Raw bitmap sequence. 1 byte = 8 pixels, 1 page = 48 KB (display -resolution), headerless. Optimized for HTTP Range requests:</p> +<p>PDFs are rasterized and stored as sequences of bitmaps on a server. 1 byte = 8 +pixels, 1 page = 48KB (display resolution), headerless. Optimized for Range +requests without server-side logic:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>int r0 = ((page_n - 1) * PAGE_SIZE); int rn = page_n * PAGE_SIZE - 1; @@ -68,8 +68,9 @@ esp_http_client_set_header(http_client, "Range", buf); esp_http_client_perform(http_client); </code></pre></div></div> -<p>Page buffer: Three pages (prev/current/next) in RAM—maximum possible. On -request: cycles buffer, updates screen, prefetches next page.</p> +<p>Three pages (prev/current/next) held in a buffer—maximum possible. Upon +request, embedded software cycles the buffer, updates the screen, prefetches +the next page.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>c_page_num++; pg.page_num = c_page_num + 2; @@ -82,12 +83,14 @@ epd_draw_async(pages[c_page_num % PAGE_LEN], PAGE_SIZE); epd_draw_await(); </code></pre></div></div> -<p>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.</p> +<p>System isn’t as responsive as I’d hoped. 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.</p> -<p>Better, but screen updates block user input. Moved SPI buffers to DMA and made -transfers async. Few more cycles saved.</p> +<p>Better, but screen updates block user input.</p> + +<p>Moved the SPI buffers to DMA and made the transfers async. Few more cycles +saved.</p> <p>Can’t think of anything else.</p> diff --git a/_site/log/etlas/index.html b/_site/log/etlas/index.html index f618503..68c19ae 100644 --- a/_site/log/etlas/index.html +++ b/_site/log/etlas/index.html @@ -40,9 +40,9 @@ <h2 class="center" id="title">ETLAS: E-PAPER DASHBOARD</h2> <h5 class="center">05 SEPTEMBER 2024</h5> <br> - <div class="twocol justify"><p>Repurposed <a href="../e-reader/">e-reader prototype</a> into something for regular use. -News, stocks, weather dashboard. ESP32 NodeMCU D1 + 7.5” Waveshare e-paper + -DHT22 sensor.</p> + <div class="twocol justify"><p>Repurposed the <a href="../e-reader/">e-reader</a> into something for regular use. News, +stocks, weather dashboard. ESP32 NodeMCU D1 + 7.5” Waveshare e-paper + DHT22 +sensor.</p> <table style="border: none;"> <tr style="border: none;"> @@ -54,18 +54,21 @@ DHT22 sensor.</p> </tr> </table> -<p>Stocks: Two weeks EOD prices from Polygon.io (max possible). Flask app on VPS -relays feed; manages watchlist. Backend: httpd + htpasswd + FastCGI + Flask.</p> +<p>Stocks: Two weeks EOD data from Polygon.io (max possible). Flask app on VPS +manages watchlist, relays the feed. Backend: httpd + htpasswd + slowcgi + +Flask.</p> -<p>gui_plot_stocks() triggers watchdog; vTaskDelay() required. Stepped graph was -easier to implement (under memory constraints), but the logic is hideous. Note -to self: Refactor with Bresenham’s?</p> +<p>gui_plot_stocks() plots a stepped graph; was easier to implement, but the code +is hideous; triggers watchdog. vTaskDelay() prevents that.</p> -<p>News: Channel NewsAsia RSS. MCU parses XML directly. Character glyphs stored as -bitmaps in header files.</p> +<p>NOTE: Refactor. Bresenham’s?</p> + +<p>News: Channel NewsAsia RSS. MCU does the parsing. Didn’t plan to have a backend +at the time. Now that I have one for stocks, should relay the feed for +flexibility.</p> <p>Weather: DHT22 single-wire protocol. 26µs/50µs/70µs pulses are too fast for -standard ESP32 APIs. Bit-banged relative pulse widths: (Ported from <a href="https://github.com/Fonger/ESP8266-RTOS-DHT" class="external" target="_blank" rel="noopener noreferrer">ESP8266</a>):</p> +standard ESP32 APIs. Bit-banged relative pulse widths (ported from <a href="https://github.com/Fonger/ESP8266-RTOS-DHT" class="external" target="_blank" rel="noopener noreferrer">ESP8266</a>):</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>static inline int dht_await_pin_state(int state, int timeout) { @@ -122,10 +125,10 @@ static inline int dht_get_raw_data(unsigned char buf[BUFLEN]) } </code></pre></div></div> -<p>Ghost in the machine: epd_init() stalls intermittently on first refresh() after -flash. Toggling delay values in refresh() resolves it. If first refresh -succeeds, it remains stable. Root cause unknown–suspected power supply issues -from powering display via MCU.</p> +<p>epd_init() stalls intermittently on first refresh() after flash. Toggling delay +values in refresh() resolves it. If the first refresh succeeds, it remains +stable. Root cause unknown–suspect noisy power supply due to powering display +via MCU.</p> <p>Uptime: August 2024 - January 2026</p> diff --git a/_site/log/fpm-door-lock-lp/index.html b/_site/log/fpm-door-lock-lp/index.html index 54c471c..a39a34e 100644 --- a/_site/log/fpm-door-lock-lp/index.html +++ b/_site/log/fpm-door-lock-lp/index.html @@ -48,10 +48,9 @@ idle. Linear regulators were a disaster. Battery didn’t last 24 hours.</p> <source src="video.mp4" type="video/mp4" /> </video> -<p>Redesigned the PCB completely. Tossed the RF modules and the second MCU. -Connected R503 sensor directly to the ATmega328P. Sensor now mounts on door -exterior, servo attaches to interior knob, MCU stays on the back to prevent -tampering.</p> +<p>Redesigned the PCB completely. Tossed RF modules and the second MCU. Connected +R503 directly to the ATmega328P. Sensor now mounts on door exterior, servo +attaches to interior knob, MCU stays on the back to prevent tampering.</p> <table style="border: none; width: 100%"> <tr style="border: none;"> @@ -76,14 +75,14 @@ plane on bottom layer.</p> and servo before deep sleep. Through-hole MOSFETs that switch at 3.3V are getting harder to find. NDP6020P already obsolete.</p> -<p>Replaced linear regulators with MP1584EN DC-DC buck converters. No RF, noise -isn’t a big concern. Buck’s pin breakout not great–wouldn’t fit most -commercial dev boards.</p> +<p>Replaced linear regulators with MP1584EN DC-DC buck converters. No RFM–noise +isn’t a big concern. Buck’s pin breakout not great–wouldn’t fit commercial dev +boards.</p> -<p>Squeezed more power savings from the MCU by running it at 3.3V/8MHz. Combined +<p>Squeezed more power savings by underclocking MCU to 8MHz/3.3V. Combined with buck converters: 56% total power savings.</p> -<p>Wake sequence: MCU activates sensor MOSFET, unlocks sensor over UART, scans and +<p>Wake sequence: MCU activates FPM MOSFET, unlocks FPM over UART, scans and matches fingerprint. Match triggers blue LED, servo MOSFET, PWM signal to unlock. No match triggers red LED. MOSFETs off, back to sleep.</p> diff --git a/_site/log/fpm-door-lock-rf/index.html b/_site/log/fpm-door-lock-rf/index.html index d6c6b66..55675ff 100644 --- a/_site/log/fpm-door-lock-rf/index.html +++ b/_site/log/fpm-door-lock-rf/index.html @@ -46,21 +46,25 @@ lines of the transceivers to UART RXD/TXD of an ATmega328P. Unreliable–constant packet loss.</p> -<p>2025-01: Switched to RFM69 modules. A complete ball-ache. Followed the -datasheet to the letter, audited code more than 10 times, cross-checked with -RadioHead and RFM69 OSS drivers. No luck. ATmega328P runs at 5V, RFM69 3.3V. I -suspect the problem is with the logic-level converter (LLC). Not enough swing.</p> +<p>2025-01: Switched to RFM69 modules. Complete ball-ache. Followed datasheet to +the letter, audited code many times, cross-checked with RadioHead and RFM69 +open-source drivers. No luck.</p> -<p>2025-04: Ditched RFM69s. Switched to NRF24L01+ modules–5V tolerant, no LLC -required. Spent six weekends writing driver from scratch–clean-room, using -datasheet. Works perfectly.</p> +<p>Datasheet riddled with ambiguity.</p> -<p>2025-05: Wrote FPM sensor drivers for R503 and FPM10A. UART RX sequence was -tricky–took multiple attempts to get handshake working. R503 has built-in LEDs -and better form factor–will use it for the lock.</p> +<p>ATmega328P runs at 5V; RFM69 3.3V. Suspect logic-level converter (LLC) +issues. High resistance. Not enough swing.</p> -<p>2025-06: First PCB design. Two boards: fingerprint sensor (front), servo -controller (back). Encrypted RF link between them.</p> +<p>2025-04: Ditched RFM69s. Switched to NRF24L01+ modules– data pins 5V tolerant, +no LLC required. Spent six weekends writing driver from scratch–clean-room. +Works like a charm.</p> + +<p>2025-05: Wrote FPM drivers for R503 and FPM10A. UART RX sequence was +tricky–adopted Adafruit C++ FOSS implementation to C. R503 has built-in LEDs +and better form factor. Chose it for the lock.</p> + +<p>2025-06: Two PCB boards for FPM (front) and servo (back) controllers. Encrypted +RF link between them.</p> <table style="border: none; width: 100%"> <tr style="border: none;"> @@ -85,20 +89,18 @@ controller (back). Encrypted RF link between them.</p> </tr> </table> -<p>PCB specs: 2-layer, 1oz copper, 0.3mm traces (0.5mm for power). Ground plane. -Both subsystems worked—could control servo from sensor over RF.</p> +<p>PCB specs: 2-layer, 1oz copper, 0.3mm traces (0.5mm for power). Ground plane.</p> -<p>2025-06: NRF24L01+ on the back controller stopped working after mounting on -PCB. RFM is too close to PWM line. Fixed by soldering a large 47uF (16V) -electrolytic capacitor between VCC and ground.</p> +<p>2025-06: NRF24L01+ on the back stopped working after mounting on PCB. Too close +to servo’s PWM line. Soldering a large 47uF (16V) electrolytic capacitor +between VCC and ground fixed it.</p> <p>Power problems became clear. Linear regulators dissipated too much heat. Sensor -and servo drew 13.8mA and 4.6mA quiescent—unacceptable for battery. Servo -inrush current can exceed 1A. Trace width (0.3mm), especially for servo and -power, cutting it close.</p> +and servo drew 13.8mA and 4.6mA quiescent currents–unacceptable for battery. +Servo inrush current exceeds 1A. 0.3mm tracks cuts it too close.</p> <p>Verdict: Functional but not practical. Battery dead in under 24 hours. Led to -<a href="../fpm-door-lock-lp/">complete redesign</a> with proper power management.</p> +<a href="../fpm-door-lock-lp/">redesign</a> with proper power management.</p> <p>Commit: <a href="https://git.asciimx.com/smart-home/commit/?id=f4b0b734a595919cf451ab9448b06274c8e609a4">f4b0b73</a> diff --git a/_site/log/neo4j-a-star-search/index.html b/_site/log/neo4j-a-star-search/index.html index 152531d..2063d68 100644 --- a/_site/log/neo4j-a-star-search/index.html +++ b/_site/log/neo4j-a-star-search/index.html @@ -40,8 +40,8 @@ <h2 class="center" id="title">NEO4J PATH TRAVERSAL: A* OPTIMIZATION</h2> <h5 class="center">06 MARCH 2018</h5> <br> - <div class="twocol justify"><p>Work project. Marine vessel tracking with Neo4J hit a limit. Need to store -13,000 route points; Dijkstra’s shortest path search slows after 4,000.</p> + <div class="twocol justify"><p>Work. Vessel tracking with Neo4J hit a limit. Need to analyze 13,000 route +points; Dijkstra’s shortest path search slows after 4,000.</p> <p>Replaced Dijkstra’s algorithm with A* search using haversine function as heuristic:</p> @@ -82,7 +82,7 @@ heuristic:</p> } </code></pre></div></div> -<p>Outcome: 300x speedup. Scaled to 13,000 route points.</p> +<p>300x speedup. Scaled to 13,000 route points.</p> <p>Upstreamed changes: <a href="https://github.com/neo4j-contrib/neo4j-graph-algorithms/releases/tag/3.4.0.0" class="external" target="_blank" rel="noopener noreferrer">Neo4J v3.4.0</a> | <a href="https://github.com/neo4j-contrib/neo4j-graph-algorithms/blob/bd9732d9a690319552e134708692acb5a0d6b37c/algo/src/main/java/org/neo4j/graphalgo/impl/ShortestPathAStar.java">Full diff --git a/_site/log/site-search/index.html b/_site/log/site-search/index.html index 9170002..e5b9f15 100644 --- a/_site/log/site-search/index.html +++ b/_site/log/site-search/index.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Search engine (Perl + FastCGI + SA)</title> + <title>Site search with suffix array</title> <link rel="stylesheet" href="/assets/css/main.css"> <link rel="stylesheet" href="/assets/css/skeleton.css"> </head> @@ -37,43 +37,43 @@ <main> <div class="container"> <div class="container-2"> - <h2 class="center" id="title">SEARCH ENGINE (PERL + FASTCGI + SA)</h2> + <h2 class="center" id="title">SITE SEARCH WITH SUFFIX ARRAY</h2> <h5 class="center">03 JANUARY 2026</h5> <br> - <div class="twocol justify"><p>Article count on the website is growing. Need a way to search.</p> + <div class="twocol justify"><p>Article count is growing. Need a way to search.</p> <p>Requirements: matches substrings, case-insensitive, fast, secure. No JavaScript.</p> <p>Architecture: browser → httpd → slowcgi → Perl CGI script.</p> -<p>httpd, slowcgi, Perl are in the OpenBSD base system. No dependencies. Access -governed by file system permissions–no secrets to manage. Secure by default.</p> +<p>Perl, httpd, slowcgi are in the OpenBSD base system. Instead of secrets, file +system permissions govern access.</p> -<p>2025-12-30: Regex search. Wrote a 140-line Perl script that searches HTML files -using Regex. Script slurps 500 files (16 KB each) in 40 milliseconds. Fast -enough. Start to feel the O(N) pull at higher file counts.</p> +<p>2025-12-30: Regex search.</p> -<p>Regex and the site crawl introduce ReDoS and symlink attack vectors. Both can -be mitigated. Tempted to stop here.</p> +<p>140-line Perl script searches 500 files in 40ms. Fast enough; O(N) pull felt at +higher file counts.</p> -<p>2026-01-03: Suffix array (SA) based index lookup.</p> +<p>Introduces ReDoS and symlink attack vectors. Both can be mitigated. Tempted to +stop here.</p> -<p>Inefficiency of scanning every file on each request troubles me. Regex search -depends almost entirely on hardware for speed.</p> +<p>2026-01-03: Suffix Array (SA) based index lookup.</p> -<p>Built SA index comprising three files: corpus.bin (articles), sa.bin (sorted -byte offsets), file_map.dat (metadata). Index created with the site:</p> +<p>Slurping files on every request bothers me. Regex search depends almost +entirely on hardware for speed.</p> + +<p>Implemented SA index with three files: corpus.bin, sa.bin, file_map.dat. Index +built with site:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ JEKYLL_ENV=production bundle exec jekyll build $ cd cgi-bin/ $ perl indexer.pl </code></pre></div></div> -<p>Indexer extracts HTML, lowercases, encodes text as UTF-8 binary sequences, and -saves to corpus.bin. Null byte sentinel marks the document boundaries. Suffix -array stores offsets of all suffixes as 32-bit unsigned integers, sorted by the -lexicographical order:</p> +<p>Indexer extracts HTML, lowercases, encodes into UTF-8 binary sequences. Null +byte sentinel for document boundaries. sa.bin stores suffix offsets as +32-bit unsigned integers, sorted by lexicographical order:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>my @sa = 0 .. (length($corpus) - 1); { @@ -101,11 +101,11 @@ SORTED SUFFIXES: [7] x </code></pre></div></div> -<p>Algorithmic complexity: O(L⋅N log N). Fast path caps L at 64 bytes (length of a -cache line), reducing complexity to O(N log N).</p> +<p>Time complexity: O(L⋅N log N). Fast path caps L at 64 bytes (length of cache +line), reducing complexity to O(N log N).</p> -<p>Search: Textbook range query with two binary searches. Random access to offsets -and the text is possible via the fixed-width offsets:</p> +<p>Search: Textbook range query with twin binary searches. Random access to +suffixes and the text made possible by the fixed-width offsets:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>seek($fh_sa, $mid * 4, 0); read($fh_sa, my $bin_off, 4); @@ -114,8 +114,9 @@ seek($fh_cp, $off, 0); read($fh_cp, my $text, $query_len); </code></pre></div></div> -<p>Small seek/reads are fast on modern SSDs. Keeps memory usage low, and was easy -to implement. Note to self: mmap.</p> +<p>Small seek/reads are fast on modern SSDs. Keeps memory usage low.</p> + +<p>NOTE: mmap.</p> <p>Benchmarks on T490 (i7-10510U, OpenBSD 7.8, article size: 16 KB).</p> @@ -149,14 +150,16 @@ to implement. Note to self: mmap.</p> <li>Search (Regex): 0.9120 s</li> </ul> -<p>Security: Much of it comes from its architectural simplicity. No dependencies -to manage, no secrets to hide, no assets for lateral movement. Runs in chroot.</p> +<p>Security: Derived from architectural simplicity. Zero dependencies to manage, +no secrets to hide, no targets for lateral movement.</p> + +<p>Runs in chroot.</p> -<p>Resource exhaustion and XSS attacks are inherent. The former is mitigated by -limiting concurrent searches via lock-file semaphores and capping query length -(64B) and result sets (20). All output is HTML-escaped to prevent XSS.</p> +<p>Resource exhaustion and XSS attacks are inherent. Former mitigated by limiting +concurrent searches via lock-file semaphores. Query length (64B) and result set +(20) capped. All output is HTML-escaped to prevent XSS.</p> -<p>Verdict: Fast SA lookup; Works on every conceivable web browser.</p> +<p>Secure by default. Fast. Durable.</p> <p>Commit: <a href="https://git.asciimx.com/www/commit/?h=term&id=6da102d6e0494a3eac3f05fa3b2cdcc25ba2754e">6da102d</a> diff --git a/_site/posts.xml b/_site/posts.xml index d381285..0b5b79a 100644 --- a/_site/posts.xml +++ b/_site/posts.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/posts.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-01-05T22:16:02+08:00</updated><id>/posts.xml</id><title type="html">ASCIIMX</title><author><name>W. D. Sadeep Madurange</name></author></feed>
\ No newline at end of file +<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/posts.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-01-08T22:26:40+08:00</updated><id>/posts.xml</id><title type="html">ASCIIMX</title><author><name>W. D. Sadeep Madurange</name></author></feed>
\ No newline at end of file diff --git a/_site/projects/index.html b/_site/projects/index.html index 90732a1..474febe 100644 --- a/_site/projects/index.html +++ b/_site/projects/index.html @@ -103,8 +103,8 @@ <td class="project-item"> <a href="../log/e-reader" class="link-decor-none"> - <img src="../log/e-reader/thumb_sm.png" alt="512 KB e-reader"> - <h5>512 KB e-reader</h5> + <img src="../log/e-reader/thumb_sm.png" alt="512KB e-reader"> + <h5>512KB e-reader</h5> </a> </td> |
