Sam Gentle.com

Prototype wrapup #38

Last week I started looking into figuring out the protocol scrambling for milight bulbs, and this week was more of the same. I had an unfortunate setback, though, when I managed to blow up my remote control, so it'll probably be a bit longer until I can figure it out.

Tuesday

It would appear that systemd has won and, despite ideological concerns about one-daemon-to-rule-them-all, in practical terms I don't care that much as long as it works and I can run services. Problem is I can't remember the service syntax. I had this issue with Upstart too, and I just had one template file I would copy around, but this time I figured I'd do it right. So I made a Rust command that generates a systemd unit file using switches like --restart and --wantedby. The Rust library ecosystem still hurts (I spent most of my time figuring out which command line parser to use) but overall it was fine.

Wednesday

I had a good time with this one. I needed a lot of data from the milight remote under repeatable conditions, up to and including resetting the remote between commands (to reset the counter to zero). Doing that by hand was really annoying, so I figured I'd use a little ESP8266 to turn the remote into a zombie under my control. Switching the power was fine (thanks, transistors), but automating the buttons was harder, because they use capacitive touch. In the end, I figured out that, isntead of changing the output, switching the microcontroller's input from floating to pullup and back could trigger it reliably. Unfortunately, switching the inputs happened too slowly to send a single touch without repeats, and somewhere in the middle there my breadboard power supply catastrophically failed, taking the remote with it.

Thursday

Undaunted, or at least only mildly daunted, I decided to do the best I could with my existing data. I started rewriting my descrambler and looking through the patterns in the data. After a while my eyes went funny and I started to feel a bit too much like John Nash, but I got some fairly tantalising clues. Byte-swapping the data made things easier to understand (the high bit changes more than the low one) and I began to think maybe the key is the second byte rather than the first, but that's as far as I got. I think I really need that counter data to get much further.

Saturday

I wanted to put Minecraft on my Pocket CHIP, but from experience the default home screen kinda freaks out when you add new stuff to it. I've used Marshmallow's fork before, but it used some janky install script instead of a proper apt repository. I thought, well, how hard could it be to make a repository and put it on Github pages? Pretty hard, as it turns out, but I made a fairly generic Makefile in case I ever need to do it again. Hopefully not, though.