|
|
|
cold enough for spit cities Tuesday, December 9 2025
Gretchen made pumpkins scones this morning because our friend Greg (of Z and Greg) was coming over to chit chat in front of the woodstove. She took Charlotte for a brief walk up the Farm Road and randomly ran into A there (it's extremely rare to encounter a pedestrian on the Farm Road, but if you do, it's almost certain to be A). So A and Henry stopped by briefly so A could get a scone. A showed me some tea that had flash-frozen on her jacket, and it reminded me of how I used to build futuristic "spit cities" while waiting for the schoolbus. The spit would flash freeze into beautiful domes that looked like they could retain a breathable atmosphere after we befoul the planetary one. As I was telling A this, she didn't seem puzzled it all. She grew up in Toronto, so perhaps building spit cities comes naturally to kids in cold climates.
Once Greg arrived, I hung around with him Gretchen long enough to briefly discuss a Bob Mould show that all of us had left early. But once Gretchen started getting a bit didactic on the subject of veganism, I went upstairs to continue working on my I2C slave. After adding a bunch of Serial.println() statements to the code of both the master and the slave, I figured out that data in a global buffer was being corrupted somehow between when it was arriving via I2C and before it could be saved in the EEPROM. Not really knowing what was going on, I entered various code snippets into ChatGPT and described the symptoms. It gave me a list of four or five issues with solutions. The most likely of these issues (as determined by ChatGPT) weren't the underlying problem. It was in fact the fourth issue that was: an interrupt was apparently happening during the population of the array, corrupting it. This was exactly the sort of issue I'd been reading about last night regarding how cooperative multitasking worked in the Classic Macintosh OS. Macintosh solves it by turning off interrupts during critical operations inside its Toolbox, and it turned out that to fix my problem, all I had to do was turn off interrupts during the population of that global array.
Once I had that working, I was able to get the code working on the LGT8F328P. I eventually noticed, though, that my slaves are back to spontaneously restarting every half hour or so, so I'll probably have to end up fixing that problem however I fixed it back when it was happening at the cabin. Before that, though, I would like to be able to include a configurable string parser on the slave so I can use it to retrieve data from logs arriving via serial. If I can get that working, all the special functionality of the SolArk Copilot (and similar devices) could be offloaded to the slave. That's kind of a big ask for an eight bit microcontroller, but my extremely elaborate slave code only occupies 22% of the flash and about half of the RAM on an Atmega328.
This evening while Gretchen was off at guitar practice and pilates, I used a new mid-sized pot (which I'd used last night to make the burnt rubber soup) to make spaghetti. The new pot has a clip-on strainer whose clips apparently need to be bent out a little.
I'd taken 120 mg of psuedoephedrine at around noon today, so I was very excited to be able to take diphenhydramine this evening and have that lingering feeling of wanting to stay up. I was feeling a little sleepy after drinking a beer, but sure enough, once the diphenhydramine kicked in, I was in that wonderful state. I was feeling a little ambitious in this state, and let ChatGPT refactor a complex ESP8266 function called sendRemoteData() that does all the work of communicating with the backend Apache server and deciding what to do with the results. This function had been taking six seconds to do its thing, and ChatGPT managed to get it down to a second. That still didn't fix a reliability problem I was having with using the ESP8266's serial port to send commands, but the time savings was great, because the ESP8266 in my system spends about 95% of its time in that function.
For linking purposes this article's URL is: http://asecular.com/blog.php?251209 feedback previous | next |