Mqtt and Circles

Posted by codepope on Saturday, February 5, 2022
Last Modified on Saturday, August 31, 2024

So, something short to update folks.

Circle 1 - Hacking on MQTT, Go, Python and Swift

I’ve been currently playing with a polygot project with MQTT. It started with the MuteSync, a button which is wired up with software to mute all your conferencing apps at once. Well, it’s neatly done but I always like to hack into things to make them work more like I want. And actually muting is overrated for me. What I need to put up is a cone of do not disturb.

So (2) after making an example app for the MuteSync hardware in Go which enumerated the USB bus to locate the board and then recieved button presses and changed the colors, I set about making it do more. Specifically, firing messages into a Mosquitto MQTT server telling devices that state has changed.

Going smaller

Now, this ‘dnd’ app was prepped in Gom because it was to hand. Next up though was a chain of Neopixel LEDs. These are destined to be around the door to my office and show an enter/do not enter glow as needed. To get them online, I wired them up to a QtPy ESP32-S2 which is teeny and comes complete with Wifi and support for CircuitPython.

This one starts out simpler, using MQTT libraries from Adafruit, it just subscribes to that MQTT broker and listens for the ‘dnd’ state changing so it can light up the strip.

Getting Swifty with it

But there’s still a hole in the plan, and thats a Swift app for iOS and iPADOS. Using Apple’s Swift Playgrounds, its actually completely feasible to write an app on the iPad and thats what I did here. At this point it is more of a PoC shell with basic on off buttons, but thats where we start.

This turned into inspiration for a bit more interactivity. The Swift app is getting some colour controls so it can set up how everything lights up. The test version already applies a topic containing the most recent colour set and applies it when the devices need to display a “dnd” light.

Super useful in all of this is MQTT Explorer which makes it a doddle to interact with an MQTT server and debug whats going on.

There’s some repos up already for this stuff but I’ll update it all when I’m wrapped with it.

Circle 2 - 2.5Gbe updates

The 2.5Gbe PC finally is up and running and it goes woosh. Currently settling it with the 2.5Gbe NAS and the 2.5Gbe MBP and its all going wooshy. So thats good. With everything in place, I now have a pair of i7s running W11 and Ubuntu.

Circle 3 - 64 bitting stuff

The new Raspberry PiOS imager is much improved, most of all, letting you set a username before installing so no more “pi user everywhere with the same password”. Next up is installing the newly debeta’d 64bit PiOS to see if it feels any different. Cue flashing direct to SSDs (quick) and booting off Pi with a disconnected drive so I can boot off a flash stick. More on that in the future once they’ve settled in.

All the way around…

Thats it for this update. Now let’s do this again um… next weekend.