WLOG - blog something different

tags: ai arduino bass games godot i2c linux plan9 random rv web werc zig
It's okay to be boring
link | i2c, plan9 | Mon Aug 28 23:26:22 CET 2023 No.22

More precisely, it is okay to do boring, soul-crushing things.

We all want to do “fancy” and exciting things, most, if not all the time. This very blog is an exercise in posting something neat.

But most of the time, you have to play an adult and do the nitty-gritty things to actually finish something.

Now, this bme680 sensor is becoming a pet peeve of mine.

Thinking that the heating element was burned, not much attention was paid to the actual gas resistance values denoting air quality. Not that there is any reference to good/bad values outside of using the BSEC library to print out an AQI value. And now with a set of working sensors, the results did not get better or comparable with the output from the Arduino install.

To be fair, upon a review, a few of my own bugs were discovered (like, never actually writing proper heating timings to the sensor). Don’t code during heatwaves without an AC; it’s not good for your code.

Nevertheless, something is “missing” from the documentation:

Undocumented use of registers in the BSEC Arduino library

Now this example actually turned out to be a red herring, since all sensors are identified from the documented registers, and you can’t blame the manufacturer for this too much. It might have something to do with internal testing/QA or a set-up for a different sensor in the family. Who knows?

But then there is this doodoo duckery:

BSEC binary blob setting DO NOT CHANGE registers

This is why we have trust issues. When using the BSEC Arduino library with the binary blobs that can calculate the AIQ from gas resistance, if you check the communication on the bus with a logic analyzer, you can see the library writing values to bits that are marked DO NOT CHANGE in the documentation.

A theory is being developed here: this sensor is great and easy to use for temperature, pressure, and humidity. Start sampling, read the data, convert to preferred units, and that’s it. For air quality, this was never intended to be used without the provided blobs.

Now that we are observing the sensor with the BSEC library, there are some quirks being discovered. From “burn in time” for gas sensor (before giving reliable measurements) not being time since the sensor was powered on but time constantly sampling at least every 3 seconds. To the documentation/library performing “do as I say, not as I do” and changing DO NOT CHANGE BITS.

Now this mistery is far from over. But the process of solving it is tedious. Boring. Filled with wishes for doing something more exciting. And yet, you have to do what you have to do. And that’s okay.


A quick lesson
link | plan9, web, werc | Mon Jul 31 17:39:53 CET 2023 No.21

Well, it’s more of a reminder than a lesson.

It is more important what you optimize than how much you optimize.

It turns out, that for all the overclocking and tweaking of the abused first generation Raspberry Pi, the best performance increase you can get:

Web page with graphs generation difference

Is to not read everything all of the time from the SD card:

Code change of web page generation script


No, it's definitely me
link | arduino, random | Sun Jul 30 22:03:09 CET 2023 No.20

I have come to a realization: coding for Arduino is like coding with ChatGPT.

Both are very useful tools. Spectacular if you’re learning, experimenting, or quickly prototyping with stuff. In other words, it is best when used to do something that has been done to death before. Venture out of this realm and you better be worth “your salt” (electrolytes are important for proper brain function).

Now, I’m not beyond ducking up royally:

Embarrassing typo in code

Let’s file this one under “Rust wouldn’t fix this (TM)”.

So it’s good to validate your code/design/results/… against something known. And having finally gotten new bme680 sensors, it was time to do just that. And what a quicker and easier way than to slap it on an Arduino and compare results.

Something over there is not the same as over here

Yeah, it’s never that easy. The original Bosch library doesn’t work on the Arduino at hand (using precompiled blobs), and the DFRobot library from the manufacturer has nothing exposed.

Well fork, let’s do it ourselves and expose the raw data from the sensor.

And no, even that was not enough to figure out that one last discrepancy.

Glaring omission in the datasheet

Let’s file this one under “Trust nothing (TM)”.


Pay your artists
link | games, godot | Tue Jul 11 22:16:48 CET 2023 No.19

It’s hot. Let’s play some games.

And when I say “play some games”, I mean anything besides actually playing games. For now, let’s improve the mod for Brotato, with new experiences and resources.

Now, while there are many improvements to make the game even more “playable”. From supporting the new version of the game to implementing a menu to tweak A setting. There was something missing. Namely, my ability to do art.

I’m sure there is someone somewhere saying, “there is no such thing as bad art”. But there is such a thing as better art.

For example, a logo for the Steam Workshop to act as an icon for the mod, created by the code monkey writing this:

Old SecondChance mod logo

And a logo created as a commission from someone who actually has artistic talent and practice:

New SecondChance mod logo

A bit of a difference, is it not?

And to “touch base” with “the zeitgeist in the room”, I’m also sure someone will point out that for a thing like this, we have many wonderful tools that, with the power of statistical analysis (or machine learning, if you will), can generate images based on a previous dataset, with a convenient text interface in the form of a prompt.

While that is true and those tools are great for prototyping or components in a pipeline of creation, I have not found one with the style of the game. Also, there wasn’t a “clear image” in my mind of what the result should look like. More, like, “how it should feel”. So, what do you do when you have a problem? You find a specialist!

So, what I’m trying to say with all of that is: pay your artists.


#JustForYOU
link | plan9, web, werc | Wed Jun 28 23:13:46 CET 2023 No.18

Some quality of life improvements for YOU three (you know who you are) that have found and use this page.

Firstly, some improvements to RSS functionality of werc. Now, the built-in blagh blog or the additional barf app have a nice feature that generates an RSS feed list by calling index.rss on the content folder. Something that I think would be cool for any folder. Maybe you’re interested in just part of the site or would like an RSS feed update when new content is posted, but is not a blog.

Well, this feature is no longer missing! Introducing the rrsfy werc app, which allows for RSS feed creation on any configured folder through the index.rss “interface”.

This brings the available feeds for this site to:

And while we’re here, since the code for the rssfy is based on the existing apps, a fix for the creation date if posts for barf.

To improve the blog, let’s make an index of tags. More in the web notes

The barf comes with some scripts (some work, some are author specific), and one of them (gt) generates a list of posts and associated tags (which makes clicking on the tag and displaying associated posts work).

Now, let’s add some custom magic to generate a header with clickable links. And there we go.

Secondly, there are also some CSS tweaks to spruce up the look.

How all this affects the look is left as “homework” for the reader to figure out.


The importance of balancing trees
link | random | Sat Jun 18 18:44:42 CET 2023 No.17

Now, regarding developing structures, let’s talk about balancing trees.

Sometimes it is not just a problem of a difference in proportion of branches, but an unsuitable root node. So, what to do?

First, prepare a replacement root node.

Alternative root node

Link the new root node to the tree structure.

New root node linking

Make sure all the connections are updated.

Protecting root node connections

Do proper testing and inspection. Multiple tests over time are preferred.

Inspecting root node connections

There’s nothing wrong with some application of exception handling.

Protecting root node connections

The goal is for the new root node to properly support the structure and handle the load.

Linked new root node