Category Archives: Programming

Hoard of the rings: extracting data from Colmi BLE annular activity trackers

I’m not especially a fan of the ‘quantified self’, the notion that I should continuously record massive amounts of data about my daily life and physiological state. But I am keen on Bluetooth LE communications, and this reason, not the former, is why I acquired a Colmi R02 “smart ring” from the PRC.

Colmi R02 smart ring. Image © 2025 Tony Smith

And all for a mere £6.24 including postage and packing. Barg!

The ring contains a tiny microcontroller and BLE radio, plus an accelerometer for step counting, a blood oxygen reader and a heartbeat sensor. It’s powered by a battery recharged using a tiny magnetic jack that you plug into any USB adaptor. Wee it may be, but the 17mAh battery will give you around five days’ usage on a full charge. From its size, the MCU looks like it’s the BlueMicro RF03, but the precise type is not stated in the ring’s specs.

Continue reading

How I went kicking and screaming from AppKit to SwiftUI… and why I plan to stay there

With time on my hands and having noted that rather a lot of iOS and macOS engineering jobs now emphasise SwiftUI skills, I thought it was high time that this old AppKit hand spent some time learning how to implement Swift’s ‘new’ declarative UI construction framework.

You might very well wonder why it has taken me so long. SwiftUI has been around for five and a half years – it debuted at Apple’s Worldwide Developers’ Conference in 2019. Why have I not tackled it before?

Continue reading

udev, I dev: unique identifiers and aliases for USB serial ports on Linux and macOS

An interesting comment on my previous post suggests using udev rules to give connected USB-to-serial adaptors their own, unique names. It works by setting udev rules to apply a symbolic link to specific devices when they are connected.

The approach, outlined in this blog post, works at the command line. This got me thinking: can I do the same in code?

Continue reading

Xcode 15.3 zaps Swift packages: here’s how you fix it

I have cd "${PROJECT_DIR}" ; agvtool bump set as a script in a number of my macOS projects’ Xcode schemas’ Build phases. The second of the two commands auto-increments the project build number on completion of the build. It continues to do so, but with Xcode 15.3* there’s a side-effect: it deletes the project’s Swift packages.

Xcode and Swift icons
Icons owned by Apple
Continue reading

FreeRTOS and the Pi Pico: sizing up scheduling

FreeRTOS scheduling is hard in as much at can be difficult to decide how to configure it. I wanted to try and figure out the options.

The popular real-time operating system provides the configUSE_TIME_SLICING and configUSE_PREEMPTION as settings values. You can add them to your FreeRTOSConfig.h file Tasks themselves can be assigned priority values, and there are API calls to allows tasks to sleep, to yield up the CPU, and be suspended and subsequently resumed.

Continue reading

Take advantage of Xcode’s hidden diagnostics to debug multi-threaded application code

PreviewMarkdown’s Thumbnailer component, an App Extension which generates Finder icon thumbnail previews of Markdown documents, recently started showing some odd behaviour. Tracking down the cause provided some interesting insights into writing macOS software for a multi-threaded environment.

Thumbnailer-rendered thumbnails
Continue reading

Enjoy some old school 3D arcade action — courtesy of the Raspberry Pi Pico

In the mid-1980s, I loved Phantom Slayer. Written for the Tandy Color Computer and made available for the Dragon 32, Phantom Slayer was a 3D maze shooter. Think a very basic version of Doom with colours but no textures. It wasn’t sophisticated, but it was quick and, more to the point, incredibly atmospheric.

The Pi Pico version of Phantom Slayer
Do you have what it takes to face down the Phantoms?
Continue reading

Released: revamped and expanded Python drivers for your micro projects

I have revised my Python drivers for the Holtek HT16K33 display controller, combining Micropython and Circuitpython versions into one and adding support for Adafruit’s Bi-colour 8×8 Matrix in the process.

Display useful information on a matrix LED
Continue reading

Fontismo 1.1.0 released — now with iPhone support

Fontismo, my iOS-based utility which provides completely free and account-less access to 50 great open licence typefaces, now works on iPhones as well as iPads. It’s also fully compatible with iOS 14 and features improved font previewing, including pinch-to-zoom scaling.

Fontismo on iPhone
Continue reading

Want to bake an Apple Pi? Here’s how you can, for a fiver

Bear with me on this one. What really makes the Raspberry Pi what it is? Linux? No, because there are plenty of machines the open source OS will run on. Linux is a Unix derivative; the basis of macOS is FreeBSD, also a Unix derivative.

Sure the Pi is only 40 quid and small, but for me what really makes the Pi stand out from all those laptop and desktop computers is the fact that it makes its microcontroller’s GPIO pins readily accessible through a handy set of header pins. Unlike all ‘serious’ micros, it’s perfect for connecting to and controlling a whole stack of add-ons, including sensors, displays inputs and actuators.

IMG_0230

Continue reading