• MQTT is pretty cool

    Jon Kunkee11/29/2023 at 04:40 0 comments

    Turns out it's easy to publish to MQTT in a way that Home Assistant can receive, so recent changes in the GitHub repo have added this capability.

    I'll eventually need to add over-the-wire security, but I haven't yet looked for (let alone found) a key management solution that I like. Particle's is pretty cool, but is (as is natural) tied to their service. Azure IoT Hub stymied me the last couple of times I tried to set it up--it's a very 'hyperscaler' product--so I don't know if it would work.

    Also, this way I don't need Internet access for things to work. Heck, I don't even need DNS--just Home Assistant and Mosquitto on the Pi 2, mDNS, and my little widget.

    One way to solve this would be to move off of WiFi entirely. LoRa, Zigbee, or something similar might come with a good solution and, as a bonus, would mean less traffic on 2.4GHz (which is crowded around here).

  • More I2C

    Jon Kunkee11/29/2023 at 04:34 0 comments

    One of my peripherals doesn't play nice on I2C. I finally just put everything on their own I2C hub ports, then started only enabling one at a time. It's cumbersome, but I haven't had a cessation in telemetry in over a week!

    (It's entirely possible that the I2C was fine, but there were too many pullup resistors on the network. I'm not going to check that until the next rebuild, at which point I may do a little work to isolate the fault. It would be easy enough to enable groups of devices together until the issue repros, which could rule out pullup resistors.)

    Previously I had been stressing that there was a bug in my timekeeping and scheduling code. Nope, just angry I2C. Funny how we debug the thing that's easy to debug because it's so hard to debug the thing that's actually probably broken. I think the screen flashes also went away, but I'm not certain. (Something about a drunk guy searching under a street lamp for his keys because there's light there, even though he lost his keys somewhere else...)

    This means my custom integer class can probably go. I'll have to double-check that integer overflow works as expected with the Particle 2.x.x series GCC, then I can clean it out.

    Progress on this project is mostly on GitHub now that the hardware is mostly stable. (I say mostly because I bought some upgrades for it, but they'll require a case redesign that's due anyways because of temperature accuracy issues.)

  • Wrastling I2C

    Jon Kunkee11/23/2021 at 04:05 0 comments

    I2C ain't so bad: simple is as simple does. Vendor implementations and programming models? Those are...more of a challenge.

    To change I2C bus speeds in Arduino environments, it turns out you have to set the speed before Wire.begin() is called. If you want to change speed, you have to call Wire.end(), change, and call Wire.begin().

    I wrote up some other challenges I hit on my blog:

    https://daskunkee.blogspot.com/2021/11/technical-ssd1327-oled-driver-on.html