This is my adventure reverse engineering a De'Longhi coffeemaker's Bluetooth-Low-Energy-based protocol, writing a rust CLI for it, and hooking it up to GitHub actions to let us brew from either the browser or the GitHub app by filing issues (all the coffee are defined in issue templates).
I'm currently writing Rust for my bachelor thesis using bluez_async[1].
btleplug[2] is great, but at least on Linux I prefer using bluez_async directly, which btleplug is just an interface for there[3], to avoid one more layer of dependencies.
bluez_async is quite similar to btleplug, and, from my experience, if you know one you can use the other just fine.
I'm surprised the De'Longhi BLE protocol doesn't have _any_ replay attack protection. I get that making coffee isn't a safety-critical operation, but you could do some hilariously annoying denial-of-service on the communal coffee machines.
Well, you have to make sure there is coffee, water, cup and perhaps milk present. You have to clean it regularly. I don't think this is very useful in the end.
That said, it's super cool, I'm sure the author enjoyed this and I myself would definitely try to do it too, if I had a chance :D
I'll tell you my theory: it is (or at least, was, for a long time) gaming. There are so many gamers, and they bought expensive hardware, and replaced it frequently. That made developing processors and video cards pretty lucrative. Hence GPU-based neural nets and Bitcoin miners.
Awesome! There is a whole world of Bluetooth devices waiting out there!
Some suffer from broken or outdated Android apps like my Eurochron A620 bluetooth thermometer - the only way to make it work on a modern Android version is to hack it like the OP did. (If only old apps would make their source code publicly available...)
Thank you very much, that was a good read.
Not a long time ago i wanted to do something with ble and rust but it failed miserabily and barely found any documentation for ble on rust, some also said that "rust isn't bluetooth yet". Will definitely give it a try again after seeing that rust can do it.
Sorry for the double comment at the top level, but were you able to experiment with different values for taste, coffee, milk? Or does each recipe require constant values?
It may already be in your write-up, but if it is I missed it, sorry.
I've managed to brew a few custom coffees, including a comically over-sized cappuccino when I forgot to specify milk (apparently not including the ingredient means... use a lot of it?).
The application specifically allows you to program defaults and save beverages, so this is fully supported once you have the recipes decoded.
It's wildly precise - the coffee appears to be measured in "impulses", where a single impulse is somewhere < 5mL (if I were to guess - between 1-2). 250 impulses is juuuust enough to fill my coffee mug, but I think it varies a bit between modes.
The milk is measured in 1/10s of a second of flow, most likely because the volume depends on the foam setting.
I haven't gone as far as pushing the machine out of bounds intentionally, or even sending a parameter that's considered invalid yet.
Or maybe even the whole the Hyper Text Coffee Pot Control Protocol (HTCPCP)
https://en.m.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Contro...