|
|
|
a rare refactor Saturday, September 6 2025
location: 940 feet west of Woodworth Lake, Fulton County, NY
[REDACTED]
Today was predicted to be cold and rainy, so I had the perfect project lined up: a reorganization of the format my ESP8266 Remotes use to send data to the backend. The existing format had grown up organically and rather resembled the memory space of an 8088-based IBM PC. I wanted to make it so the types of data sent could easily be expanded while also improving options for doing such things as logging data locally. The existing format is a double-delimited string, where lines are separated by pipes ("|") and records are separated by asterisks ("*"), which is possible since nearly all the data is numeric. I wanted to keep all the weather data in one line, followed by a "where/when" line containing time and position data, followed by a "power" line containing battery levels, voltages, and amperage. After that would be three lines for "future expansion," followed by a line of housekeeping data, a line of known device_feature states, and finally a line of timestamps when the Moxee cellular hotspot rebooted (if there is one). It took hours to do all this reorganization, and as I worked, I kept fretting that I was hopelessly breaking the whole system. (As a software developer, refactoring is something I do extremely rarely, as my feeling about it is that it usually causes more problems than it solves.) To help with the process, I left the old backend in place and created a new backend to handle the new data specification in parallel with it as I gradually migrated the remotes to the new system. There were a few bugs along the way, but things went better than expected. I was even able to migrate the SolArk Copilot to the new data standard (it sits on a different code base).
Meanwhile the weather improved enough by this evening that Gretchen was able to go for another swim.
This evening Gretchen made a black bean soup and a salad for dinner. Something was amiss with the soup, though, as it tasted like it was missing something. I thought maybe all it needed was salt, but then it turned out that the bouillon Gretchen had mixed up and added to it hadn't properly dissolved.
Later Gretchen and I played a "rousing game" of Bananagrams. As always, Gretchen led throughout most of the game, but at the end it seemed like I had won until it turned out that some of my words were garbage, the result of a failed grafting-together of two separated word-trees and my thinking "encite" is a word. I did, however, legitimately win the second game.
I then spent a fair amount of time in the cabin basement working on the CD tiling project, drinking various alcohol-containing beverages (including red wine), and listening to terrible music on an extremely powerful Christian pop radio station.
For linking purposes this article's URL is: http://asecular.com/blog.php?250906 feedback previous | next |