Monthly Log 2024-02

tlature

I probably should've been taking notes on what I'm working on while I was working on it, but in lieu of a more thorough description, here's a summary of my git log:

  • Add better RouteView and PluginView panels, including parameter editing
  • Add chain view scrolling: Instead of squeezing every processor on the page, chain view panels now have a fixed width, and the ones that don't fit aren't shown until the selection moves offscreen.
  • Add base64-encoded plugin state for non-UTF-8 plugin state bytestreams

FediCard

Nash and hexephre from labyrinth.social made a little tool for creating FediCards! It's built using Godot, which is really neat, but in the comments, there seem to be a few issues when running on some browsers and OSes.

To that end, I've been playing around a lot with web technologies, and in particular, HTML and SVG. In my naïveté, I figured I'd be able to whip up a quick browser-based editor to provide a more compatible (albeit less functional) companion application. Check out the proof-of-concept here

See also: designing a card game and printing and assembling cards

Problem 1

My first instinct was to make an SVG file that gets edited, and directly export that. After hand-minimizing an SVG file and defining all of its style in CSS, I ran into issues with HTML <input> tags embedded in the SVG data.

In retrospect, I could've probably rigged up some sort of Javascript shenanigan, but at the time, I was hoping to get away with as little Javascript as possible. So I converted all of the SVG rectangles to <div> tags.

Problem 2

There's no way to resize the <textarea> dynamically based on its contents with just HTML. My solution to this problem was to ignore it.

Problem 3

After adding some controls for zooming into the image, I ran into an issue where the zooming was causing the image to exceed the bounds.

I turned the img tag into a <div> because I have no idea what I'm doing and the internet told me that would work. And it did.

Rowing machine mod

A while back, I found a used rowing machine on craigslist. It was in really good condition (still had the plastic screen protector, and clearly hadn't been used that much). I've been using it pretty regularly, and for the most part, I'm happy with it, but there's one issue that's been bugging me: after ~3 minutes of inactivity, the screen resets, and does so with almost no warning.

Obviously, the only solution is to reverse engineer the device so that I can build my own distance tracking device. And because the original head unit is mounted to the machine using a VESA mount, this has the added benefit of letting me mount a screen and speakers instead, so I can more comfortably watch stuff while I exercise.

Finding pinout

First step was to figure out what all the pins did. I took apart the head unit, and looked at the board to figure out what did what.

Then I probed the pins to check for voltages and any discernable signals. Under the assumption that the black wire was ground, I found pins with 9 volt and 3.3 volt signals, which I just assumed were power, but other than that, the only other pins I could identify from the 10 total pins were a pair of differential signals.

Next step was to open up the body of the machine. In retrospect, I shouldn't have wasted any time with the head unit, because everything I needed to know was in here. There is a small cylindrical sensor pointing to the air resistance wheel, and after following its wires back to the cable harness, I probed it to find that its resistance dropped when it got close to a magnet mounted on the air resistance wheel. With this, I could just treat it like a pull-up switch and use it to count revolutions.

Building on a perfboard

These days, it's really easy and cheap to get a custom PCB made. With excellent FOSS tools like [KiCad], there are very few excuses to not make a PCB. My excuse in this case was that I wanted to get this running within a few days.

TODO:

  • add pics
  • adding power switch after building the board
  • alternate mcu pins
  • reverse mount headers
  • embassy i/o interrupts
  • 48 revolutions with interleaved i2c
  • 210 when doing one every 10 buttons (maybe because of debouncing or noise? should try with hysteresis)

Next step is to get some sort of speed detection going, but in it's current state, it does everything I need it to, so I suspect that I won't get around to doing anything like that for a while.

Monthly Log

I don't want to complain too much because the fact that I've been able to do 6 months (wow!) of monthly logs without missing any by more than a day or two has far exceeded the expectations I had when I started, but I think I still haven't quite found a good "voice" for blogging yet. Plus, my posts are a bit slapdash and dry, and tend to just say "I did this, then I did this, so I had to do this", rather than outlining any actually useful perspectives or processes, or building an interesting narrative. I had also hoped to use these logs as an opportunity to practice my German, but I've yet to translate any of them yet. Maybe next month.