Your leaking thatched hut during the restoration of a pre-Enlightenment state.

 

Hello, my name is Judas Gutenberg and this is my blaag (pronounced as you would the vomit noise "hyroop-bleuach").



links

decay & ruin
Biosphere II
Chernobyl
dead malls
Detroit
Irving housing

got that wrong
Paleofuture.com

appropriate tech
Arduino μcontrollers
Backwoods Home
Fractal antenna

fun social media stuff


Like asecular.com
(nobody does!)

Like my brownhouse:
   confirmation through a reboot
Sunday, January 18 2026

location: rural Hurley Township, Ulster County, New York

This morning I went out with the snow shovel and cleaned up the driveway, which had received another couple inches of snow overnight (and snow was still falling).

Yesterday while I was still lying in the hotel bed, I was working out how I could make it so that I could get confirmation of a successful remote reflashing on one of the ESP8266s in my network of microcontrollers. I decided to track the ID of the item in the command_log table through the ESP8266's reboot. To do that, I would have to store that ID some place safe so I could look it up once the ESP8266 is running again. One place to store it would be in on-board flash or perhaps slave EEPROM (where most other data gets locally persisted). But flash and EEPROM both eventually wear out, so I would rather not make a habit of using them to store information that doesn't need to last for more than a couple minutes at most. So I decided to eat into a little more of the slave's precious RAM and create four four-byte (that is, long) integers on it specifically to be used as scratch pad by the master to preserve information through reboots. Today after the usual Sunday morning living room ritual, I went up to the laboratory and, under the influence of a 120 mg recreational dose of pseudoephedrine, I began building out my solution. Along the way I had to create a fair number of new globals in the ESP8266, including a place to temporarily store output strings coming from a deferred command when it is finally run. Deferred commands are ones that cannot be run right away because that would cut off confirmation to the user that they were being run. Instead they are deferred to immediately after that confirmation is sent. That worked great for a reboot command, but it was more problematic for a firmware update command, since there were many ways the update could fail after that final confirmation. So its confirmation had to be something like "Attempting firmware update..." Then the update might fail and the ESP8266 would never even reboot, and all the messages sent after the confirmation would be lost. To capture these, I added a possibleEndingMessage global to pick up any messages being generated after confirmation. If the reflashing failed, I could catch that scenario and then send a command to the backend to update the command_log result_message with the additional error messages. But if instead the ESP8266 rebooted, I would know that the flash had been successful, and the ESP8266 could pull the command_log_id from the slave to know where to update the result_message with this good news. This all sounds very straightforward, but the world inside my ESP8266s is full of all sorts of different states, some of which are not suitable for sending messages to the backend. So I had to do a lot of tests to figure out just what conditions were right for sending updates to the command_log. I managed to get it all working a little before Gretchen picked me up for dinner.

While I'd been working on microcontrollers in the laboratory, you see, she had gone out with her friend Paula to see a movie that ended up being nearly three hours long, cutting unexpectedly into our dinner date with Falafel Cathy and Roy at the Garden Café. So Gretchen had to move the date from 5:00pm to 5:15pm. I went out minutes before she arrived to do a little more snow shoveling if necessary, but there hadn't been enough of an accumulation. Since the roads had been sketchy all day and remained so, Gretchen was in the Forester, not the Bolt.
At the Garden, there was a red bean soup which I would definitely be getting. But I also wanted the two mushroom appetizers, one being stuffed mushrooms and the other being fat portobello chunks on skewers served with mild japanese peppers. So that was all I ordered, and it ended being so much that I had to take some home. I don't remember all that much of what was discussed, though Gretchen got an unexpected slice of cake for her birthday because she is such a Garden Café VIP.
Roads were so treacherous on the drive home that I rarely went more than 30 mph.


For linking purposes this article's URL is:
http://asecular.com/blog.php?260118

feedback
previous | next